Introduction to mysql sharding of Fragments

  • 2020-09-16 07:48:50
  • OfStack

1. What are Sharding's application scenarios 1 like?

As the amount of data in the database gets larger and larger, both the reading and the writing become more and more stressful. Imagine that if the data volume of a table reaches the level of tens of millions or even hundreds of millions, whether it is to build indexes, optimize the cache, etc., will face huge performance pressure. sharding distributes data from the same database over multiple databases or machines under certain conditions to reduce pressure on a single machine.

Online games, IM and BSP are all suitable Sharding application scenarios.

2. What is the difference between Sharding and database partitioning (Partition)?

sharding realized the distributed deployment of data, the data through a series of segmentation rules, the data distribution to different DB server, through the routing rules to access a particular database, so 1, every visit to the face is not a single server, but N server, so it reduces the pressure of single server.

partition implements only partitions within DB and cannot be deployed across servers.

The word 'Shard' means' fragment 'in English, and as a database-related technical term, it appears to have originated in massively multiplayer online role-playing games (MMORPG)." Sharding can be called "sharding".

Sharding is not a new technology, but a relatively simple software concept. As you know, MySQL 5 was followed by table partitioning, so before that, many potential users of MySQL had concerns about the scalability of MySQL, and partitioning became a key metric (not the only one, of course) to measure the scalability of a database. Database extensibility is a constant topic, and promoters of MySQL are often asked how to deal with the application data on a single database and need to do such processing as partitioning. The answer is Sharding.

Sharding is not a function attached to a specific database software, but an abstraction on top of the specific technical details. It is a solution of horizontal extension (Scale Out, or horizontal extension, or outspread). Its main purpose is to break through the limitation of I/O capability of single-node database server and solve the problem of database extensibility.


Related articles: