12

Is there any way (or real chance) to see the real SO database schema (not public dump)?

I'm curious on how SO manages to scale so well. Does it use multiple databases? Or any kind of sharding technique, given that it now has 2 (or more) database servers?

6
  • I'm not sure there's a chance of actually seeing the schema. And I think this has been asked before.
    – alex
    Commented Jan 20, 2010 at 7:19
  • @alex, I don't think so; I think all that has been asked, is about public dump. Not the real schema.
    – Graviton
    Commented Jan 20, 2010 at 8:17
  • There was a question about the real schema, but quite a while back. I'm not sure where that question is now. I never said the question was a duplicate.
    – alex
    Commented Jan 20, 2010 at 8:45
  • I'm very keen to know too, and hopefully more than that.
    – o.k.w
    Commented Jan 20, 2010 at 10:21
  • I had asked about the tagging system a while back. meta.stackexchange.com/questions/25710/…
    – AnonJr
    Commented Jan 20, 2010 at 14:31
  • Related: meta.stackexchange.com/questions/26398/…
    – Stephan202
    Commented Jan 21, 2010 at 2:06

1 Answer 1

9

You've got two questions in there.

First, is there any way to see the real schema? Answer: not now, but I'd question why you needed it. If you had a really good reason and you explained that to the team, they might relent. (I haven't seen a good reason yet.)

Second, how does it scale so well? Answer: first, read the HighScalability article about StackOverflow here:

http://highscalability.com/blog/2009/8/5/stack-overflow-architecture.html

That explains a lot of it. No sharding is involved - the extra database servers are just used for failover. They use one database per site for the trilogy, but I can't speak for StackExchange.

Scaling a database is pretty simple: pay really close attention to your queries, and do as little work as possible inside the database. Cache as much as you can on the app side, and don't force the database server to do things it's not designed to scale. Just because Microsoft puts a feature into SQL Server doesn't mean it's designed to scale.

4
  • 10
    Is curiosity not a good enough reason..? Commented Jan 21, 2010 at 13:46
  • 3
    And/or is further edification not a good enough reason? I am a decent database designer, but if I had the chance to look at some other ways of approaching the same problem I might learn a thing or two. Isn't the purpose of StackOverflow to raise the bar as it were?
    – AnonJr
    Commented Jan 21, 2010 at 16:28
  • 1
    IMHO, no, curiosity and edification aren't good answers to get an inside look at a company's database. But that's me - I'm a DBA, and you know how us DBAs are. ;-) If you want to learn about scaling apps, I'd highly recommend The Data Access Handbook. Covers a lot of good tips in both the app and DB layers: amazon.com/gp/product/…
    – Brent Ozar
    Commented Jan 24, 2010 at 14:50
  • 1
    Under most circumstances, I would agree. But, given the nature of SO and the degree of current transparency I would argue that this is more of a special case. I've read a number of books and articles, and I've found that looking at live apps is much more instructive. But that may just be me. :)
    – AnonJr
    Commented Jan 24, 2010 at 17:36

You must log in to answer this question.

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