Status: Roadmap stub. Phase A and beyond require their own detailed plan files before subagent dispatch. Do NOT try to execute this file directly — it is an index.
Source of design: /data/smartbotic-database/docs/2026-05-15-v2.0-storage-engine-design.md (316 lines, already merged into main as the canonical design).
Why this exists: The operator asked to "proceed with them all" — all three phases of the v2.0 design. Phases A/B/C span ~4–5 months of engineering and cannot execute in a single session. This file:
These apply to every phase, not just Phase C:
2026-05-15-v1.9.5-backup-before-upgrade.md). Every subsequent release inherits this safety net.--migrate-from-v1 mode is required (see Phase C plan when written).apt install smartbotic-database=<old-version> plus the v1.9.5 backup restore procedure must remain a working rollback for at least one release back.Status: Plan not yet written. Blocked on: writing 2026-05-15-v1.10-yyjson-phase-a.md.
Goal: Replace nlohmann::json parsing with yyjson at hot paths (WAL replay, snapshot deserialize, gRPC request bodies, history reads). Keep nlohmann::json as the in-memory document representation — Phase A is a parse-speed win, not a memory win.
Honest impact assessment: With jemalloc already shipped in v1.9.4, RSS is bounded. Phase A buys faster boot (parse-heavy paths) and slightly lower gRPC request latency on large bodies, but does not reduce steady-state memory. The operator should know this before Phase A is scheduled — if memory is the priority, Phase B is the work that matters.
Files in scope (parse sites identified, see grep output in the design doc):
service/src/persistence/wal.cpp:233,249 — replayservice/src/persistence/snapshot.cpp:820,929,963 — deserializeservice/src/persistence/history_store.cpp:124 — version readservice/src/database_grpc_impl.cpp — Insert/Update/Patch/Find handlers (~10 call sites)service/src/database_service.cpp:722 — replication applypackaging/Dockerfile.base — add libyyjson-devpackaging/deb/templates/control.server — add libyyjson0 runtime depservice/CMakeLists.txt — pkg_check_modules(yyjson REQUIRED) or find_package(yyjson)Task breakdown sketch (to be expanded in the Phase A plan file):
yyjson_to_nlohmann(const yyjson_val*) -> nlohmann::json — the bridgeTime estimate: 1–1.5 weeks of subagent-driven work across 2–3 sessions.
Status: Plan not yet written. Blocked on: writing 2026-05-15-v1.11-binary-docs-phase-b.md and settling the format choice.
Goal: Document in-memory representation changes from heap-allocated nlohmann::json AST → std::vector<uint8_t> binary with lazy .data() accessor that parses on demand. This is the phase that actually reduces memory.
Format decision (open): BSON vs custom packed-JSON tape vs yyjson mut_doc-as-storage. Each has trade-offs:
Pre-execution work: Operator should brainstorm format choice (superpowers:brainstorming skill) before this plan can be written.
Files in scope: service/src/document.hpp, service/src/memory_store.cpp/.hpp, every callsite that does doc.data["field"] (large blast radius — ~80+ call sites across service + tests).
Wire compatibility: gRPC Document.data stays JSON text on the wire. Conversion happens at the boundary.
Snapshot compat: Snapshot format v6 emits documents as JSON text (same as v5) so v1.10 readers still work. Phase C is where the on-disk format breaks.
Time estimate: 3–4 weeks across 5–8 sessions.
Status: Plan not yet written. Blocked on: the build-vs-buy spike (1 week) AND a brainstorm session on the architecture AND writing 2026-05-15-v2.0-storage-engine-phase-c.md.
Goal: Replace the "load everything into memory" architecture with bounded-memory disk-backed page storage. This is the real "act like MySQL/InnoDB" rewrite.
The build-vs-buy spike (must run first):
The spike picks one. Without that decision, the Phase C plan cannot be written.
Required cross-cutting work in Phase C:
--migrate-from-v1 boot mode: read v1.x snapshot + replay v1.x WAL into pages, then write a v2.0 checkpoint and start serving/var/lib/smartbotic-database/pages/max_memory_mb → buffer_pool_size_mb; evicted stubs / WAL fallback / docWalSeq_ all deletedTime estimate: ~13 weeks across many sessions, contingent on spike outcome.
2026-05-15-v1.10-yyjson-phase-a.md with full task breakdown (use superpowers:writing-plans). Then dispatch implementers per superpowers:subagent-driven-development.