Database Mesh-oriented solutions for an easy-to-use, good-to-use, and practical user experience.
Pisanix version 0.2.0 was recently released. The newly released one supports dynamic read/write splitting. More details below.
Introducing dynamic read/write splitting
Read/write splitting is one of the most commonly used solutions for MySQL's high availability. It improves query performance and reduces server load in practical scenarios. On top of the static rules of v0.1.1, dynamic read/write splitting is added in this release.
Read/write splitting rules need to be configured when it comes to splitting with dynamic awareness. Pisa-Proxy performs SQL routing according to the rules. As shown in Figure 1.1, the Pisa-Proxy backend will start four monitors to sense the backend cluster status.
Monitor Reconcile will calculate and aggregate the data reported by the Monitor and draw the final state of the backend cluster. Then Monitor Reconcile sends the state information to RulesMatch through the channel. RulesMatch dynamically adjusts the backend data source list once it receives the message.
The concepts included above are:
- Node: Backend database node.
- RulesMatch: RulesMatch engine matches with the SQL query statements received by Pisa-Proxy based on the written rule set.
- TargetRole: A TargetRole group matched by the RulesMatch engine. Each TargetRole group may contain one or more nodes.
- LoadBalance: The load balance module selects an appropriate node from the TargetRole group according to the corresponding algorithm.
- TargetInstance: Nodes selected by the LoadBalance module.
- Discovery: Discovery type, which corresponds to the high availability strategy used by the backend data source, such as MHA, RDS, MGR, etc. The newly released version mainly supports MHA.
- Monitor: It refers to the backend detector module of Pisa-Proxy, which mainly relies on four kinds of Monitors in MHA.
- Connect Monitor: detect database connectivity.
- Ping Monitor: detect whether the database is healthy.
- Replication Lag Monitor: detect the latency status of primary-secondary replication.
- Read Only Monitor: detect the roles of primary-secondary databases.
Read/write splitting configuration
The configuration mode of dynamic read/write splitting is the same as that of the static one. The configuration items of dynamic read/write splitting are as follows:
|Parameter||Type||Dependency or not||Default Value||Description|
|user||string||Yes||None||Detector module checks the username of SQL statements.|
|password||string||Yes||None||Detector module checks the password of SQL statements.|
|monitor_period||u64||Yes||1000||The period (ms) by which detector module updates and senses the backend data source status.|
|connect_period||u64||Yes||1000||Connect Monitor detection period (ms)|
|connect_timeout||u64||Yes||6000||Connect Monitor detection timeout (ms)|
|connect_failure_threshold||u64||Yes||1||Number of retries when Connect Monitor detection fails|
|ping_period||u64||Yes||1000||Ping Monitor detection period (ms)|
|ping_timeout||u64||Yes||6000||Ping Monitor detection timeout (ms)|
|ping_failure_threshold||u64||Yes||1||Number of retries when Ping Monitor detection fails.|
|replication_lag_period||u64||Yes||1000||Replication Lag Monitor detection period (ms)|
|replication_lag_timeout||u64||Yes||6000||Replication Lag Monitor detection timeout (ms)|
|replication_lag_failure_threshold||u64||Yes||1||Number of retries when Replication Lag Monitor detection fails.|
|max_replication_lag||u64||Yes||10000||User-defined maximum primary/secondary latency threshold (ms)|
|read_only_period||u64||Yes||1000||Read Only detection period (ms)|
|read_only_timeout||u64||Yes||6000||Read Only detection timeout (ms)|
|read_only_failure_threshold||u64||Yes||3||Number of retries when Read Only Monitor detection fails.|
CRD configuration sample:
- algorithmName: roundrobin
- algorithmName: roundrobin
Pisanix v0.2.0 Description
- Support dynamic read/write splitting in the TrafficStrategy CRD ReadWriteSplitting field #208
- Support dynamic read/write splitting #204
- Add the sub-command: daemonsidecar #190
- Refactor config files of Pisa-Proxy #182
- Complete the SHOW SQL statement parsing #183
- Add code coverage checks to Pisa-Controller #192
- Enable reconnecting when backend data source fails to be connected #215
- Fix webhook tls #221
- Fix the request failure to switch MySQL authentication #170
- Handle exceptions of EOF package of MySQL protocol #166
- Fix the Charset character set #154
- Fix the environment variables injection #223
- New read/write splitting manual: https://www.pisanix.io/docs/v0.2.0/Features/readwritesplitting/
- Updated standalone deployment manual：https://www.pisanix.io/docs/v0.2.0/UseCases/standalone
- Updated to v0.2.0
There are 62 PRs in this release. Thanks to the following contributors:
🔗Download link: https://github.com/database-mesh/pisanix/releases/tag/v0.2.0
Building an open source community needs help from everywhere, no matter it's code or documentation, issues or pull requests, community thanks all of your efforts.
At present, there are some ways to join the community:
|Dev Meetings (Starting Feb 16th, 2022), Bi-weekly Wednesday 9:00AM PST||https://meet.google.com/yhv-zrby-pyt|
|Dev Meetings APAC Friendly (Starting April 27th, 2022), Bi-weekly APAC Wednesday 9:00PM GMT+8||https://meeting.tencent.com/dm/6UXDMNsHBVQO|
Feel free to talk !