3 ms·
Elaborate on what? They're an opinion that data integrity is dependent on foreign keys containing pointers at existing data. In systems where actual row deleti
by waheoo 5y ago
Elaborate on what? They're an opinion that data integrity is dependent on foreign keys containing pointers at existing data.
In systems where actual row deletion doesn't actually happen its kind of a pointless kick to the nuts.
Now I have to create things in a specific order for no reason other than foreign keys say so. When you're using uuids for reference keys you're not beholden to what order you insert you can have these things span databases or have separate systems do the insert.
For a naive example, maybe I have an order A, and two orderliness A1, A2, why do I have to create A before I create A1 and A2. Why can't I loadbalance those three operations to different systems that insert at different timings.
Eventually they all line up, and my system is resilient enough to be ok with that.
With foreign keys you're just beholden to some feigned idea about data integrity but it's mostly bullshit.
The other common situation is when you need to backup tables and restore them elsewhere in whatever order you want, foreign keys just get in the way.
- dspillett 5y agoI see your point for decentralised systems, "eventual consistency" is an unavoidable evil in many cases there at least if you don't want a performance hole caused by distributed transaction requirements. But otherwise, I disagree strongly. > feigned idea about data integrity but it's mostly bullshit I call BS on your call of BS. > The other common situation is... If that is common in your production environments, then I never want to work with your production environments. > foreign keys just get in the way. Disable them, do the jiggery-pokery, and then replace them. Again, but not in production systems. If FKs are an inconvenience day-to-day then you have something seriously wrong somewhere. They are protection against bugs and other unpredictables causing corruption of data that other code later relied upon being correct.