By Mengshi
PolarDB-X, X-DB, and PolarDB are all database products developed by Alibaba.
Let's take a closer look at their relationship.
Firstly, we need to understand what X-DB is. In short, X-DB is a highly available distributed database built on MySQL, using the XEngine. It can operate across availability zones (AZ).
One of the core capabilities of X-DB is achieving a cross-AZ RPO of 0 based on Paxos. Initially, Alibaba used MySQL in a traditional primary/secondary architecture, with each MySQL instance consisting of two nodes.
This architecture had a significant flaw; if a primary/secondary switchover occurred, it might lead to inconsistent replica data. To address this, Alibaba used a variety of operational means to tackle these issues, including:
Although this architecture worked, it was not an elegant solution. It was highly complex and expensive to maintain, making it challenging to keep up with the growth of services.
In 2016, Alibaba began developing X-DB. The primary goal of X-DB was to ensure data consistency across replicas. The X-DB team chose to develop their own Paxos protocol to replace MySQL's master-slave replication mechanism. For more information on Paxos, there are numerous articles available online.
Here are two main advantages of using the Paxos protocol with MySQL: 1. You can perform a switchover at any time without causing data inconsistency (RPO=0). 2. Leader election and failure detection are completed within the X-DB kernel (MySQL process), without needing any external systems.
After several years of development at Alibaba, the Paxos protocol of X-DB combined with MySQL has completely replaced traditional master-slave MySQL clusters, offering high reliability.
While X-DB addresses disaster recovery and failback issues, PolarDB-X stands out for its versatility in service scenarios and its horizontal scaling abilities.
PolarDB-X 2.0 integrates the cluster disaster recovery technology of X-DB into its data nodes and provides horizontal scaling abilities.
In the industry, many distributed databases use protocols such as Paxos to build data nodes. For example, TiKV uses the Raft protocol, and OceanBase uses the Paxos protocol.
The following figure shows the three-replica mechanism of TiKV.
The relationship between X-DB and PolarDB-X extends beyond the Paxos protocol. Significant development work has been done in areas such as distributed transactions, scalability, computing pushdown, and HTAP. Stay tuned for our upcoming articles for more information.
PolarDB (specifically PolarDB for MySQL) is a cloud-native database that uses shared storage technology. This allows for highly elastic storage space, but typically, its computing and writing capabilities are limited by the capacity of a single machine.
PolarDB-X 2.0, on the other hand, uses a shared-nothing architecture. This means that all resources, including computing, writing, reading, and storage, can scale horizontally, which avoids single-machine bottlenecks.
However, this architecture is less flexible in terms of pure data capacity compared to the shared storage architecture of PolarDB.
For instance, with any shared-nothing database such as PolarDB-X 2.0 or TiDB, if you have 10 machines with 10 TB of data and want to expand storage by adding more machines, half of the data needs to be moved to the new machines. The time required for this migration is directly proportional to the amount of data. Generally, it can take several hours to move tens of terabytes of data.
In contrast, with PolarDB, such scaling can be completed in minutes.
Can we combine the benefits of shared-nothing and shared-storage/shared-everything architectures?
The answer is yes.
The next-generation distributed databases integrate the core technology of PolarDB, which leverages RDMA hardware and a shared storage architecture, into the data nodes. This integration allows for horizontal scaling of all resources and significantly reduces the costs associated with capacity elasticity.
In the future, the local disk version and shared storage version of PolarDB-X will coexist. The local disk version does not require special hardware. Therefore, this version is ideal for lightweight deployment on private clouds, targeting delivery with just three machines. On the other hand, the shared storage version offers highly elastic capacity, which is best utilized on a public cloud where a large pool of machines is available for scaling.
Try out database products for free:
ApsaraDB - June 5, 2024
ApsaraDB - December 21, 2022
ApsaraDB - June 19, 2024
ApsaraDB - February 21, 2023
ApsaraDB - January 3, 2024
ApsaraDB - September 11, 2024
Alibaba Cloud PolarDB for PostgreSQL is an in-house relational database service 100% compatible with PostgreSQL and highly compatible with the Oracle syntax.
Learn MoreAlibaba Cloud PolarDB for Xscale (PolarDB-X) is a cloud-native high-performance distributed database service independently developed by Alibaba Cloud.
Learn MoreAlibaba Cloud PolarDB for MySQL is a cloud-native relational database service 100% compatible with MySQL.
Learn MoreLeverage cloud-native database solutions dedicated for FinTech.
Learn MoreMore Posts by ApsaraDB