How Stack Exchange Scales 40 Billion Requests with a Monolith‑Plus Architecture

David Fullerton explains how Stack Exchange uses a C#‑centric monolith‑plus design, Redis caching, ElasticSearch, and continuous rolling deployments across two data centers to reliably handle billions of monthly requests while maintaining performance and scalability.

21CTO
21CTO
21CTO
How Stack Exchange Scales 40 Billion Requests with a Monolith‑Plus Architecture

At the QCon New York conference, Stack Exchange Vice President of Engineering David Fullerton detailed how C#, MS SQL and related technologies support the monolith‑plus architecture that powers Stack Overflow, handling roughly 40 billion user requests each month.

The Stack Exchange team works fully remotely, even when co‑located, relying on instant messaging and issue‑tracking tools; this remote‑first mindset enables a small group of sysadmins and full‑stack engineers to keep the sites running smoothly.

All of the Stack Exchange sites are built on an upgraded monolith where most application logic resides in a C# web layer backed by an MS SQL database. Exceptions include a dedicated tag‑engine service, Redis‑based caching, and ElasticSearch for full‑text search.

Deployments are performed across two data centers—New York as the primary site and Oregon as a backup—to increase fault tolerance. The team uses rolling deployments that occur daily, and new features are tested by real users selected through feature‑flag targeting.

Feature roll‑outs are first tried on a subset of sites, with performance observed closely. Their pages experience very high read load on a single page, and the community is tolerant of experimental changes.

Stack Exchange’s R&D philosophy is to use familiar skills, measure problems, and fix slow parts. Early tools included ASP.NET MVC, LINQ‑to‑SQL, MS SQL full‑text search, and built‑in caching. Performance is a key quality attribute because it improves user experience and SEO; the team tests under real load and treats performance issues as defects that must be resolved quickly.

The site processes 40 billion requests per month, peaks at 3 000 requests per second, executes 800 million SQL queries per day, and peaks at 8 500 queries per second.

Over time, the original stack was enhanced: Redis was added for caching, ElasticSearch for improved search, and a custom intermediate‑language generation framework replaced the original ORM to boost SQL efficiency while supporting extensibility. Tag‑related logic was extracted into an independent tag‑engine service.

Tools such as MiniProfiler, Opserver, and Dapper help identify and monitor performance bottlenecks; focusing on performance yields many benefits.

Optimizing performance can dramatically improve scalability—almost for free. The monolith‑plus architecture’s scalability exceeds expectations.

Fullerton concluded that the upgraded monolith architecture has been highly successful at Stack Exchange. While micro‑services are popular, over‑using them incurs the “SOA tax.”

SOA is not the only path to success; services should be extracted only when they solve concrete problems, not as an abstract exercise.
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Performance OptimizationCMonolith ArchitectureMS SQL
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.