ConfigsApr 16, 2026·3 min read

RethinkDB — The Real-Time Document Database

RethinkDB is an open-source document database that pushes query results to your application in real time. Build live dashboards and collaborative apps without polling.

TL;DR
RethinkDB pushes updated query results to your app in real time, eliminating the need for polling.
§01

What it is

RethinkDB is an open-source document database designed for real-time applications. Unlike traditional databases where your application polls for changes, RethinkDB pushes updated query results to your application automatically using changefeeds.

Developers building live dashboards, collaborative editing tools, multiplayer features, or any application that needs instant data updates will benefit from RethinkDB's push-based architecture.

§02

How it saves time or tokens

RethinkDB eliminates the polling pattern entirely. Instead of writing timer-based queries that check for updates every N seconds, you subscribe to a changefeed once and receive updates as they happen. This reduces both server load and application complexity. No more websocket middleware to bridge the gap between your database and your frontend.

§03

How to use

  1. Install RethinkDB from the official packages or run it via Docker.
  2. Start the server and open the web admin UI at port 8080.
  3. Create a database and tables using the Data Explorer or the client driver.
  4. Subscribe to changefeeds in your application code.
import rethinkdb as r

conn = r.connect('localhost', 28015)
r.db('myapp').table('messages').changes().run(conn, callback=lambda change:
    print(f'New change: {change}')
)
§04

Example

A real-time chat application with RethinkDB requires minimal code. Insert a message into the messages table, and every connected client subscribed to the changefeed receives it instantly:

// Node.js client subscribing to changes
const r = require('rethinkdb');
const conn = await r.connect({ host: 'localhost', port: 28015 });
r.db('chat').table('messages').changes().run(conn, (err, cursor) => {
  cursor.each((err, change) => console.log('New message:', change.new_val));
});
§05

Related on TokRepo

§06

Common pitfalls

  • RethinkDB's community maintenance status means fewer frequent releases. Evaluate long-term support needs.
  • Changefeeds consume server resources proportional to the number of subscriptions. Monitor connection counts.
  • The ReQL query language has a learning curve if you come from SQL or MongoDB backgrounds.

Frequently Asked Questions

Is RethinkDB still maintained?+

RethinkDB is maintained by its open-source community after the original company shut down in 2016. The Linux Foundation hosts the project. Development continues but at a slower pace than commercially backed databases.

How do changefeeds work in RethinkDB?+

Changefeeds let you subscribe to a query. When any document matching the query is inserted, updated, or deleted, RethinkDB pushes the change to your client connection. This works on single tables, filtered queries, and even aggregations.

Can RethinkDB scale horizontally?+

Yes. RethinkDB supports automatic sharding and replication across multiple nodes. You can add servers to a cluster and the database redistributes data automatically.

What query language does RethinkDB use?+

RethinkDB uses ReQL, a query language embedded in your programming language. ReQL calls are chainable method calls in Python, JavaScript, Ruby, and other supported drivers, making queries feel native to your code.

How does RethinkDB compare to MongoDB?+

Both are document databases, but RethinkDB is built for real-time push via changefeeds, while MongoDB requires polling or Change Streams (added later). RethinkDB prioritizes developer experience for real-time use cases.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets