DR implementation: Azure Managed Redis
Tier: T1. Redis is a cache, mainly for the BFF hot-entity cache. It is never the source of truth. When Redis is lost, latency goes up and the operational APIs take more load. No data is lost.
Current configuration (prd)
| Setting | Value |
|---|---|
| Instance | redis-rome-prd-chn-02 |
| SKU | Azure Managed Redis Balanced_B3 |
| High availability | On. Microsoft places the replicas across zones in supported regions |
| Persistence | Not relied on. The cache is rebuilt from the source |
| Eviction | LRU for the hot-entity cache, as the event-sourcing UI design requires |
Failure scenarios
| Scenario | Behaviour | Recovery | RTO and RPO |
|---|---|---|---|
| Zone loss | The replica is promoted. Clients reconnect | Automatic | Seconds to minutes. Writes in flight can be lost, which is acceptable for a cache |
| Instance unavailable | Cache misses. Reads fall through to the operational APIs | Microsoft-managed. Watch the downstream load | Microsoft-managed |
| Stale or corrupt cache entries | Users see wrong state | Flush the affected keys, or the whole cache | Minutes |
| Instance deleted | Same as unavailable | Recreate from Terraform. The cache refills on demand | Under an hour |
Recovery procedures
Flush a corrupt cache
Owner: Owning service team
Delete the affected key prefix. If the scope is unclear, flush the cache. Watch the operational API load while the cache warms up.
Run without Redis
Owner: Owning service team
Make sure the BFF falls through to the source on a connection error, with a
short timeout. Enable degraded-mode if the operational APIs are overloaded.
Rules
- Redis MUST NOT hold data that cannot be rebuilt from a source of truth.
- Clients MUST use short timeouts and fall through to the source when Redis is unavailable.
- High availability MUST be on in
gmaandprd. - Redis is recovered late in the recovery order, after the stores it caches.