r2dbc-mysql icon indicating copy to clipboard operation
r2dbc-mysql copied to clipboard

Add support for multiple hosts configuration

Open mirromutth opened this issue 1 year ago • 3 comments

Motivation:

Support for multiple hosts configuration.

Resolves #89

It also resolves #255 because if the user uses multiple hosts we have to resolve the hostname and port ourselves

Modification:

  • [x] Refactor host/unixSocket and add addHost to configure multiple hosts
  • [x] Allow to use Mono.zip for user and password, because we have to receive and cache credential before we try to connect to multiple hosts
  • [x] Add multiple hosts connection strategy
  • [x] Add HA protocol support for multiple hosts
  • [x] Allow to use DNS SRV records for HA protocol, like r2dbc:mysql+srv:loadbalance://my-db-1,my-db-2/test
  • [ ] Add autoReconnect/maxReconnects support, FailoverClient
  • [ ] Add failover events support and description
  • [ ] Add reconnection strategy
  • [ ] Add get back to primary host for default HA protocol, queriesBeforeRetrySource and secondsBeforeRetrySource

User can only configure one of:

  • host/port for a single host
  • addHost for multiple hosts, it will be auto-converted from ConnectionFactoryOptions.HOST
  • unixSocket for Unix Domain Socket.

Result:

Support multiple hosts configuration with HA protocol.

Support DNS SRV Records for HA protocol.

mirromutth avatar Mar 12 '24 06:03 mirromutth

@jchrys It is going to be a big feature, so I will mark it to 1.2.0

mirromutth avatar Mar 12 '24 06:03 mirromutth