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
Tracking issue for some PRs experimenting with better/more foreign key support. Some known limitations to using foreign keys in Vitess include:
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
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:
schemadifflibrarygo/vt/schemavtctl ApplySchema