An Adventure in Modern C++ Library Design
summary
A file‑based time series database optimized for market data supports live intraday querying and returns an outcome-wrapped update_status (processed, complete, or none_for_now) so queries can stream without blocking. The library layers a safe parsing operation update_as over erased byte buffers, uses CPOs/ADL and std::variant/CTAD, models queries as incremental streams, and implements a dynamic branch algorithm to expand hierarchical queries. The new stream framework solves the “snapshot aligned to last transaction begin” use case, was implemented, tested and deployed to the client within a week.
AI-written summary · about
chapters (27)
- 0:00Introduction to the problem
- 0:37Time series database overview
- 1:37Optimizing for live queries
- 3:07Database interaction code
- 4:58Handling live intraday data
- 6:24Sharding and merging data
- 8:32Solving merge sort issues
- 10:41Decoupling time and data
- 12:45Type safety in queries
- 14:03Abstracting query concepts
- 16:47Customizable function protocols
- 18:54Incremental computation
- 20:59Filtering in stream model
- 22:58Hierarchical query expansion
- 25:45Rethinking the stream model
- 28:47Defining the run operation
- 32:32Implementing customization points
- 36:11Expression equivalence
- 39:26Revisiting snapshot problems
- 44:45The Branch algorithm
- 48:20Implementing filter stream
- 52:15Metaprogramming challenges
- 57:45Implementing filter logic
- 1:01:46Object construction issues
- 1:04:11C++ 17 and 23 features
- 1:06:54Stream composition conclusion
- 1:10:10Q&A and final thoughts
related talks
40mAdd Simplicity to Complex Systems
39mTemporal Dynamics - Exploring the Intricacies of Object Lifetimes in Modern C++
39mTemporal Dynamics - Exploring the Intricacies of Object Lifetimes in Modern C++
59mThe Most Valuable Values
43mEvent Sourcing dealing with an eventful past
38mAdding Simplicity to Complexity
59mWhat's New In The C++14 Library
32mC++ Standard Library "Little Things”
