Trade-Offs in Databases

Lesson 33 of 25610 min readPremium lesson preview
In this lesson5 sections

Trade-Offs in Databases

Database placement affects both coordination and the amount of data a query must move. This lesson compares single-node and distributed designs, then uses a small communication-cost model to show why filtering before transfer can matter.

Which is the best database sharding approach?

Keep data partitioning separate from hardware scaling. Vertical partitioning separates columns or tables; horizontal partitioning separates rows. Vertical scaling adds resources to one node, while horizontal scaling adds nodes. The following comparison considers the operating and query costs of keeping data together versus distributing it.

Advantages and disadvantages of a centralized database

Advantages

  • Maintenance (updates and backups) is straightforward.

  • Fewer network coordination steps for transactions confined to the node; verify the actual isolation and durability configuration.

  • Simpler programming model for developers.

  • Can be efficient when the workload and dataset fit the node’s measured capacity.

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

The rest of this lesson is for Premium members

Premium opens every lesson in this course, along with all questions and solutions on PracHub.