Makings of a Modern ACID Compliant Distributed Database

  • FaunaDB, implementation of Calvin
  • Always strongly consistent
  • Replicas, each sharded (randomly)
  • Multiple raft clusters, each typically with one node in each replica
  • Each cluster forms consensus for a transaction log, call this a log segment
    • Log segments are divided into epochs, 10ms each
    • All the log segments together form the full transaction log
    • Segments are merged, each segment is numbered + lower numbers win ties (within an epoch)
  • Node receives a write, calculates the reads and writes necessary, and adds this to the transaction log
    • When the transaction log is later read (by all nodes), check if the values for all reads match up; if so, apply the write
    • Wait a beat before ACKing to give all nodes time to get to that point in the log
  • Optimistic concurrency control, no locks
  • Transaction log entries use logical timestamps
  • Reads are performed against a timestamp for strong consistency

Stopped at 31:14