Starting the Compose Grand Tour - How to database for all

Published

The Grand Tour is a Compose project to maintain examples that cover connecting and working with every Compose database across a wide range of languages and drivers.

We get to answer a lot of questions about databases here at Compose. The most important of those questions is usually "How do I connect to my new database?". With nine databases and so many languages out there, we knew there had to be a better way. So we've embarked on a Grand Tour... of examples and we're inviting you to join us.

Driven by an example

We started with a simple idea. Create an example that's more than "Hello World", something that works on the web and won't need to be re-engineered for each language. The idea is that once you know what the example does, the different database connection code for any language will stand out and we can go further than just "open a connection" and give simple insert and query code.

We have created a basic web application that is just enough to present a page for words and definitions and a small form to add words and definitions to that list. All the example code has to do is be able to serve up static web pages and have two endpoints; one that returns all the current words and definitions and one that takes and adds a new word and definition.

For each language we will cover in the Grand Tour, we plan to have an accessible unconnected version of the example from which all the connected versions can be built. We also set out to usefully comment these examples and make sure that if you configure an example for one database in one language, other language examples will safely reuse the configuration.

There is one exception to this rule and that's RabbitMQ; being a message queue, we changed the example to a simple, web-based message sender and receiver using the same basic framework as the database examples.

The first three languages - Node, Python and Go

We're releasing early with our first batch of Grand Tour examples to get feedback from users and to invite developers to create examples for their preferred languages, drivers and databases.

The first batch being released today are for Node (with Elasticsearch, etcd v2, MongoDB, MySQL, PostgreSQL, RabbitMQ, Redis, RethinkDB and Scylla), Python (Elasticsearch, MongoDB, PostgreSQL, Redis and RethinkDB) and Go (Elasticsearch, etcd v3, MongoDB, PostgreSQL, RabbitMQ, Redis and RethinkDB).

Where to find the Grand Tour

The Compose Grand Tour has its own Github repository at github.com/compose-grandtour where you can download any one of language sets for a complete set of current database examples for that language. We'll be adding and enhancing the examples in the Grand Tour as it progresses and we invite you to give us your issues, feedback and your own takes on our Grand Tour examples. The journey begins here...


If you have any feedback about this or any other Compose article, drop the Compose Articles team a line at articles@compose.com. We're happy to hear from you.

attribution Bady Qb

Dj Walker-Morgan
Dj Walker-Morgan is Compose's resident Content Curator, and has been both a developer and writer since Apples came in II flavors and Commodores had Pets. Love this article? Head over to Dj Walker-Morgan’s author page to keep reading.

Conquer the Data Layer

Spend your time developing apps, not managing databases.