Projector
The Projector service (app/projector/) builds the Valkey settings projection that consumer services (primarily Sesame) use for high-throughput reads.
Architecture
Section titled “Architecture”Instead of having high-traffic consumer workers execute SQL queries against the various data services (Users, Modules, Commands), the Projector constructs flattened read-models.
- Trigger: When a stream comes online (via ingress events), the Projector pre-warms the cache.
- Cache Invalidation: Data services emit
data.*.changedevents andbagel.cache.invalidate.broadcasterwhen settings are updated. The Projector listens to these to rebuild the projection. - RPC Fallback: Services with cold local caches can call the Projector via NATS RPC to fetch the latest projection synchronously.
By isolating the read load into a dedicated projection in Valkey, the actual MySQL databases for configuration are shielded from the massive read volume generated by active Twitch chats.
