Skip to main content

How Stack Overflow Scaled to 200M Requests on 9 Servers

Updated 5 min readMarkdown
How Stack Overflow Scaled to 200M Requests on 9 Servers

Quick Answer: Stack Overflow handled 200 million daily requests using a monolithic .NET architecture deployed across only nine web servers. By chaining fast in-memory process caching, a Redis caching tier, and a high-RAM SQL Server database, they rendered pages in 20 milliseconds by eliminating distributed network latency.

I miss the era when Stack Overflow was the undisputed center of our engineering world. Back in 2016, their infrastructure team published a breakdown of their architecture that I still revisit whenever someone tries to convince me that every new web app needs dozens of microservices.

At the time, they were serving roughly 200 million requests a day on just nine on-premise web servers running a monolithic .NET stack. In fact, they pointed out that they could have technically powered the entire site on a single machine, though nobody would recommend running without redundancy.

Here is how they pulled it off, and what I think we should learn from their design.

How did Stack Overflow handle massive traffic without microservices?

Stack Overflow relied on a traditional monolithic .NET web application running on bare-metal hardware. Instead of distributing logic across isolated services, they kept their business code unified and eliminated cross-network serialization.

Every time you introduce an extra service boundary, you pay a tax: network round-trips, JSON serialization, connection handshakes, and potential timeout cascades. Stack Overflow simply sidestepped that tax. When an HTTP request reached their infrastructure, it hit an application server that resolved logic locally rather than orchestrating calls to half a dozen internal APIs.

Because of that design, their page build times averaged around 20 milliseconds. That is blistering performance, achieved not by chasing complex distributed paradigms, but by keeping execution paths ridiculously short.

How did Stack Overflow structure its tiered caching strategy?

Stack Overflow answered queries quickly by layering their data access across three distinct tiers. Requests checked the fastest local process memory first, fell back to a shared cache, and only contacted the database when necessary.

The retrieval pipeline looked like this:

Layer Technology Storage Role
L1: Local Cache In-Memory (.NET process) Instant retrieval directly inside application RAM; zero network hop.
L2: Shared Cache Redis Fast network cache shared across servers for cross-instance invalidation.
L3: Persistent Store Microsoft SQL Server Relational storage backed by 384 GB of RAM, keeping active data sets in memory.

Notice the database specs: 384 GB of RAM. That meant the bulk of their active working data sat directly in memory rather than on disk. Even when a request slipped past the application and Redis caches, SQL Server rarely needed to spin up disk reads to fetch the answer.

I like to think about network hops the same way I think about grabbing cooking ingredients. If you need salt, reaching into your kitchen cupboard takes two seconds—that is your local in-memory cache. Walking down to the corner store takes five minutes—that is Redis. Getting in your car and driving to a specialty supplier across town is the network latency of a chatty microservice. Stack Overflow kept nearly every ingredient inside the kitchen.

Why should you choose a monolith before reaching for microservices?

I always recommend building a monolith first because it minimizes architectural drag while your product requirements and domain boundaries are still evolving. Monoliths let you refactor codebases with simple compiler checks rather than coordinating cross-service API contracts.

Let's say your team is building a high-traffic SaaS platform. If you break that application into separate authentication, billing, notification, and analytics microservices right out of the gate, you spend half your sprint tackling distributed tracing and RPC errors.

If you understand what you are building and how to structure your domain, start with a monolith. You get atomic database transactions, trivial local function calls, straightforward deployments, and zero distributed latency. You can handle millions of users on surprisingly modest hardware before distributed complexity ever becomes justified.

Frequently Asked Questions

Why are monolithic architectures faster than microservices for web page rendering?

Monoliths execute application logic through local, in-memory function calls rather than remote network calls like HTTP or gRPC. This avoids serialization overhead and network transport latency, keeping total page assembly times down in the single-digit or low double-digit milliseconds.

Is keeping an entire database in RAM cost-effective?

Yes. While purchasing hundreds of gigabytes of RAM for an enterprise database server requires an initial capital investment, it is almost always significantly cheaper than maintaining the cloud compute footprint and operational staff needed to manage an over-engineered distributed system.

Can a modern web application still scale on a monolith?

Yes. Large-scale platforms like Stack Overflow, GitHub, and Shopify have proven that monolithic and modular-monolithic designs easily support hundreds of millions of daily requests when paired with efficient caching and vertical hardware scaling.

No comments yet. Be the first to comment.