TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Why don't foriegn keys “scale”?

6 pointsby djlewaldabout 2 years ago
I've heard this repeated quite a bit, particularly around the inception of dynamo and NoSQL in general. But don't think I've ever heard the "why" side.

1 comment

perrygeoabout 2 years ago
Foreign keys must be checked at INSERT time to ensure they exist in the other table. This enforcement of referential integrity takes time and slows down the ingest rate.<p>On the SELECT side, data that has been pre-denormalized into a directly consumable format (documents) will be faster than constructing the same data from a join.<p>Of course giving up referential integrity and normalization adds a significant burden on the developers. You need to balance that against any marginal speed gains. Since your application must now enforce valid references without any help from the DB, you need to account for both the runtime and development effort it takes to roll your own referential integrity and maintain your own normalization strategy in the face of updates, etc.
评论 #35481401 未加载