Differences and implementation of sharding, partitioning and replication (mongodb, mysql)
The difference between sharding and partitioning:
a. Sharding: solve the problem of insufficient physical disk space (if indexed, you can also optimize the query to achieve the function of partitioning)
b. Zoning:
Optimize the query to prevent the query from being slow due to too much data in a table
c. Copy:
Prevent the loss caused by the database crash and ensure the highly available fragmentation of the database:
A. Mongodb:sharding
B. Mysql:
Mysql-cluster partition implementation:
A. mongodb: there is no concept of sub-tables, sharding can be used instead of sub-tables (because sharding has its own indexing function)
B. Mysql:
Partition replication implementation:
A. Mongodb:master master slave slave
B. Mysql:
Master master slave slave