Re:GitHub's online schema migration for MySQL
by yxhuvud on Thursday May 03, 2018 @10:47AM
(#16986503)
What? Why would enforced consistency be less worth at bigger scale? My guess would have been the complete opposite.
[ Parent
| on HN ]
Re:GitHub's online schema migration for MySQL
by sjansen on Thursday May 03, 2018 @12:44PM
(#16987542)
It's not a question of worth but feasibility. Just like an ideal schema is fully normalized, but performance concerns sometimes drive denormalization. When foreign keys can't be used to enforce data integrity, the application has to be built to compensate in other ways. Sometimes that means simply accepting dirty data, and designing the application to stay robust when encountering unexpected data. Other times it means building alternate solutions to discover and repair data issues.
Re:GitHub's online schema migration for MySQL
by sciurus on Thursday May 03, 2018 @01:00PM
(#16987666)
shlomi-noach linked to https://github.com/github/gh-ost/issues/331 in another comment. That goes into some of the reasons to avoid foreign keys.
At a past job where we had a complex MySQL setup, I set up a slack autoresponse to post "Just say no!" anytime someone mentioned foreign keys. :-)