Build the mental model
A hybrid architecture must name one system of record for every data class. PostgreSQL owns durable relational facts; Redis handles reproducible caches, expiring sessions and rate limits, derived leaderboards, and bounded event processing. Every component needs a consistency boundary and Redis-unavailable behavior.
Connect it to a real scenario
Create a data-ownership table, key inventory, TTL matrix, invalidation events, memory budget, security identities, persistence and HA tier, and SLOs. Define degraded DB fallback for catalog cache, reauthentication for session failure, and durable outbox replay for analytics events.
Try the working example
PostgreSQL: users, tutorials, enrollments, progress, outbox
Redis cache: tutorial:*:v1 TTL 5m rebuildable
Redis auth: session:* TTL 30m fail re-auth
Redis limits: rl:* TTL 60s endpoint policy
Redis ranks: leaderboard:* TTL 90d rebuildable
Redis jobs: stream:tutorial-events bounded + consumer groupsYou get a reviewable architecture contract before implementation begins.5-minute try-it
Fill a table with owner, RPO, RTO, TTL, and fallback for every feature.
One important caution
Treating every Redis value as durable—or every value as disposable—is wrong; classify each data set.
Redis — Architecture — Redis