Jump to a problem, path or page
01 · Frame the problem
Build an inbox with an API service for reads and ingestion, a queue and spam workers for delivery, a mailbox store for metadata and ordered changes, and object storage for immutable bodies. Clients synchronize through retained mailbox sequences; outbound delivery and mail protocol implementation are separate.
Mailbox metadata needs ordered synchronization while message bodies remain immutable and separately authorized. Analyse cursor retention, snapshot boundaries and concurrent flag/folder changes before designing client sync.
02 · Find the design pressure
Begin with one mailbox-local Mailbox store owner and transactional Mailbox store change sequence. Polling mutable pages misses intervening moves or deletions. Use snapshot-plus-watermark recovery and provider-independent revision checks to preserve a coherent client mirror.
03 · Define success
Workload: 30,000 reads/s, 8,000 writes/s, 3000 B records, 250 ms read p99 target. These are exercise assumptions; the Solution includes capacity formulas.
04 · Identify the correctness boundary
Mutable flags, folders and deletions share mailbox-local ordering, while immutable message bodies are separately authorized. Commit a metadata change and its journal entry together. Snapshot-plus-watermark recovery closes the gap when an incremental cursor is older than retained history.
05 · Make it concrete
A client reads snapshot watermark 500, then consumes changes after 500 while receiving remaining snapshot pages. A concurrent move to another folder appears in the journal and is not lost. Replaying that move is revision-safe, and a deleted message's body cannot be fetched through an unscoped object reference.
Jump to a problem, path or page