asyncer-io / r2dbc-mysql

Reactive Relational Database Connectivity for MySQL. The official successor to mirromutth/r2dbc-mysql(dev.miku:r2dbc-mysql).
https://r2dbc.io
Apache License 2.0
195 stars 21 forks source link

[feature]Supports Multiple host configuration. #89

Open tabdelbari opened 1 year ago

tabdelbari commented 1 year ago

Is your feature request related to a problem? Please describe. The probleme is that tve driver doesn't support multiple host configuration

Describe the solution you'd like support multiple hosts configuration, for example: r2dbc:mysql//host1,host2/db

jchrys commented 1 year ago

Hello, @tabdelbari. Thank you for bringing this feature request to our attention. I'll be taking up the task to work on implementing multiple host configurations.

Considering that the R2DBC SPI already supports multiple hosts, it would be beneficial for our project to have this feature as well.

Similar requests have been made in the past, and there's a clear demand for this feature

jchrys commented 1 year ago

reference

tabdelbari commented 1 year ago

Thank you so much @jchrys

mirromutth commented 6 months ago

It requires following tasks:

  1. Connection strategy when creating the connection
  2. DNS SRV Records support: https://dev.mysql.com/doc/refman/8.0/en/connecting-using-dns-srv.html
  3. Reconnection strategy: autoReconnect/maxReconnects/reconnectAtTxEnd/initialTimeout option. It should be reconnected only if the connection is in auto-commit mode (not in a transaction).
  4. If secondaryBeforeRetrySource or requestsBeforeRetrySource is set, the default (no name) high availability mode will attempt to return the first host/address even if no communication exception occurs
  5. retriesAllDown option or alternative. If the connection fails for all hosts/addresses, whether to retry them all

These we should not consider: