Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Introduction to RethinkDB : Move fast and break...
Search
Jorge Silva
August 06, 2015
Programming
310
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction to RethinkDB : Move fast and break things
Jorge Silva
August 06, 2015
Transcript
33 slides
Push databases, RethinkDB, and building realtime apps Move Fast and
Break Things San Francisco, CA August 5, 2015
Jorge Silva Developer Evangelist @ RethinkDB @thejsj
Preface The realtime web
Realtime apps
Realtime apps
Realtime apps • More and more apps are built to
be realtime • Users have come to want and expect this behavior in their apps • Building realtime apps is hard
Building realtime apps is hard • You can keep everything
in a single server • You can poll the database to keep track of updates • You can publish updates through a message broker
Building realtime apps is hard • All solutions present a
tradeoff between scalability and complexity • It’s hard to keep track of state in realtime architectures
Introduction What is RethinkDB?
What is RethinkDB? • Open source database for building realtime
web applications • NoSQL database that stores schemaless JSON documents • Distributed database that is easy to scale
Push Database • Subscribe to change notifications from database queries
(changefeeds) • No more polling — the database pushes changes to your app • Reduce the amount of plumbing needed to stream live updates
Push Database • Having your database push changes keeps your
database as the central source of truth • Having a central source of truth simplifies your architecture
Push Database RethinkDB is an excellent database for: • Collaborative
web and mobile apps • Multiplayer games • Streaming analytics apps • Connected devices
Introduction to ReQL RethinkDB Query Language
Introduction to ReQL • ReQL embeds natively into your programming
language • Compose ReQL queries by chaining commands
Anatomy of a ReQL Query r.table("users") .pluck("last_name") .distinct().count() Number of
unique last names
Anatomy of a ReQL Query r.table("users") .pluck("last_name") .distinct().count() Access a
database table
Anatomy of a ReQL Query r.table("users") .pluck("last_name") .distinct().count() Isolate a
document property
Anatomy of a ReQL Query r.table("users") .pluck("last_name") .distinct().count() Consolidate duplicate
values
Anatomy of a ReQL Query r.table("users") .pluck("last_name") .distinct().count() Display the
number of items
Sample ReQL Queries r.table("users") .filter(r.row("age").gt(30)) r.table(“post") .eqJoin(“uId”, r.table(“users”)) .zip() r.table("fellowship")
.filter({species: "hobbit"}) .update({species: "halfling"})
Additional ReQL Features • Geospatial indexing for location- based queries
• Date and time functions • Support for storing binary objects • Execute http requests using r.http
Realtime Updates Working with Changefeeds
Subscribe to change notifications on database queries Changefeeds
r.table("users").changes() Track changes on the users table Changefeeds
Changefeeds • The changes command returns a cursor that receives
updates • Each update includes the new and old value of the modified record
Changefeeds r.table("users").changes() r.table("users") .insert({name: "Bob"}) Changefeed output: { new_val: {
id: '362ae837-2e29-4695-adef-4fa415138f90', name: 'Bob', ... }, old_val: null }
Changefeeds r.table("users").changes() r.table("users") .filter({name: "Bob"}).delete() Changefeed output: { new_val: null,
old_val: { id: '362ae837-2e29-4695-adef-4fa415138f90', name: 'Bob', ... } }
Changefeeds r.table("users").changes() r.table("users") .get("362ae837-2e29-4695-adef-4fa415138f90") .update({name: "Bobby"}) Changefeed output: { new_val:
{ id: '362ae837-2e29-4695-adef-4fa415138f90', name: 'Bobby' }, old_val: { id: '362ae837-2e29-4695-adef-4fa415138f90', name: 'Bob' } }
Changefeeds r.table("players") .orderBy({index: r.desc("score")}) .limit(3).changes() Track top three players by
score Chain the changes command to an actual ReQL query:
Questions http://questions.rethinkdb.com
Summary • Keeping track of state in realtime apps is
hard • RethinkDB solves this problem by pushing changes to your app • In the future, we'll see more database that use the push model
Questions • RethinkDB website: http://rethinkdb.com • Install RethinkDB: http://rethinkdb.com/install/ •
Email me:
[email protected]
• Tweet: @thejsj, @rethinkdb
More Decks by Jorge Silva
See All by Jorge Silva
ForwardJS - RethinkDB - Getting Started
thejsj
0
260
ForwardJS - RethinkDB - Advanced Queries
thejsj
1
270
Automatic Failover in RethinkDB
thejsj
0
290
Workshop: Introduction to RethinkDB : Santa Cruz JS
thejsj
1
180
Push databases: A better way to build realtime apps
thejsj
0
170
Data Modeling in RethinkDB
thejsj
4
310
RethinkDB+Angular.js: Building realtime web applications
thejsj
10
30k
Introduction to RethinkDB: 1KE Meetup
thejsj
0
97
Introduction to RethinkDB : Hack Reactor
thejsj
4
480
Other Decks in Programming
See All in Programming
Kotlin Fest 2026: Kotlin コンパイラに Contribute してみよう! - Kotlin/Wasm で深い再帰を書けるようにした話
ternbusty
1
200
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
380
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
330
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
190
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
2
160
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
180
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
2.1k
Distance field of Julia set
kinakomoti321
0
330
あなたはMCPの機能を、まだ知らない。
4geru
1
350
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
150
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.7k
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
270
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
350
Amusing Abliteration
ianozsvald
1
390
Music & Morning Musume
bryan
48
7.5k
Designing for Timeless Needs
cassininazir
1
560
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Highjacked: Video Game Concept Design
rkendrick25
PRO
2
570
Marketing to machines
jonoalderson
1
6k
Designing Experiences People Love
moore
143
24k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
310
Are puppies a ranking factor?
jonoalderson
2
4.2k