backend system design
Roblox
Epic Games
Unity

Roblox Backend System Design: Like/Unlike (1M QPS Scale)

Topics:
Key-Value Stores
Caching
Data Replication
Roles:
Software Engineer
Backend Engineer
Senior Software Engineer
Experience:
Mid Level
Senior
Staff

Question Description

You must design a high-throughput like/unlike system for a gaming platform where users can like or unlike games. The system needs to answer two fast queries: whether a specific user has liked a given game (personalized boolean), and the total like count for that game. The platform target is ~1M QPS, with low latency (<100ms), high availability, and accurate real-time counts.

Core problem: model two data points (user->game boolean and game->count) and make updates idempotent and atomic. At scale you’ll partition traffic (shard by game_id or user_id), keep hot counters in memory, and persist durable state to a distributed store. Typical components you should discuss: API gateway, stateless app servers, a distributed cache layer (Redis Cluster), a durable key-value store (Cassandra / Spanner / DynamoDB), message queue for async tasks, and replication/backup across data centers.

Interview flow and stages: you’ll outline data models (per-user like records and per-game counters), sharding strategy, cache + persistence pattern, and failure recovery. Discuss read/write paths, atomic increment/decrement (use SADD/SREM + INCR/DECR patterns or compare-and-swap), and options for strong vs eventual consistency.

Skill signals: demonstrate distributed systems reasoning (sharding, replication, failover), storage trade-offs (sets vs bitmaps vs sorted sets), cache invalidation, idempotency and concurrency control, and capacity planning for 1M QPS. You should justify design trade-offs and propose metrics and testing strategies for correctness under failure.

Common Follow-up Questions

  • How would you change the design if like counts can lag (eventual consistency) vs must be strongly consistent immediately? Discuss trade-offs and implementation options.
  • Design a sharding and partitioning strategy for storing user->game like records and counters to support 1M QPS and even load distribution.
  • How would you detect and recover from inconsistencies between the cache (Redis) and the durable store (Cassandra/Spanner)? Describe reconciliation and repair workflows.
  • What storage format would you pick for per-user likes at massive scale (sets, bitmaps, or per-user lists) and why? Show memory and query trade-offs.

Related Questions

1Design a follower/following service for a social gaming platform with real-time counts
2Design a scalable favorites/bookmark system that supports per-user and global metrics
3Design a real-time leaderboard that updates scores and handles high write throughput
4How to design a rate-limited reaction system (likes, upvotes) with eventual consistency for huge scale

Explore More Questions

Practice This Question with AI

Get real-time hints, detailed requirements, and insightful analysis of the question.

Like/Unlike System Design - Roblox Backend (1M QPS Scale) | Voker