Skip to content

Connection Pooling #17

Description

@bchavez

Thinking about connection pooling on a cluster with multiple connections.

Good starting point would be: (thanks AtnNn)
https://github.com/dancannon/gorethink/blob/master/cluster.go

This issue will serve as the design notes / change log implementation details.

A change feed on r.db("rethinkdb").table("server_status") seems like a great place to get updates about the cluster and IP info for multiple connections.

The next question would be how would we expose the API on r. to for a connection pool?

Current Connection API: Single Connection:

var c = r.connection()
         .hostname("192.168.0.11")
         .port(28015)
         .timeout(60)
         .connect();

Proposed API for connection pooling:

//Example 1
var p = r.connectionPool()
         .seed("192.168.0.11", "192.168,0.12", )
         .port(28015)
         .connect();
//Example 2
var p = r.connection()
         .pool()
         .seed("192.168.0.11", "192.168,0.12")
         .port(28015)
         .connect();
//Example 3
var p = r.cluster()
         .seed("192.168.0.11", "192.168,0.12", )
         .port(28015)
         .connect();

Any thoughts @deontologician on how the Java API would expose a pooled connection configuration?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions