Lightning Updates
summary
A C++ update system for hundreds of millions of users that stores states as immutable metadata/snapshots/deltas addressed by content-addressable hashes, implemented with only the standard library. Clients download tiny metadata or delta files (often a few kilobytes), find a path using timestamped “jump” links (hourly/daily/weekly shortcuts), and apply patches via a user-provided apply function; state is published with an atomic shared_ptr of immutable state so switches are atomic and zero-copy. Used patterns include strong wrapper types for hashes, signature verification, and virtual‑filesystem diffs for AV signatures and config sync.
AI-written summary · about
chapters (16)
- 0:00Introduction to app updates
- 1:15Immutable state updates
- 2:41Delta and snapshot updates
- 5:05Content-addressable hashes
- 8:41Metadata and graph structure
- 11:47Strong typing for hashes
- 16:20Object variants and validation
- 20:36State management with shared pointers
- 23:45Pathfinding in update graphs
- 27:43Downloading update paths
- 33:05Applying updates atomically
- 36:34Five functions for any data type
- 38:40Update API design
- 41:10User workflow with updates
- 43:17Real-world use cases
- 45:56Q&A on update strategies
