Optimistic updates in a pessimistic world
summary
Concrete claim: implement optimistic updates by keeping optimistic state separate, logging transactions, and reconciling with a server-side state so rollbacks affect only the failing transaction. Uses DataScript style immutable in-memory DB, shows tradeoffs of temporary IDs versus client-generated IDs (use crypto API for secure randomness), and recommends a front-end request queue and batch payloads to avoid cascading failures. Demonstrated with the open‑sourced Precursor prototype: live optimistic edits, undo/replay, multiplayer syncing, offline retrying, and it works in practice.
AI-written summary · about
chapters (10)
- 0:00Intro
- 1:25Definition
- 4:50Properties
- 5:38RealA
- 6:34Datascript
- 9:24Predicting IDs
- 9:48Temporary IDs
- 12:30Concurrent updates
- 13:18Main points
- 19:32Precursor
related talks
23mOptimistic UI updates with Apollo Client and React
32mCRDT and other new ideas for client-server communication
29m"Optimistic UI with Logux & Ruby"
21mAsynchronous UX
23mBuilding Offline and Real-Time Applications - The Magic of CRDTs
20mOffline-First React Native: Designing for production
28mFor optimists, our UI is pretty pessimistic
24mZero-Latency React Native: Apps Without Loading Spinners
