Sharding implementation #120
osvaldoandrade
started this conversation in
Ideas
Replies: 1 comment
-
|
The tone of HLD misses the target. The readers already know the basics, the doc does not need to explain that KVRocks does not implement RAFT. We chose a design that combines sharding + RAFT as we push for the highest standards and that's the reason sentinel is not acceptable here. Last thing, the doc also misses we can evolve the plugin architecture so persistence is not tied to KVRocks. The plugin interfaces should separate concerns, at minimum: auth and persistence. With that split, we can plug in Cassandra, HBase, or even TiKV (Raft & Rocks backed ) as persistence backends, without rewriting the core. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context
codeQ currently runs on a single KVRocks instance. All queue state — tasks, results, leases, pending/in-progress/delayed/DLQ structures — lives on one node. The API servers are stateless and scale horizontally, but KVRocks is the bottleneck for both throughput and availability.
Decision Drivers
slaveof(async replication) but requires manual intervention or Sentinel for failover — and async replication can lose recent writes.Decision
We will adopt kvrocks-controller (Apache KVRocks RAFT-based cluster manager) to provide:
Phase 1 (Immediate): Single RAFT Group
redisAddrat the controller proxyPhase 2 (When throughput demands): Multi-Shard
codeq:q:{command:tenantID}:pending:0codeq:tasks,codeq:results) by command+tenantShardSupplierinterface (already designed indocs/02-domain-model.md)Risks Accepted
RPOP + SADDclaim script crosses slots in multi-shardAlternatives Considered
References
docs/06-sharding.md— current placeholderdocs/02-domain-model.md— ShardSupplier interface sketchdocs/08-consistency.md— consistency model and failure windowsBeta Was this translation helpful? Give feedback.
All reactions