Skip to content

Feature proposal: built-in multi-host balancer and reconnection with backoff #280

@0xCA

Description

@0xCA

Is your feature request related to a problem?

I plan to implement and MR further enhancements upon #110

Describe the solution

Goals:

  • Provide a native support for multi-node deployments. Essentially, there are going to be multiple hosts with the same credentials, and a connection to each host.
  • Single-node will just provide one host in the New(hosts []string, ..)
  • Exponential backoff for re-connections. This is mainly needed for the case where clients are connecting to the db directly (each authenticated with highly limited permissions), instead of going through a backend, to avoid db (cluster) overloads after temporary outages.
  • Possibly keep a way for complete external implementations of the same, while disabling internal one

Requirements:

  • Stable ws implementation
  • Stable wsrc implementation

Alternative methods

Only expose necessary stuff for everyone to implement the thing on their own?

Reasoning:

Convenience for everyone, and a much nicer balancer implementation, with a call to it hidden within a send method

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions