Skip to content

Almost automatic shard detection #165

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

Closed
wants to merge 2 commits into from
Closed

Almost automatic shard detection #165

wants to merge 2 commits into from

Conversation

levkk
Copy link
Contributor

@levkk levkk commented Sep 12, 2022

Automatically route to the right shard based on:

  1. if Q (simple query), sharding_key = <value> or comment that says /* sharding_key = <value> */
  2. if P (prepared, extended protocol), a comment that says /* sharding_key = <value> */

The more advanced version of this is to parse the SQL and get it out of Q and B packets depending on protocol. That one will require no modifications to clients (Ruby, Go, etc).

@levkk levkk changed the title Automatic shard detection Almost automatic shard detection Sep 12, 2022
@zainkabani
Copy link
Contributor

Isn't this at parity with what we have today in that the client has some responsibility for sending something to determine shard? This change is just trying to address the latency in the extra query?

@levkk
Copy link
Contributor Author

levkk commented Sep 13, 2022

Isn't this at parity with what we have today in that the client has some responsibility for sending something to determine shard? This change is just trying to address the latency in the extra query?

I'm considering changing every decision the pooler makes to be automatic instead of manual. Having our own syntax is fun, but it does, as you said, add latency. The end goal for this project is to abstract all scaling decisions away from the client and "just work".

@levkk
Copy link
Contributor Author

levkk commented Jan 25, 2023

Closing in favor of #293

@levkk levkk closed this Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants