What does it mean to be a

Real-Time Database?

bit.ly/meteor-rt-db

Meteor architecture

Optimistic UI

aka "Latency Compensation"

aka "client-side prediction"

"Dead reckoning" in gaming pathing

"speculative mutations"

Latency Compensation in Whatsapp

Latency Compensation in Hackpad

Learn about Optimistic UI

http://bit.ly/optimistic-ui

[demo of instagram.com]

User clicks a button =>

    if (inSimulation) {
      addMessage(
        message: msg
        isInFlight: true
        ...)
    } else {
      addMessage(message: msg ...)
    }

Run RPC simulation =>

Run actual RPC =>

Display simulated changes =>

Propagate updates =>

"update"

Display actual changes =>

http://bit.ly/ddp-spec

MongoDB oplog

Timestamps!

Changes!

The RethinkDB integration

Works

  • Queries
  • Pub/sub
  • RPCs
  • Client-side cache
  • Reqlite
  • Client-side sim

Doesn't work

  • Latency compensation
  • Complex queries
  • Filtering pub/sub
  • Reqlite

Postgresql?

  • Replication log == WAL
  • pg_current_xlog_location

  • pg_current_xlog_insert_location

Real-time database

  • Can query
  • Gives notifications with initial set
  • Gives more metadata with revision numbers
  • stores data
  • doesn't lose data
  • doesn't force you to write queries in Erlang

What does it mean to be a Real-Time Database?

By Slava Kim

What does it mean to be a Real-Time Database?

  • 1,932