Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Async" connections #333

Closed
whatyouhide opened this issue Sep 28, 2023 · 1 comment
Closed

"Async" connections #333

whatyouhide opened this issue Sep 28, 2023 · 1 comment

Comments

@whatyouhide
Copy link
Owner

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.

@whatyouhide
Copy link
Owner Author

Closed in #334.

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

No branches or pull requests

1 participant