5 ms·
So basically they don't use foreign keys because they're into premature optimization. If you need to shard your database, you're big enough that you'll have th
by malvosenior 7y ago
So basically they don't use foreign keys because they're into premature optimization.
If you need to shard your database, you're big enough that you'll have the resources to engineer the new solution.
The vast, vast majority of use cases will benefit from the database ensuring the integrity of your data.
- tomlu 7y agoGithub is probably past the stage of premature optimization. Presume (for argument's sake) that we accept the premise that foreign keys do not scale. Then the question is whether there exists some sort of realistic migration strategy once usage grows past that. If it does, then using FK makes total sense until we hit that point, doesn't it? And if true this should apply to 99% of users. But if there exists no such migration strategy, then maybe the guy has a point?
- malvosenior 7y agoIn all of my years of development, I’ve never seen data that can’t be migrated to a new system. I’m not even sure what that would mean tbh.