3 ms·
Interesting that spanner doesn't support foreign keys. Is this a fundamental limitation or just a missing feature?
by jayd16 8y ago
Interesting that spanner doesn't support foreign keys. Is this a fundamental limitation or just a missing feature?
- wnevets 8y agoit sounds like a fundamental limitation to support its feature set. I'm curious to hear from who someone knows better.
- Nican 8y agoSpanner does not support foreign keys, but they do support table interleaving, which can fill some of the gaps. Table interleaving is also important to ensure that correlated data that is colocated in the same server in the cluster.
- joatmon-snoo 8y agoSpanner uses a hierarchical table model instead, where a parent table key is a strict prefix of the child table key. https://cloud.google.com/spanner/docs/schema-and-data-model#creating_a_hierarchy_of_interleaved_tables https://cloud.google.com/spanner/docs/schema-and-data-model#... From a technical perspective, I'd guess that the reason was because it makes local transactions trickier to do. Spanner has a philosophy of avoiding work that isn't required, and knows how to optimize transactions that don't require 2PC-ing data on different servers.