So there are two slightly different issues to consider here:
- Connecting to a set of multiple known cockroach nodes directly at the client level for failover tolerance/performance.
- Being able to seamlessly take advantage of cluster changes (e.g. a cockroach cluster growing to more nodes, or migrating nodes), without needing clients to be aware.
You could configure clients that support connection pooling over multiple database URLs. This is client specific. While I have not worked with PHP, PHP PDO supports many underlying database drivers, and some of them do support load balancing over multiple database URLs.
Alternatively, you could also set up a proxy server (such as HAProxy) that provides a single connection URL for the client, and have HAProxy provide load balancing/failover resilience, or a DNS aliases with DNS round-robin load balancing. This way clients aren’t complicated.
We do have a goal to document some of these strategies, with example code in a few languages in Q1 2017.