DEV Community

[Comment from a deleted post]
Collapse
 
bentorvo profile image
Ben Brazier
  1. If you use SQL databases without foreign keys then what is the point of using SQL?
  2. A sharded SQL database can't use foreign keys for joins across the different shards, which is one of the reason why NoSQL databases are used.
Collapse
 
martingbrown profile image
Martin G. Brown

Fairly sure a partitioned SQL Server table can be referenced in a foreign key. Even if it can't the FK is there logically anyway.

The real reason why relational databases don't scale well is to do with locking and contention. NoSQL often gives up consistency guarantees to allow better performance. There is also the issue that not all data is relational so other data structures are just better for some tasks, but that applies at small scale as well.

 
bentorvo profile image
Ben Brazier

Do you have an implementation of doing a join across partitions?

 
martingbrown profile image
Martin G. Brown

Yes

 
bentorvo profile image
Ben Brazier

Can you share the details? I would like to see how to do joins across separate databases