I am not sure here is the right place to ask it. I have compared stackoverflow.com, serverfault.com, superuser.com homepages. The HTML code is exactly the same except some labels / images /css to customize the display and of course the topics listed.

I was wondering how it works behind:

  • Is there only a single app, a single database and query/display rules depending on the domain accessed ?
  • Are these websites duplicated apps with a common database ?
  • Are these websites duplicated apps with each a dedicated database ?

Thanks for your answers


Every web server we have (11 of them) runs the same application in IIS for every SE site. The same exact code that runs meta also runs Stack Overflow.

In fact one web server, a single app pool even can run every SE site we have, it's just a matter of where our load balancer sends traffic. Currently it looks like this:

  • Stack Overflow: Webs 1-6
  • Everything but SO/Meta: Webs 7-9
  • Meta: Webs 10-11

....but all the servers are identical, it's just a matter of where the traffic is directed. When a request comes in, the app determines (based on the host) which site you're asking for, and gets the appropriate database from there. That along with settings for each site including which content folder (for CSS/images) just set some properties in the response, like where the stylesheet is, whether some things are enabled (like MathJax), etc.

Note: this applies only to our Q&A sites, Careers, stackexchange.com, the OpenID provider, StackAuth, Area51, API, APIv2 and Status are separate applications (but can also be deployed identically to all servers...the entire IIS config is the same for the entire web tier).

Each site does have it's own database, that includes meta sites (so 2 DBs per site, including meta).

There are many more things happening behind the scenes and many more per-site-settings specifics, but the above is a general high level view of what's going on.

For kicks, here's a look at our web tier...I post this because we're about to make some major changes to how things work, and it'll be interesting to see how CPU/memory drops as a result.


  • Thanks for the details !
    – kheraud
    May 4 '12 at 12:04

Each Stack Exchange site shares a common codebase, but they have different styling (CSS and images) and a separate database.

  • This is incorrect, they are not separate copies. May 4 '12 at 10:19
  • @NickCraver - Thanks for the correction.
    – Oded
    May 4 '12 at 10:20
  • 1
    To be fair, they were separate copies in the SE 1.0 days, but we're much more efficient these days :) May 4 '12 at 10:26

Each SE site runs on the same engine/codebase.

They have different configurations and CSS, as well as separate databases.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .