Scaling Issues with SQL DB
Customer Table Orders Table
Id(pk) | name OrderId | CustId (FK) | Amnt
-------------- ----------------------------
1 | A 101 | 1 | -
2 | B 102 | 2 | -
3 | C 103 | 1 | -
- Referential Integrity
2. Latency in data synchronization: Every time you need to validate a foreign key, it may require a network call to another shard, which slows down the query performances
3. Joins: joins across shards are less efficient, and careful query planning is required to minimize the impact on performance
4. Orphaned Records and Inconsistent State: For example, an Order record in one shard might refer to a Customer record in another shard that has been deleted, leading to data inconsistencies
Data replication lag and eventual consistency models, can further complicate maintaining consistency between dependent records.
- SQL Cannot support Large data
Problem with Huge tables:
- Searching will take time, indexing will take time
- Horizontal scaling not possible
- SQL Cannot support Horizontal scaling=Sharding efficiently
Problem with Huge tables:
- Searching will take time, indexing will take time
- Horizontal scaling not possible - Referential Integrity