GrapheneDB Blog

Updates from the GrapheneDB team

Heroku Add-on With Shareable Multiple Installs

In the past, provisioning Neo4j instances with the GrapheneDB Heroku add-on has been limited to one database per application.

Our customers often provided feedback that they wanted to spin up additional database instances to perform tests, do database sharding, or to have different databases for different purposes connected to the same app.

To provision additional databases, customers relied on workarounds such as creating dummy apps, adding environment variables manually to share the GrapheneDB connection URIs across apps. Needless to say this can be an error-prone hassle.

We have heard your feedback, and we are excited to announce that we’ve improved our Heroku add-on by adding support for multiple installs per app, and making them shareable across apps.

Heroku add-on

Below, you can find an example of how to provision a database by specifying the name of the database as well as the app.

$ heroku addons:create graphenedb:chalk --name my-other-graphenedb-db -a my-graphenedb-app
Creating my-other-graphenedb-db... done, (free)
Adding my-other-graphenedb-db to my-graphenedb-app... done
Setting GRAPHENEDB_MAUVE_URL and restarting my-graphenedb-app... done, v4
Your Neo4j database is being deployed. It can take some minutes before it's ready for use.
Use `heroku addons:docs graphenedb` to view documentation.

Please note that to avoid collision of environment variable names, the following logic is applied if a name is not specified:

  • If there is no GrapheneDB database for the specified app, the database will be named graphenedb and the environment variable will be GRAPHENEDB_URL.

  • If there are already other GrapheneDB databases and the graphenedb name is taken, a random color will be appended to the graphenedb name. An example of the resulting environment variable would be GRAPHENEDB_COBALT_URL

An existing GrapheneDB add-on database can be attached to an app using the attach command:

$ heroku addons:attach my-other-graphenedb-db -a other-graphenedb- Attaching my-other-graphenedb-db to other-graphenedb-app... done
Setting GRAPHENEDB_COBALT vars and restarting other-graphenedb-app... done, v6

If the GRAPHENEDB_URL environment variable is not taken, GRAPHENEDB_URL will point to the most recently attached database. Otherwise, a random name will be assigned (as in the example above GRAPHENEDB_COBALT_URL).

You can also specify the desired name when attaching an add-on with the –as parameter:

$ heroku addons:attach my-other-graphenedb-db --app other-graphenedb-app --as GRAPHENEDB_FOO
Attaching my-other-graphenedb-db as GRAPHENEDB_FOO to other-graphenedb-app... done
Setting GRAPHENEDB_FOO vars and restarting other-graphenedb-app... done, v8

We look forward to hearing how you use the new and improved Heroku add-on! Feel free to tweet us about your experiences at @graphenedb on Twitter, or email us at if you have any questions.