Almost automatic shard detection
Automatically route to the right shard based on:
- if
Q(simple query),sharding_key = <value>or comment that says/* sharding_key = <value> */ - 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).
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?
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".
Closing in favor of #293