PolarDB Series (3): Elasticity and Scalability

Ubiquitous Pulse Computation

Large events such as Alibaba’s Double 11 Global Shopping Festival and the Spring Festival travel rush in China involve a lot of people, and require large amounts of computing resources. Computation of large amounts of urgently needed computing resources is referred to by us as pulse computation. On Alibaba Cloud, both ECS servers and databases need to cope with such sudden pulse fluctuations to ensure the smooth and stable operation of the entire system.

Separation of Storage and Compute

The greatest feature of PolarDB is the separation of storage and compute. Specifically, the compute node (DB Engine) and the storage node (DB Store) are on different physical servers. All I/O operations that go to the storage device are network I/O operations. Some may ask about the network latency and performance. In the previous article of this series, I briefly introduced the latency comparison between using PolarFS to write three data block replicas to PolarStore over the network, and writing one data block replica to a local SSD. The results are very close.

Challenges of Database Elastic Scaling

Auto scaling is a major feature of the cloud that attracts many people to migrate their IT systems to the cloud. However, auto scaling of the database has always been an industry pain point. Unlike ECS instances that purely provide computing services, database elastic scaling has the following difficulties.

Elasticity Feature of PolarDB

As shown above, PolarDB is a layered architecture. In the top layer, PolarProxy provides read-write splitting and SQL acceleration functions. In the middle layer, the database engine node PolarDB has a multiple-read single-write (MRSW) database cluster. In the bottom layer, the distributed storage PolarStore provides multi-node shared storage for the top layer. Each of these three layers have different roles. Together, they make up a PolarDB cloud database cluster.

Vertical Scaling (Scaling Up/Down Configuration)

Thanks to the separation of storage and computation, we can scale up/down the configuration of a PolarDB database node separately. If it does not involve data migration, the whole process takes only 5–10 minutes (being constantly optimized). If the current server resources are insufficient, we can also quickly migrate to another server. However, when it involves cross-server data migration, there may be tens of seconds of transient disconnection (in the future, this effect can be eliminated by PolarProxy, and the upgrade will have completely no impact on the business application).

Horizontal Scaling (Adding/Removing Nodes)

Because of shared storage, we can quickly add nodes without copying any data. The whole process only takes 5–10 minutes (being constantly optimized). Adding a node does not affect the business application. Removing a node only affects connections to the removed node, and the connections can be re-established later.

Storage Space with Zero Management Effort

You don’t need to be concerned about the storage space of PolarDB. It is charged based on the actual volume used, which is automatically settled on an hourly basis.

Typical Scenarios

An online education company in Beijing deployed an online examination system for primary school students. There are 50,000 to 100,000 users simultaneously online on weekdays in ordinary time, 200,000 on weekends, and 500,000 to 1 million during the peak examination period. The data size is less than 500 GB. The major dificulties are highly-concurrent user access, read-write contention, and high I/O. The cost will be too high to always buy the highest configuration. The elastic scaling capability of PolarDB allows the company to temporarily increase database configuration and cluster scale during peak days. This reduces the overall cost by 70% compared to the previous solution.



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
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com