How shit works: Time|
summary
A website-builder called Wix Adi uses event sourcing and a relational DB but finds persisted events arrive out of order; system timestamps prove unreliable (OS resolution ~100 ns, NTP accuracy cited ~10 ms, crystal drift hundreds of µs). The concrete fix is to stop keying on time, add a version column as a composite primary key, let the DB enforce serialization (primary-key violations reveal races) and handle conflicts by retry, reject, or merge. Lamport timestamps and vector clocks are noted for multi-node cases.
AI-written summary · about
chapters (29)
- 0:00Introduction
- 0:50Adis dream
- 3:18Traditional RDBMS
- 4:25Corrupted data
- 5:50pathological situations
- 6:43how shit works
- 7:32what is time
- 8:07Encoding
- 8:35Timestamps
- 12:48The 80s
- 13:30Battery backups
- 14:36System Clock
- 15:28Clock Drift
- 17:37Distributive Time
- 18:36Clock Cues
- 19:22Network Time Protocol
- 19:42NTP Accuracy
- 21:49Push comes to shove
- 22:00Datastore time stamps
- 22:31Not good enough
- 22:43TLDR version
- 24:21Timestamps dont matter
- 25:35Two types of relationships
- 27:38What we need
- 29:18What we can do
- 31:24Write atomically
- 33:04Primary key violation
- 39:01Bonus
- 39:36Summary
related talks
30mCatching Waves with Time-Series Data
01h 08mKeynote: Building Spanner
01h 04mFrom CRUD to Event Sourcing
32mYou Depend on Time, This Is How It Works and You Won’t...
28mData corrupting architectures we know and love
29mHow to Read the Exact Time When You Have a Billion Clocks
48mEvent Sourcing - what could possibly go wrong?
01h 05mWorking with Time is Easy
