Inside a DO, think three tiers: L0 memory (fast, volatile), L1 SQLite (strongly consistent, private to the object), L2 outside (R2, D1, queues — long-term and shared).
Recent messages and presence → L0 cache; message bodies and settings → L1; old archives and big blobs → L2.
Commit L1, then refresh or invalidate L0. Reads: L0 → L1 → L2. Index hot SQL columns.
Needed after wake? → L1+. Shared across rooms/analytics? → L2. Read thousands/sec? → L0. Huge blob? → R2.
New classes: use new_sqlite_classes. SQLite is the modern default over legacy KV-only backends.
Part 5 turns time into a state machine with alarms.