neo4j-php-client icon indicating copy to clipboard operation
neo4j-php-client copied to clipboard

Implement a connection resolver

Open transistive opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. When working in a high availability environment, it is custom to introduce multiple A or AAAA records for the same address, so the client can try different servers in the case a single one goes down. In the current implementation, it is impossible to do that, as it requests a single IP for a hostname.

Describe the solution you'd like We should abstract the problem away in a Connection Resolver class, which uses dns_get_record to iterate over all possible solutions when verifying connectivity before fetching the routing table. Once the routing table has been fetched, everything can resume as normal.

Describe alternatives you've considered The only real alternative is to create multiple drivers directly pointing to every IP address and pointing to each server instance and using verifyConnectivity on each driver to decide which one can fetch the routing table

Additional context https://www.php.net/manual/en/function.dns-get-record.php

transistive avatar Jul 11 '22 10:07 transistive