🏛️ Reference compendium

Stateless C++20/23 service design, for containers.

An opinionated reference on what makes a C++ service safe to kill, replace, and replicate at an orchestrator's discretion — and how RAII, PMR, threading, and twelve-factor practice either support that property or quietly undermine it. Read it straight through, or jump to the document that answers the question you have right now.

C++20 / C++23 Docker gRPC PMR allocators 12-Factor OpenTelemetry
11 Chapters, plus a build-tooling appendix
10 Runnable Docker examples
2 Companion decks — 101 on-ramp and 201 compendium
13 Architecture and flow diagrams

The parts

Seven parts, read in order the first time. Each part page lists its chapters; each chapter stands on its own for a reader jumping in to solve one problem. The orientation part is the map — start there if you only have time for one page.

Part 0

Orientation

The map: reading order, a scenario guide, eleven recurring themes, and the State Architecture Table. Start here if you have time for only one document.

1 chapterExplore →
Part 1

Deployment Posture

The vocabulary doc. Statelessness as a deployment posture rather than a code property, the three-scope vocabulary (request, process, deploy-time), and the monolith intuitions that mislead under containerization.

1 chapterExplore →
Part 2

Request-Scope Discipline

RAII as the mechanism that makes request scope concrete, and PMR's monotonic_buffer_resource as its in-language realization — how per-request state is bound to a scope and released all at once.

2 chaptersExplore →
Part 3

Process-Scope Discipline

What legitimately lives for the process lifetime — the State Architecture Table and the main()-owned wiring pattern — and threading and concurrency as the cross-cutting axis that interacts with statelessness in non-obvious ways.

2 chaptersExplore →
Part 4

Operational Concerns

12-Factor adapted to C++, state externalization patterns, the ephemeral filesystem trap, and health checks as the orchestrator's public API into the service — the operational disciplines that make a stateless posture hold up in practice.

4 chaptersExplore →
Part 5

Integration & Tooling

The gRPC order-pricing service that composes every prior pattern, followed by the build-tooling appendix — Conan, CMake, the C++23 feature-support table, and the multi-stage Containerfile.

2 chaptersExplore →
Part 6

Appendix: For Extenders

Authoring notes for compendium extenders — the framing decisions, per-document research findings, and source anchors that drove the drafting. Written for contributors who want to revise or extend the compendium, not a first read.

1 chapterExplore →