March 22, 2017

Database Scaling Notes

There are two types of scaling: vertical scaling and horizontal scaling.

- Vertical Scaling

Vertical scaling means that you scale by adding more power (CPU, RAM) to an existing machine.

- Horizontal Scaling

Horizontal scaling means that you scale by adding more machines into your pool of resources.

1) Replication 数据备份:

通常一式三份;分摊读请求

2) Sharding 数据拆分:

将数据拆分成不同的部分,保存在不同的机器上 (SQL 需要自己做Sharding,而NoSQL一切基本是自动的。)

  • Vertical Partitioning 纵向切分

Vertical partitioning involves creating tables with fewer columns and using additional tables to store the remaining columns.

  • Horizontal Partitioning 横向切分

Horizontal partitioning involves putting different rows into different tables.

References:

comments powered by Disqus