Adding a local RethinkDB database

Back To Blog

In this tutorial we will add a RethinkDB database in the db/ folder working in an opeNode instance. It is worth noting that it will consume at least 20 MB extra memory, so if you use for instance the smallest instance plan, it is recommended to increase your plan. You can enable RethinkDB by adding the following instructions in your docker-compose.yml:

    image: rethinkdb
      - /opt/app/db/:/opt/app/db/
      - 28015
    command: rethinkdb --bind all -d /opt/app/db/ --no-update-check

It can be generated automatically by running the following command:

openode template --with-services rethinkdb

Further, make sure to define a storage area so that it does not get deleted on updates (persistent):

openode add-storage-area db/

And also make sure to ignore that folder by creating an .openodeignore file with:


We tested it with a simple Node.js TODO application, please see this repository.

Important Notice:

Note that it is NOT recommended to use a database as described in this doc, it is recommended to use an external database service.

When you redeploy, make sure to first:

openode stop

and then deploy:

openode deploy

If you do not stop it first, it might corrupt your database storage, as we do blue-green deployments and when it is redeploying, 2 instances of your site is running in parallel.

You could consider to sync and reload instead:

openode sync
openode reload

Added on Wed Dec 05 2018 01:00:40 GMT+0000 (Coordinated Universal Time)