You are asked to design a backend system for a game app store. The product is similar in spirit to an app marketplace but focused on games.
Requirements
1. Browsing and discovery
Users should be able to browse games via different types of categories:
-
Dynamic categories
(computed from data):
-
Top-selling games (e.g., by recent purchase volume)
-
New releases (e.g., games published in the last N days)
-
Static/genre categories
(tag-based):
-
Horror
-
Arcade
-
Platformer
-
Puzzle
-
(and other game genres)
The system should support:
-
Listing games in a given category with pagination and basic sorting (e.g., by popularity, rating, release date).
-
Efficient updates of dynamic categories as new purchases and releases happen.
2. Game detail page
For each game, users should be able to view a rich media detail page, including:
-
Text description, title, publisher information
-
Screenshots and/or video trailers
-
Price, platform compatibility, and other metadata (e.g., age rating, tags)
Assume media assets (images/videos) are stored in some object storage or CDN; you need to design how they are referenced and served at scale.
3. Purchase and download
Users must be able to:
-
Purchase games (assume real-money transactions)
-
After purchase, download the game binary or installation package
Consider:
-
User accounts and purchase history
-
Ensuring that only users who have purchased a game can download it
-
Generating secure, time-limited download URLs
-
Handling high download traffic (e.g., via CDN or specialized download servers)
You can assume payment processing is integrated via a third-party payment gateway, but you should describe how your system interacts with it and records orders.
4. Ratings and reviews
Users can:
-
Leave ratings (e.g., 1–5 stars) and text reviews for games they have used
-
View existing ratings and reviews per game, with features like:
-
Average rating per game
-
List of reviews with pagination and sorting (e.g., most recent, most helpful)
Consider how to:
-
Store and index reviews
-
Efficiently compute and update aggregate metrics (e.g., average rating, review count)
5. Non-functional requirements (assume a reasonably large but not planet-scale startup)
-
The system should be
scalable
to millions of users and hundreds of thousands of games.
-
Availability should be high; occasional stale data (e.g., slightly delayed popularity rankings) is acceptable.
-
Reads (browsing, viewing game details) are much more frequent than writes (publishing games, purchases, reviews).
Tasks
Design the system end-to-end. In your answer, cover at least:
-
High-level architecture
: Main services/components and how they interact (e.g., User Service, Game Catalog Service, Purchase Service, Review Service, Recommendation/Ranking Service, Media/Asset Service).
-
Data modeling and storage
: Core data models (users, games, categories, purchases, reviews) and what types of databases you would use for each (e.g., relational vs NoSQL vs search index).
-
Category and ranking computation
: How you would implement dynamic categories like top-selling and new releases, including update frequency, batch vs real-time, and data pipelines.
-
Purchase and download flow
: Sequence of events when a user buys and then downloads a game, including interaction with payment gateway and generation of secure download links.
-
Ratings and reviews design
: APIs, data storage, and how to efficiently serve review lists and aggregate ratings.
-
Scalability and performance
: Caching strategies, use of CDNs, partitioning/sharding strategies, and approaches to handle spikes in traffic (e.g., a hit new game release).
-
Reliability and consistency
: Which parts need strong consistency (e.g., purchase records), where eventual consistency is acceptable (e.g., top-selling rankings), and how you would handle failures and retries.
You do not need to provide detailed code; focus on system design, data flow, and trade-offs. State any additional assumptions you make.