Single Leader
Postgres, MySQL, ..
Usually requires extensions and helpers to setup
Follower Failure
- Get a snapshot from a leader
- Get changes since the snapshot
Leader Failure
More tricky
- Detect the leader is down
- Elect a new leader
- Make sure each node recognizes the new leader and the old leader accepts that its a follower now
Lag Problems
- Read your writes
- Monotonic reads, you should not read an older value than they have seen
- Consistent prefix reads, preserving order of writes, thus causality
Transactions in a single node db solves them yet we need application level mechanisms for distributed nodes although they are complex and error-prone
🎰