RethinkDB Now Available in Beta

We're happy to announce RethinkDB is now available to use with Nanobox apps. Test it locally, deploy it to live servers, and scale it. RethinkDB support is currently considered beta and we'd love some help testing the integration before removing the beta flag.

What is Nanobox?

Create a RethinkDB Database

To include a RethinkDB database in your app, add a data component to your boxfile.yml with the image set to nanobox/rethinkdb:2.3:

data.db:
  image: nanobox/rethinkdb:2.3

Re-Run Your App Locally

The next time you run your app locally, Nanobox will detect the change to your boxfile.yml, rebuild your runtime, and provision your RethinkDB component.

nanobox run

Install Client Drivers, Connect, & Setup

With your RethinkDB database running, install a client driver, connect to RethinkDB and setup the database, users, etc. How you do this depends on the language you’re using:

Install RethinkDB Drivers

Note: These instructions should be followed from within the Nanobox console after you run nanobox run.

Connect to RethinkDB

Nanobox will auto-generate a _HOST environment variable to use when connecting to RethinkDB. Using the auto-generated environment variable in your connection config will keep your app portable across your environments. The environment variable key is based off your database's component ID.

Any RethinkDB database created with Nanobox will always listen on the default port, 28015.

Node.js Connection Example

module.exports = {
  rethinkdb: {
    host: process.env.DATA_DB_HOST,
    port: 28015,
    authKey: '',
    db: 'rethinkdb'
  }
}

Enjoy!

Have fun using RethinkDB with Nanobox. If you have any questions, feel free to reach out at hello@nanobox.io or in the Nanobox Slack channel. You can also submit issues on the Nanobox RethinkDB project itself.

RethinkDB with Nanobox
Managing Local RethinkDB Data with Nanobox
Managing Production RethinkDB Data with Nanobox

Posted in Features