wesql / wescale

WeScale is a Modern MySQL proxy that supports read-write-split, read-after-write-consistency, load balancing and OnlineDDL.
Apache License 2.0
196 stars 8 forks source link

Title: Support SQL Buffering When Leader Changes Occur #153

Closed earayu closed 1 year ago

earayu commented 1 year ago

Background

In a high availability setup, leader changes can happen frequently, which can negatively impact the performance of the database. This is because, during leader changes, clients may be disconnected, and subsequently, they need to reestablish connections to the new leader. Furthermore, any in-flight SQL queries will be lost.

Solution

To minimize the impact of leader changes, we suggest adding support for SQL buffering. SQL buffering would allow SQL statements to be queued and executed once the new leader is elected. With SQL buffering, clients would be able to resend the SQL queries that were lost during leader changes automatically.

Overall, adding SQL buffering support should maximize the availability of the database and reduce user frustration due to lost queries.

see: https://vitess.io/docs/17.0/reference/features/vtgate-buffering/ https://vitess.io/docs/17.0/user-guides/configuration-advanced/buffering-scenarios/

earayu commented 1 year ago

feature/support_buffering