Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Rails Support
      • Working with Bundler
    • Python
      • Working with Django
      • Background Jobs in Python
    • Java
      • Working with Maven
      • Java Database Operations
      • Java Advanced Topics
      • Working with Spring Boot
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Add-ons
  • All Add-ons
  • RethinkDB Cloud
RethinkDB Cloud

This add-on is operated by Mostly Typed

Cloud-hosted elastic RethinkDB

RethinkDB Cloud

Last updated June 28, 2022

The RethinkDB Cloud add-on is currently in beta.

Table of Contents

  • Provision the add-on
  • Node.js
  • Python
  • Ruby
  • Java
  • Other languages
  • Changing plans
  • Removing the add-on
  • Support

RethinkDB Cloud provides a hosted RethinkDB database instance. It is fully managed and elastic, i.e., you can add or remove storage instantly and without the loss of data.

RethinkDB is a schema-less document database, similar to MongoDB. In addition, it allows you to subscribe to queries, a powerful realtime feature that is perfect for reactive applications.

Provision the add-on

Start by installing the add-on:

$ heroku addons:create rethinkdb

Once the add-on has been added you’ll notice new variables in heroku config:

$ heroku config
...
RETHINKDB_HOST:           bf1036d9-c2ba-4ae3-ad58-8d14a50117b3.rdb.lf.memcachier.com
RETHINKDB_NAME:           bf1036d9-c2ba-4ae3-ad58-8d14a50117b3
RETHINKDB_PASSWORD:       078c1d4cd2dec203d2db05f788fe5d3a09393bb9
RETHINKDB_PORT:           28015
RETHINKDB_USERNAME:       bf1036d9-c2ba-4ae3-ad58-8d14a50117b3
...

These variables are required when configuring your client to connect to your RethinkDB instance.

Node.js

Install the driver with npm:

$ npm install rethinkdb

You can use the drivers from Node.js like this:

r = require('rethinkdb')
r.connect(
  {
    host: process.env.RETHINKDB_HOST || "localhost",
    port: process.env.RETHINKDB_PORT || 28015,
    username: process.env.RETHINKDB_USERNAME || "admin",
    password: process.env.RETHINKDB_PASSWORD || "",
    db: process.env.RETHINKDB_NAME || "test",
  },
  function (err, conn) {
    if (err) throw err;
    r.tableCreate("tv_shows").run(conn, function (err, res) {
      if (err) throw err;
      console.log(res);
      r.table("tv_shows")
        .insert({ name: "Star Trek TNG" })
        .run(conn, function (err, res) {
          if (err) throw err;
          console.log(res);
        });
    });
  }
);

Check out the official ten-minute guide and the ReQL command reference to learn how to use RethinkDB.

Python

Install the driver with pip:

$ pip install rethinkdb

You can use the drivers from Python like this:

from rethinkdb import r
r.connect(host=os.getenv('RETHINKDB_HOST', 'localhost'),
          port=os.getenv('RETHINKDB_PORT', 28015),
          user=os.getenv('RETHINKDB_USERNAME', 'admin'),
          password=os.getenv('RETHINKDB_PASSWORD', ''),
          db=os.getenv('RETHINKDB_NAME', 'test')).repl()
r.table_create('tv_shows').run()
r.table('tv_shows').insert({ 'name': 'Star Trek TNG' }).run()

Check out the official ten-minute guide and the ReQL command reference to learn how to use RethinkDB.

Ruby

Install the driver with gem:

$ gem install rethinkdb

You can use the drivers from Ruby like this:

require 'rubygems'
require 'rethinkdb'
include RethinkDB::Shortcuts
r.connect(:host => ENV['RETHINKDB_HOST'] || 'localhost',
          :port => ENV['RETHINKDB_PORT'] || 28015,
          :user => ENV['RETHINKDB_USERNAME'] || 'admin',
          :password => ENV['RETHINKDB_PASSWORD'] || '',
          :db => ENV['RETHINKDB_NAME'] || 'test', ).repl
r.table_create('tv_shows').run
r.table('tv_shows').insert({ 'name'=>'Star Trek TNG' }).run

Check out the official ten-minute guide and the ReQL command reference to learn how to use RethinkDB.

Java

Installation

Maven

If you’re using Maven, add this to your pom.xml file:

<dependencies>
  <dependency>
    <groupId>com.rethinkdb</groupId>
    <artifactId>rethinkdb-driver</artifactId>
    <version>2.4.1</version>
  </dependency>
</dependencies>

Gradle

If you’re using Gradle, modify your build.gradle file:

dependencies {
    compile group: 'com.rethinkdb', name: 'rethinkdb-driver', version: '2.4.1'
}

Ant

If you’re using Ant, add the following to your build.xml:

<artifact:dependencies pathId="dependency.classpath">
  <dependency groupId="com.rethinkdb" artifactId="rethinkdb-driver" version="2.4.1" />
</artifact:dependencies>

SBT

If you’re using SBT, add the following to your build.sbt:

libraryDependencies += "com.rethinkdb" % "rethinkdb-driver" % "2.4.1"

Usage

You can use the drivers from Java like this:

import com.rethinkdb.RethinkDB;
import com.rethinkdb.gen.exc.ReqlError;
import com.rethinkdb.gen.exc.ReqlQueryLogicError;
import com.rethinkdb.model.MapObject;
import com.rethinkdb.net.Connection;

public static final RethinkDB r = RethinkDB.r;

Map<String,String> envs = System.getenv();

Connection conn = r.connection()
    .hostname(envs.getOrDefault("RETHINKDB_HOST","localhost"))
    .port(Integer.parseInt(envs.getOrDefault("RETHINKDB_PORT","28015")))
    .user(envs.getOrDefault("RETHINKDB_USERNAME","admin"), envs.getOrDefault("RETHINKDB_PASSWORD",""))
    .dbname(envs.getOrDefault("RETHINKDB_NAME","test"))
    .connect();

r.tableCreate("tv_shows").run(conn);
r.table("tv_shows").insert(r.hashMap("name", "Star Trek TNG")).run(conn);

Check out the official ten-minute guide and the ReQL command reference to learn how to use RethinkDB.

Other languages

Find drivers and documentation for other languages on the official RethinkDB page.

Changing plans

You may change your RethinkDB Cloud plan using the Heroku CLI or Dashboard.

Removing the add-on

RethinkDB Cloud can be removed via CLI:

$ heroku addons:destroy rethinkdb --confirm [your-app-name]

This will destroy all associated data and cannot be undone!

Support

Submit any support queries to support@mostlytyped.com.

Keep reading

  • All Add-ons

Feedback

Log in to submit feedback.

Ziggeo Rollbar

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences