All read requests should hit cache and only fallback to db + calculation if cache misses.
This includes the listener state and unread strands.
Ideally, cache and db would have the same API, providing two layers of “caching”, abstracted from the caller.
Since operations are append-only, we should fetch the operations on cache and then only fetch from db operations with an higher index.
Write operations should go directly to the db layer and update the cache when finished.
Tasks:
Detail data access patterns
Add support listener state storage
Define unified API for storage and cache layers.
Define how the cache is updated after a write
Update storage implementations (Prisma, Browser)
Update cache implementations (Prisma, Browser)
Implement CachedStorageProxy component that abstracts and orchestrates the cache and the storage layers.
Make the usage of cache and queue mechanisms optional with feature flags so that we can debug issues without the added complexities of these two systems. Wrappers / adapters patterns should help with this.
All read requests should hit cache and only fallback to db + calculation if cache misses. This includes the listener state and unread strands.
Ideally, cache and db would have the same API, providing two layers of “caching”, abstracted from the caller.
Since operations are append-only, we should fetch the operations on cache and then only fetch from db operations with an higher index.
Write operations should go directly to the db layer and update the cache when finished.
Tasks:
CachedStorageProxy
component that abstracts and orchestrates the cache and the storage layers.