Design Steam
Understanding the Problem
🕹️ What is Steam? Steam is a PC game platform: a store where people buy games, a library of everything they own, and a client that downloads, installs and keeps those games up to date. Developers upload builds of their games and push updates whenever they like. Games are huge (often 50-150 GB), patches come out constantly, and a big release or update can mean millions of people downloading the same bytes on the same day.
The store looks like ordinary e-commerce. What makes this a distinct interview question is content distribution: moving petabytes of game data to players fast, making patches small, protecting content so only owners can install it, and letting developers ship new builds safely. We'll cover the whole lifecycle: publish, buy, download, patch.
Functional Requirements
Steam has a lot of features (community, workshop, reviews, chat, cloud saves, multiplayer services). Agree on the core with your interviewer.
Core Requirements
- Developers should be able to upload new builds of their games and release them to players, including to a beta branch first.
- Users should be able to browse the store and buy games, after which the game appears in their library.
- Users should be able to download and install games they own, as fast as their connection allows.
- Users should get updates automatically, downloading only what changed since their installed version.
Below the line (out of scope)
- Community features: reviews, forums, workshop, chat.
- Multiplayer services, achievements and cloud saves.
- Anti-cheat and DRM beyond "only owners can install."
- Refunds, gifting and trading.
Non-Functional Requirements
Ask about the scale of distribution, because that's where the system is really tested. For our design: 30 million concurrent clients at peak, a catalog of tens of thousands of games, and big launches where 2 million players download an 80 GB game on day one.
Core Requirements
- Downloads should saturate the user's connection (hundreds of Mbps to 1 Gbps) and be resumable and verifiable.
- The system should handle aggregate download bandwidth on the order of tens of terabits per second during big launches and patches.
- Patches should only transfer the data that actually changed.
- Only users who own a game should be able to install and run it.
- Purchases must be exactly-once: charged once, license granted once, never lost. The store must stay up through seasonal sales with around 10x normal traffic.
- Releases should be atomic and reversible: players get either the old build or the new one, and a bad build can be rolled back in minutes.
Below the line (out of scope)
- Streaming games from the cloud.
- Exact-to-the-second consistency of the store catalog (a price can take a minute to show everywhere).
The back-of-the-envelope makes the shape of the problem clear. A launch where 2M players each download 80 GB on the first day is 160 PB in 24 hours, which averages out to about 1.85 TB/s, or roughly 15 Tbps, and the peak hours are several times higher than the average. A popular patch tells the same story: 10M players updating a 5 GB patch is 50 PB, about 4.6 Tbps averaged over a day. If that patch were shipped as a full re-download of a 40 GB file instead of the 5 GB that changed, it would be 8x bigger.
The store side is modest by comparison. Even at the start of a big sale, purchases are in the thousands per second, and store pages are mostly identical for everyone and cacheable.
The insight to lead with: this is a bytes problem, not a requests problem. Almost everything about the download design follows from making game content immutable and content-addressed, because immutable bytes can be cached anywhere, forever, by anyone, and identical bytes never have to be sent twice.