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.
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/