Databases 6 min read

How PhxSQL Achieves MySQL-Compatible High Availability with Strong Consistency

PhxSQL is an open‑source, MySQL‑compatible relational database cluster that provides high availability and strong data consistency through a single‑master multi‑slave architecture, automatically switching masters when over half the nodes are alive, without relying on external services like Zookeeper, and requiring no code changes for migration.

WeChat Backend Team
WeChat Backend Team
WeChat Backend Team
How PhxSQL Achieves MySQL-Compatible High Availability with Strong Consistency

PhxSQL is an open‑source project that implements a MySQL‑compatible, highly available, strongly consistent relational database cluster.

It uses a single‑master multi‑slave deployment; when more than half of the machines in the cluster are alive, it can automatically switch the master while guaranteeing data consistency.

Advantages over typical MySQL HA solutions

Provides both high availability and strong consistency, achieving consistency comparable to Zookeeper.

Does not depend on third‑party leader election services such as Zookeeper, simplifying deployment.

Fully compatible with MySQL, allowing existing MySQL applications to migrate without any code changes.

The article presents the design and implementation of PhxSQL in a PPT format, starting from MySQL’s disaster‑recovery shortcomings, describing the ideas behind the high‑availability strong‑consistency solution, analyzing key points and solutions for each implementation step, and finally showing the results in terms of disaster recovery and performance.

GitHub repository: https://github.com/tencent-wechat/phxsql

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

high availabilityMySQLopen-sourcestrong consistencyDatabase ClusterPhxSQL
WeChat Backend Team
Written by

WeChat Backend Team

Official account of the WeChat backend development team, sharing their experience in large-scale distributed system development.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.