A team uses Redis as the primary store for user carts with no persistence. Is that a problem?

BeginnerScenarioData and databases
Answer

Situation read → Yes. A restart, failover or eviction loses every cart, and with maxmemory-policy allkeys-lru Redis can silently evict data when memory fills.

What I'd do →

  1. Decide whether losing carts is acceptable. If not, Redis can't be the only copy as configured.
  2. Short term: enable persistence (AOF with appendfsync everysec) or use ElastiCache with Multi-AZ and backups, and set maxmemory-policy noeviction so it errors instead of dropping data.
  3. Better: keep carts in a durable store (DynamoDB or Postgres) and use Redis as a cache in front.
  4. Alert on evicted_keys and memory use.
redis-cli INFO stats | grep evicted_keys
redis-cli CONFIG GET maxmemory-policy

Why → A cache is allowed to lose data; a system of record isn't.

Interview tip → Ask "what happens if this data disappears?" before choosing where it lives.

All Real-World Interview questions Roadmap: Interview readiness

More on Data and databases