Terminology Confusion: Horizontal/Vertical Partitioning, Scaling, Sharding

  1. Vertical Scaling
  2. Horizontal Partitioning
  3. Vertical Partitioning
  4. Sharding
Photo by pine watt on Unsplash

Horizontal Scaling

Adding new servers to the infrastructure. So, you can divide up the workload into different servers. A typical scenario: Write data to one server, read from other servers.
See also: Read replica, leader-follower replication.

Horizontal Scaling

Vertical Scaling

Increasing the capacity of the server. Adding more CPU/RAM/Disk or migrating to a bigger server. If the server crashes, the database will be inaccessible. Because there is only one server.
See also: Single point of failure.

Vertical Scaling

Horizontal Partitioning

Splitting one table into different tables. Each table will have the same table structure. Moving/copying rows from the Users table to other tables.

Horizontal Partitioning

Vertical Partitioning

Splitting one table into different tables. Each table will have a different table structure.

Vertical Partitioning

Sharding

Horizontal partitioning and sharding are referring to the same things: Splitting one table into different tables. Each table will have the same table structure.
However, spreading the data across the servers/data centers/continents is often referred to as sharding. Sharding is a subtype of horizontal partitioning.

Hash-based sharding

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store