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.
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.
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.
How to use
- Install RethinkDB from the official packages or run it via Docker.
- Start the server and open the web admin UI at port 8080.
- Create a database and tables using the Data Explorer or the client driver.
- 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}')
)
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));
});
Related on TokRepo
- Database tools — Explore database tools and integrations
- Self-hosted tools — Other self-hosted infrastructure components
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
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.
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.
Yes. RethinkDB supports automatic sharding and replication across multiple nodes. You can add servers to a cluster and the database redistributes data automatically.
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.
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)
- RethinkDB GitHub— RethinkDB pushes query results to applications in real time
- RethinkDB Documentation— Changefeeds enable real-time subscriptions on queries
- RethinkDB Blog— RethinkDB joined the Linux Foundation after the original company closed
Related on TokRepo
Discussion
Related Assets
HumHub — Open-Source Enterprise Social Network
A flexible, open-source social networking platform built on Yii2 for creating private communities, intranets, and collaboration spaces within organizations.
Dolibarr — Open-Source ERP & CRM for Business Management
A modular open-source ERP and CRM application written in PHP for managing contacts, invoices, orders, inventory, accounting, and more from a single web interface.
PrestaShop — Open-Source PHP E-Commerce Platform
A widely adopted open-source e-commerce platform written in PHP with a rich module marketplace, multi-language support, and a strong European user base.