scylladb / scylladb/alternator-client-javascript
Shard-aware load balancing
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 6h 45m
- Merged PRs (30d)
- 5
Description
Jira task: https://scylladb.atlassian.net/browse/DRIVER-699
Jira epic: https://scylladb.atlassian.net/browse/DRIVER-43
Copied from Jira epic DRIVER-43:
After we implement [#11|https://github.com/scylladb/alternator-load-balancing/issues/11], to route every single-partition request to a good node (one of the three replicas holding a copy of the the partition, possibly one on the right rack or the same replica to reduce LWT contention), the next step requested by this issue is to route the request to a good shard on that node.
We have such a feature in CQL - enable_shard_aware_drivers. It creates a shard-aware port: Client connections to this port are routed to a specific shard according to a formula based on the client-side port numbers. Clients open many sockets to the same node instead of just one socket to a node, and each of these sockets ends up connected to a different shard. The client calculates which shard it wants to send the request to, and uses the appropriate socket to reach that shard directly. The shard is selected such that it owns the tablet with the requested token (we can also do this with vnodes, but we probably don't care about vnode support any more).
The connection-per-shard approach suggested here will probably require some hacking on the client SDKs. The HTTP library used by these SDKs will normally open only one socket between the client and some remote node X, or more if more concurrent requests come in, but we want it to deliberately open many connections and pick one of them according to a formula based on the client-side port, and then keep all of these connections open for the next request.
Migrated from GitHub issue: https://github.com/scylladb/alternator-load-balancing/issues/129
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository files, tests, or entry points. Start by reviewing the existing TypeScript SDK and the CQL enable_shard_aware_drivers behavior described here, then define how connection-per-shard handling should work. Done means single-partition requests are routed to an appropriate shard on a suitable replica node.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100