4 ms·
How could foreign keys ever be a "hassle"?
by anton_gogolev 8y ago
How could foreign keys ever be a "hassle"?
- shlomi-noach 8y agoThey can be a hassle when you want to shard your data, having outgrown your single-instance capacity. You will either shard functionally (extracting complete tables to other database servers), in which case FKs will completely break, or horizontally (split rows across database servers), in which case you may or may not be able to still use FKs. They're also a performance impact on large tables since inserts/deletes must make multiple trips to the tables/indexes. That's a growing operational hassle as tables grow larger.
- asaph 8y ago> You will either shard functionally (extracting complete tables to other database servers) This isn't sharding. This is vertical partitioning. Sharding is a type of horizontal partitioning. Reference: https://en.m.wikipedia.org/wiki/Shard_(database_architecture) https://en.m.wikipedia.org/wiki/Shard_(database_architecture...