Hacker News new | ask | show | jobs
by kmontrose 4535 days ago
Stack Exchange has one database per-site, so Stack Overflow gets on, Super User gets one, Server Fault gets one, and so on. The schema for these is the same.

There are a few wrinkles. There is one "network wide" database which has things like login credentials, and aggregated data (mostly exposed through stackexchange.com user profiles, or APIs). Careers Stack Overflow, stackexchange.com, and Area 51 all have their own unique database schema.

All databases are MS SQL Server.

1 comments

How do you manage schema changes with release deployments across across all of the databases that are meant to be standard?
All the schema changes are applied to all site databases at the same time. They need to be backwards compatible so, for example, if you need to rename a column - a worst case scenario - it's a multiple steps process: add a new column, add code which works with both columns, back fill the new column, change code so it works with the new column only, remove the old column.
Thanks for the reply. We have a similar architecture where I work so this is interesting to me. A couple more questions if you don't mind:

- Do you use any tools for orchestrating the rollout of those schema changes or do you just have some homegrown scripts?

- Do you separate your schema versioning and deployment process from your application versioning and deployment process?

- How do you handle cases where backwards-compatibility is not possible? For example, a new application feature that depends on a brand new table.