One actor, no locks across await: the concurrency design
Crowkis serves thousands of connections through async IO — then funnels every cache decision through a single deterministic actor. Here's why that's a feature.
The architecture splits where architectures should: thousands of connections live on Tokio's async runtime, parsing frames and buffering responses concurrently — IO scales out. But every actual cache command funnels through a bounded channel into one actor thread that owns all engine state and applies commands in strict sequence. Reads and writes never race, because there's nothing to race.
The discipline this buys is easiest to state as an invariant: no locks held across await points, because the hot path holds no locks at all. The classic concurrency bestiary — deadlocks, lock contention spirals, subtle read-write interleavings under load — is absent by construction rather than by vigilance. Tail latency stays flat when concurrency climbs, because the engine's critical section is a queue, not a lock graph.
Reuse only when meaning, structure, confidence, and trust all agree.
Determinism is the quiet superpower: identical command sequences produce identical states, which makes the 347-test suite honest — crash-recovery and stress tests replay scenarios exactly, with no 'flaky under scheduler' asterisks. Debugging production means reasoning about a sequence, not a poset.
The bottom line
Single-writer designs trade theoretical parallel writes for actual predictability. A cache's writes are cheap and its correctness is sacred — the trade signs itself.