whatyouhide/xandra

"Async" connections

Closed this issue · 1 comments

Somehow, I just realized that the Cassandra native protocol is async in nature and supports multiple in-flight requests. It does this through the stream ID that's present in every frame (see the spec).

I still like to use db_connection for request-response interactions that are local to the process making them: check out the socket, interact with it directly, and then check it back in.

However, some use cases might benefit significantly from having "async" connections that take advantage of the async nature of the protocol. For example, all use cases where open TCP/SSL sockets to Cassandra should be kept to a minimum could benefit a lot from having fewer connections processing a higher number of queries.

This issue is for discussion. I want to figure out how we could handle this. The first thing that comes to mind is to:

  1. Make Xandra a "connection behaviour"
  2. Implement Xandra.MultiplexedConnection
  3. Change Xandra.Cluster to support using different connection modules (this is already in the codebase for testing)

This is not trivial work, but hey, we're all cool birds. Thoughts? Feedback?

cc'ing all the folks I know who care about Xandra one way or another 😄: @relistan, @vinniefranco, @harunzengin, @jvf, @lexmag.

Closed in #334.