Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental foreign keys tracking issue #11975

Closed
shlomi-noach opened this issue Dec 15, 2022 · 3 comments
Closed

Experimental foreign keys tracking issue #11975

shlomi-noach opened this issue Dec 15, 2022 · 3 comments
Assignees
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)

Comments

@shlomi-noach
Copy link
Contributor

shlomi-noach commented Dec 15, 2022

Tracking issue for some PRs experimenting with better/more foreign key support. Some known limitations to using foreign keys in Vitess include:

  • Online DDL (see this blog post for details)
  • Cascading (or set null) changes are not logged to the binary log, and are only ever known to the internal InnoDB engine layer. As result, you may not reliably track changes to a child table in VReplication, as it relies on the binary log.
    This is then implicitly yet another issue for Online DDL
  • MySQL foreign keys are limited to the scope of a server, and cannot enforce constraints across shards in a multisharded environment

In light of, or in spite of the above, we want to slowly explore options for better foreign key support. As this is an exploration, we may/will submit some PRs that are only tackling subsets of the problem. It it probable that most will eventually connect to at least provide an incomplete-but-better-than-nothing support.

Some aspects/areas that may/will be affected:

  • schemadiff library
  • Online DDL, go/vt/schema
  • vtctl ApplySchema
  • VTGate
  • VReplication
  • others
@derekperkins
Copy link
Member

Super excited for these improvements!

@shlomi-noach
Copy link
Contributor Author

RFC for query-serving support for foreign keys: #12967

@harshit-gangal
Copy link
Member

Scoped work is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

No branches or pull requests

3 participants