Skip to content

How do I maintain referential integrity? #74

Answered by shlomi-noach
shreyfirst asked this question in FAQs
Discussion options

You must be logged in to vote

@shreyfirst 👋 good question.

First, taking the opportunity to explain why we don't support foreign key constraints:

  1. They way foreign keys are implemented in MySQL stands in the way of Online DDL, and we consider Online DDL, database branching, merging, etc., to be be worth the tadeoff.
  2. They also stand in the way of functional sharding/partitioning and of horizontal sharding, both of which are first class citizens in Vitess, the open source engine behind PlanetScale.

Now to answer your specific questions:

Duplicating data

  • I'm not sure the existence/absence of foreign key constraints should have effect on data duplication. You will still model your tables & columns in exactly the same w…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@shreyfirst
Comment options

@hhimanshu
Comment options

@yasinbhojani
Comment options

@iperamuna
Comment options

@hhimanshu
Comment options

Answer selected by mscoutermarsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
FAQs
Labels
None yet
5 participants