Trade-Offs in Databases
Discover the critical trade-offs between centralized and distributed databases regarding consistency, fault tolerance, and complexity in System Design. Learn to analyze query optimization strategies and calculate communication time to minimize latency and ensure high performance in distributed architectures.
Which is the best database sharding approach?
Sharding (horizontal or vertical) requires adding more nodes, while vertical scaling increases resources on existing nodes. Architects must select an approach that supports growth, maintains availability, and minimizes latency. Scaling can involve increasing CPU, memory, storage, and network bandwidth on a single node (vertical scaling) or distributing load across additional nodes (horizontal scaling). The following sections compare centralized and distributed database architectures.
Advantages and disadvantages of a centralized database
Advantages
Maintenance (updates and backups) is straightforward.
Stronger consistency and ACID compliance compared to distributed systems.
Simpler programming model for developers.
Efficient for small datasets that fit on a single node.
Disadvantages
High latency when query volume approaches single-node limits.
A single point of failure increases the risk of total inaccessibility.
Advantages and disadvantages of a distributed database
Advantages
Faster access by retrieving data from the nearest or most frequently used shard. ...