Principles and Practices of Database Splitting

Author: Zen and the Art of Computer Programming

1 Introduction

With the rapid development of the Internet and the surge of website traffic, the increasing expansion of website database has become a serious problem. The capacity of a single database has reached the upper limit of the server memory, and the cost of horizontal expansion is getting higher and higher. Therefore, how to split and cut the database is an indispensable part of the database architecture design.

The principle and practice of database splitting are the key factors affecting the design of database architecture. From a business perspective, this article summarizes and expounds the principles of database splitting and related best practices for readers' reference.

2. Background introduction

2.1 What is a split?

Database splitting is the process of splitting a huge database into multiple small databases according to certain standards or rules. Before splitting, the database system is usually a whole, and all information is stored in this whole database. However, with the continuous increase of data, such a model will make the data difficult to manage and the query efficiency will be low.

For example, the storage of microblog user data can be divided into three databases, which respectively store information such as user information, user dynamics, and user relationships. Each table only stores specific types of data, which facilitates data query and improves query speed.

2.2 Why do we need to split?

Splitting has two main purposes:

  • Efficiency optimization: The split database can be distributed to different servers, and each server is responsible for different data fragments, which can effectively improve query performance;
  • Expansion: When the capacity of the database cannot meet the demand, the horizontal expansion of the database can be realized by splitting, so that the database can serve more user requests at the same time.

Therefore, the advantage of splitting is to improve the system by balancing the load to different machines.

Guess you like

Origin blog.csdn.net/universsky2015/article/details/132507489