နားလည်ထားရမယ့် အချက်
Hybrid architecture တွင် data တစ်မျိုးစီရဲ့ system of record ကိုတိတိကျကျသတ်မှတ်ရပါတယ်။ PostgreSQL က durable relational facts ကိုပိုင်ပြီး Redis က reproducible cache၊ expiring sessions/rate limits၊ derived leaderboard နဲ့ bounded event processing ကိုကိုင်မယ်။ Consistency boundary နဲ့ Redis unavailable behavior ကို component တစ်ခုစီရေးရပါတယ်။
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
Data ownership table၊ key inventory၊ TTL matrix၊ invalidation events၊ memory budget၊ security identities၊ persistence/HA tier နဲ့ SLOs ဆွဲမယ်။ Catalog cache failure တွင် degraded DB fallback၊ session failure တွင် fail closed/re-auth၊ analytics event failure တွင် durable outbox replay သတ်မှတ်မယ်။
အတူတူ စမ်းရေးကြည့်မယ်
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 groupsImplementation မစမီ review လုပ်နိုင်သော architecture contract ရမည်။၅ မိနစ် စမ်းကြည့်
Feature တစ်ခုစီအတွက် owner, RPO, RTO, TTL, fallback ပါသော table ဖြည့်ပါ။
သတိလေးတစ်ချက်
Redis ထဲရှိ value တိုင်းကို durable လို့ယူဆခြင်း သို့ cache လို့ယူဆခြင်းနှစ်မျိုးစလုံးမှားနိုင်ပါတယ်။ Data class အလိုက်သတ်မှတ်ပါ။
Redis — Architecture — Redis