Free audit

View Audit Scope
JusDB16,384 CRC16 Hash Slots · Hash Tags {...} · Online Resharding · Cross-AZ Shards

Valkey Cluster engineering for 16,384-slot sharding and online scale-out.

JusDB architects, rebalances, and operates horizontal Valkey Cluster deployments when your working set or write throughput outgrows a single primary node. We size shard counts, engineer skew-free {hash_tag} key schemas, execute live online slot resharding without MIGRATING locks, enforce cross-AZ replica anti-affinity, and tune client MOVED/ASK topology refreshes.
The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed. Or start with a free read-only slot & shard skew audit.
  • NDA before access
  • Read-only by default
  • Written scope before work starts

valkey_cluster_16384_slots

16,384 Hash Slots

cluster_slots_assigned=16384 · 0 failed slots

Horizontal sharding across 16,384 CRC16 slots with cross-AZ replica failover.

Keyspace Partitioning
16,384 Hash Slots
Balanced CRC16 slot ownership across primary shards with cross-AZ replicas
Multi-Key Atomicity
Skew-Free Hash Tags
Bucketed {hash_tag} schemas enabling Lua and MGET without jumbo slots
Elastic Scaling
Online Resharding
Live slot migration and bigkey pre-checks with zero cluster downtime
P1 target (24x7 on-call)
15 minutes
Initial response under a 24x7 support agreement (2 to 4 hours business hours)

Selected clients

  • Innoviti
  • Blitz
  • Freecharge
  • Nango
  • Recochain
  • Screen Facts
  • Nexora
  • WeCredit

Cluster mode failure modes we solve

Six ways Valkey Cluster deployments break in production.

Sharding across 16,384 hash slots unlocks multi-terabyte scale and millions of ops/sec, but it introduces strict rules around multi-key operations, hash tags, and cross-AZ replica placement.

CROSSSLOT_MULTI_KEY_FAILURE

MGET, MSET, SUNION, or Lua scripts fail with CROSSSLOT Keys in request don't hash to the same slot

What is usually happening
Keys accessed together in a single multi-key command or transaction hash to different CRC16 slots across shards without a shared {hash_tag}.
How we engineer the fix
Design bounded {hash_tag} key prefixes for related entity keys (avoiding coarse tenant tags that create jumbo slots) or refactor multi-key calls into client pipelines.
JUMBO_HASH_TAG_SLOT_SKEW

Shard 3 hits 98% memory and evicts keys while all other shards sit at 35% utilization

What is usually happening
Overly broad hash tags (such as {orders} or a massive enterprise {customer_id}) force millions of keys into a single hash slot on one shard.
How we engineer the fix
Profile slot memory distribution via CLUSTER SLOTS / MEMORY USAGE, split jumbo hash tags into sub-buckets ({customer_id:bucket_0..7}), and rebalance slots.
STUCK_MIGRATING_IMPORTING_SLOTS

Interrupted resharding leaves slots stuck in [slot-<-node] / [slot->-node] state and spikes ASK redirects

What is usually happening
A valkey-cli --cluster reshard session timed out on a huge collection key or lost network connectivity mid-slot migration.
How we engineer the fix
Inspect CLUSTER NODES for migrating/importing markers, run valkey-cli --cluster fix with tuned timeout/pipeline flags, and reconcile slot ownership.
SAME_AZ_PRIMARY_REPLICA_PAIR

Single Availability Zone failure takes down both the primary and replica of Shard 2, halting the entire cluster

What is usually happening
Cluster creation assigned a replica to a primary in the same AZ, and cluster-require-full-coverage: yes halted all 16,384 slots when Shard 2 lost coverage.
How we engineer the fix
Enforce cross-AZ primary/replica pairing via explicit CLUSTER REPLICATE mapping, configure cluster-replica-validity-factor, and evaluate cluster-require-full-coverage.
GOSSIP_BUS_CPU_CHATTER

Cluster nodes burn 30-40% CPU on gossip ping/pong packets and trigger false PFAIL/FAIL elections

What is usually happening
Cluster was over-sharded past 100-200 nodes with a tight cluster-node-timeout, causing O(N^2) gossip bus traffic on port +10000.
How we engineer the fix
Consolidate smaller shards onto larger Valkey 8.0 multi-threaded nodes (io-threads), tune cluster-node-timeout (e.g., 15000 ms), and verify port +10000 firewall/MTU rules.
MOVED_STORM_CLIENT_STALL

Every slot rebalance or shard failover spikes application latency and opens ribuan new TCP sockets

What is usually happening
Client SDK refreshes the entire CLUSTER SLOTS topology map on every MOVED redirect without debounce throttling.
How we engineer the fix
Configure topology refresh debounce intervals and periodic background slot-map refreshes in Lettuce, go-redis, ioredis, or Valkey GLIDE.

Cluster engineering scope

Six workstreams for horizontal Valkey Cluster scale.

From initial shard count math and hash-tag design to live online resharding and SDK topology refresh tuning.

01

Shard Sizing & 16,384-Slot Architecture

Calculating the exact shard count, memory per shard, and replica ratio for your working set and write throughput.

  • Balancing node memory size (typically 16-64 GB per shard) against gossip bus overhead
  • Power-of-2 or divisible shard counts (6, 9, 12, 16, 24 shards) for clean slot math
CLUSTER SLOTS · CLUSTER INFO · Shard Math
Valkey consulting
02

Hash Tag {...} & Multi-Key Schema Design

Enabling atomic Lua scripts, pipelines, and multi-key commands in Cluster mode without creating hot-slot memory skew.

  • Engineering fine-grained {hash_tag} key naming that co-locates only related keys
  • Eliminating jumbo slots and hot-key bottlenecks with bucketed hash tags
CRC16 Hash Tags · CLUSTER KEYSLOT · Lua
03

Online Resharding & Scale-Out Execution

Adding shards, draining nodes, and rebalancing hash slots on live production clusters without blocking client traffic.

  • Tuned valkey-cli --cluster reshard / rebalance with controlled pipeline and timeout settings
  • Pre-migration bigkey splitting so MIGRATE commands never block the event loop
valkey-cli --cluster reshard · MIGRATE · --cluster fix
04

Cross-AZ Replica Pairing & Failover Tuning

Ensuring every shard's primary and replica sit in distinct Availability Zones so a zone outage never drops a single hash slot.

  • Deterministic cross-AZ CLUSTER REPLICATE topology and replica migration design
  • Tuning cluster-node-timeout, cluster-replica-validity-factor, and full-coverage policy
CLUSTER REPLICATE · cluster-node-timeout · AZ Spread
Valkey high availability
05

Cluster-Aware Client SDK & Redirect Tuning

Hardening application drivers to handle MOVED and ASK redirections, replica reads, and topology refreshes smoothly.

  • Topology refresh debounce and adaptive refresh triggers in Lettuce, go-redis, and GLIDE
  • READONLY replica routing for read-heavy hot slots
MOVED / ASK · READONLY · Cluster Topology Refresh
06

Standalone-to-Cluster Migration & Operations

Moving workloads that have outgrown a single primary + Sentinel setup onto a sharded Valkey Cluster.

  • Riot / RedisShake / custom dual-write slot-sharding pipelines with zero cold cache
  • Ongoing cluster health monitoring and slot-skew alerting under Remote DBA care
Valkey Cluster Migration · Prometheus · Remote DBA
Valkey Remote DBA

Shared responsibility & response targets

Cloud cluster provisioning vs 16,384-slot engineering.

Managed services spin up Cluster nodes, but they do not prevent jumbo hash-tag skew, CROSSSLOT application errors, or client redirect storms.

Shard instances & VPC network fabric
ElastiCache / Memorystore provisions shard VMs.
Your infra team provisions nodes; JusDB defines shard counts, AZ placement, and port +10000 rules.
16,384 hash-slot distribution & resharding
Automated rebalance can stall on bigkeys.
JusDB audits bigkeys first and executes paced valkey-cli --cluster reshard / rebalance.
Hash tag {...} & CROSSSLOT key design
Never handled by cloud providers - application schema issue.
JusDB designs bucketed hash tags that support Lua/multi-key ops without slot skew.
Cross-AZ primary/replica anti-affinity
Managed Multi-AZ handles basic placement.
JusDB enforces deterministic cross-AZ CLUSTER REPLICATE pairing and failover settings.
Client MOVED/ASK topology refresh tuning
Application team responsibility.
JusDB configures SDK topology refresh debounce and replica-read policies.
Initial-response targets (for retained clusters)

P1 to P4 incident response matrix

Initial-response targets are 2 to 4 hours during covered business hours, Mon–Fri 09:00–18:00 IST (UTC+5:30). Where your service agreement includes 24x7 on-call, the initial-response target for P1 incidents is 15 minutes. Targets are not resolution guarantees. Our engineering team is in India; business-hours coverage is Mon–Fri 09:00–18:00 IST (UTC+5:30), and 24x7 on-call is available under your service agreement.

SeverityCondition24x7 TargetBusiness Hours
P1 · CriticalProduction database down, primary unreachable, data corruption risk, or active failover event.15 minutes2 to 4 hours
P2 · HighSevere latency spike, replication lag climbing rapidly, connection exhaustion, or degraded HA node.30 minutes2 to 4 hours
P3 · MediumNon-critical slow query regression, staging issue, backup warning, or replication check alert.60 minutes2 to 4 hours
P4 · LowConfiguration question, index advisory, planned schema review, or general operational request.90 minutes2 to 4 hours

Initial-response targets, not resolution guarantees. The target for your engagement is set in your service agreement.

Your team retains

Customer ownership

  • Set business priorities, application requirements, and release plans
  • Approve production changes, except routine actions you have pre-approved
  • Own your cloud accounts, access policies, and vendor relationships
  • Decide when maintenance can happen and how quickly service must recover
  • Move the work in-house or to another provider after your agreement's notice period, with your data returned or deleted and the transition help your agreement sets out (see Terms, section 8)
JusDB owns

Engineering accountability

  • Monitor database health, investigate alerts, and involve the right people
  • Review query performance, replication, capacity, and backup health
  • Carry out approved changes and update the operating instructions they affect
  • Report completed work, open risks, and recommended next steps

Hash-slot & rebalancing simulator

See how jumbo hash tags skew a shard and how online resharding heals it.

Toggle between a balanced 16,384-slot cluster, a skewed shard with stuck MIGRATING slots, and a rebalanced 4-shard layout.

valkey_cluster_slot_simulator

Application and routing

Cluster Client (CRC16 Slot Map) -> Direct Single-Hop to Owning Shard Primary

Active
  • Shard 1 · Slots 0 - 5460

    Primary (AZ-a) + Replica (AZ-b)

    mem=52% · p99=0.3ms · cross-AZ replica synced

  • Shard 2 · Slots 5461 - 10922

    Primary (AZ-b) + Replica (AZ-c)

    mem=50% · p99=0.3ms · cross-AZ replica synced

  • Shard 3 · Slots 10923 - 16383

    Primary (AZ-c) + Replica (AZ-a)

    mem=51% · cluster_state:ok · 16,384 slots assigned

All 16,384 hash slots are evenly distributed across shards, every primary's replica sits in a different Availability Zone, and cluster-aware clients route requests in a single hop.

Production Cluster runbook

Slot coverage inspection, --cluster fix, and online rebalancing.

Exact valkey-cli cluster diagnostics and paced rebalancing procedures we use on production sharded fleets.

Cluster Blueprint #04 · Slot Skew & Fix

Resolving a 38 GB jumbo hash-tag slot and scaling from 6 to 9 primary shards online

A 6-shard Valkey Cluster suffered frequent evictions on Shard 2 because an application rate-limiter used a coarse ratelimit:{enterprise} hash tag, pinning 42 million keys to Slot 11,042. A manual resharding attempt timed out and left 3 slots stuck in MIGRATING state.

Slot repair & key fix: Cleared the half-migrated slots via valkey-cli --cluster fix and sharded the rate-limiter tag into 64 sub-buckets (ratelimit:{enterprise:00..63}).
Online scale-out: Joined 3 new cross-AZ primary/replica shard pairs and executed a paced --cluster rebalance with --cluster-pipeline 50.
Completed online with p99 latency holding below 0.8 ms throughout resharding

01 · Read-only 16,384-slot health, AZ replica pairing & skew inspection

# 1. Verify cluster_state:ok, 16,384 assigned slots, and check for stuck MIGRATING/IMPORTING slots
valkey-cli -c -h 10.60.1.10 CLUSTER INFO
valkey-cli --cluster check 10.60.1.10:6379

# 2. Inspect primary-to-replica mapping and slot count distribution across all shards
valkey-cli -c -h 10.60.1.10 CLUSTER NODES | sort -k 3

# 3. Verify which CRC16 slot a hash-tagged key maps to
valkey-cli -c -h 10.60.1.10 CLUSTER KEYSLOT "ratelimit:{enterprise:04}:user_991"

02 · Fix stuck migrating slots & execute paced online slot rebalance

# 1. Repair any slots stuck in MIGRATING / IMPORTING state after a network interruption
valkey-cli --cluster fix 10.60.1.10:6379 --cluster-timeout 10000

# 2. Rebalance 16,384 hash slots evenly across all primary shards with controlled pipeline batching
valkey-cli --cluster rebalance 10.60.1.10:6379 \
  --cluster-use-empty-masters \
  --cluster-pipeline 50 \
  --cluster-threshold 2

# 3. Confirm all 16,384 slots are clean and evenly balanced
valkey-cli --cluster info 10.60.1.10:6379
Evaluation Vector
JusDB DBRE
In-House DBALegacy AgencyDeveloper Generalist
16,384 Hash Slot Allocation & Shard Topology DesignModels memory working sets to allocate all 16,384 slots evenly across primary master shards, provisioning dedicated copy-on-write RAM headroom and placing replicas across diverse availability zones.Assigns arbitrary slot ranges without monitoring keyspace growth distributions, causing asymmetric shard memory exhaustion and premature failover cascading.Over-provisions dozens of tiny shards, multiplying cluster bus gossip chattiness and cross-node network overhead without achieving throughput gains.Deploys single-master setups or leaves slot assignment unbalanced, causing hot-shard memory exhaustion and unmitigated cluster failover cascades.
Cross-Slot Hash Tag ({tag}) Data Modeling & Multi-Key TransactionsArchitects hash tag naming conventions (e.g. {tenant:402}.session) to ensure related multi-key operations (MGET, MSET, EVAL Lua scripts) map to identical hash slots without cross-slot errors.Executes unconstrained multi-key operations across disparate keys, triggering recurring CROSSSLOT runtime errors that crash user sessions.Disables atomic multi-key operations entirely and runs sequential GET calls, multiplying latency tenfold through network round-trip amplification.Applies hash tags blindly to entire entities, concentrating massive query volume onto a single hash slot and recreating single-node performance bottlenecks.
Online Resharding & Slot MigrationExecutes live slot resharding pipelines with dynamic batch migration, ASK redirection tracking, and automated slot ownership convergence, throttled to keep the cache online and limit latency spikes.Triggers un-throttled valkey-cli reshard commands during peak traffic, overwhelming master nodes, inducing replica timeouts, and causing failover flapping.Forces maintenance windows with flushall and cold reloads rather than performing live slot migrations, degrading downstream database performance.Aborts in-flight slot migrations upon encountering transient network blips, leaving hash slots in an orphaned or migrating state that breaks cluster coverage.
Multi-Threaded I/O (io-threads) Engine ScalingTunes Valkey 8 multi-threaded I/O (io-threads and io-threads-do-reads) and pins worker threads to hardware NUMA nodes, pushing throughput beyond 1.2M QPS per shard at sub-ms p99 latency.Leaves Valkey in default single-threaded mode, hitting single-core CPU saturation at ~100k QPS while host multi-core CPU capacity sits idle.Over-allocates I/O threads beyond physical core count, causing intense Linux context-switching thrashing and elevating latency jitter.Unaware of Valkey's multi-threaded engine capabilities; attempts to solve throughput limits by prematurely adding unnecessary shard instances.
MOVED and ASK Client Redirection Error HandlingAudits and configures client SDK connection pools to handle MOVED (permanent slot update) and ASK (transient migration redirect) responses with smart slot-map caching and backoff resilience.Fails to tune client slot cache refresh intervals, triggering redirect storms that saturate cluster networking during planned failovers or resharding.Connects standard non-cluster Redis client SDKs to Valkey Cluster ports, causing complete query failure upon receiving the first MOVED redirection.Treats MOVED/ASK responses as fatal query errors instead of redirecting queries, breaking user flows whenever cluster slots shift.
Split-Brain Prevention & Automated Failover QuorumCalibrates cluster-node-timeout, cluster-replica-validity-factor, and quorum thresholds across odd-numbered primary nodes to completely eliminate dual-master split-brain risks.Leaves cluster-node-timeout at aggressive sub-second defaults, inducing false-positive failover loops during temporary network blips.Deploys master and replica pairs within identical availability zones, leaving the entire cluster vulnerable to total data loss during cloud infrastructure outages.Disables cluster-require-full-coverage without configuring client handling for partial cluster availability, serving stale or corrupt data silently.

Engagement models

Three ways to engage JusDB for Valkey Cluster.

From fixed-scope cluster design and online resharding to ongoing Remote DBA fleet management. A monthly retainer for a set number of engineering hours, or a monthly fee per database instance, HA cluster, or region; projects are scoped and quoted separately.

Architecture & Resharding

Cluster Design & Scale-Out

Shard sizing math, hash-tag key refactoring, cross-AZ replica mapping, and hands-on execution of online slot rebalancing.

Continuous Operations

Valkey Remote DBA

Ongoing monitoring of slot skew, memory fragmentation, rolling shard upgrades, and backup drills under a monthly retainer.

Emergency Escalation

Valkey Support

15-minute P1 incident response under a 24x7 support agreement for cluster_state:fail, stuck slot migrations, and shard OOMs.

Procurement and security

Ready for legal and security review.

Mutual NDA before any access, least-privilege credentials in your vault, and security controls aligned with ISO 27001 and SOC 2 Type II.
  • Mutual NDA before any access
  • Named individual accounts only
  • Read-only access by default
  • ISO 27001 & SOC 2 Type II: aligned, certification in progress
  • Mutual NDA before any access

    We sign a mutual NDA before viewing schemas, logs, slow-query captures, or cloud topology.

  • Least-privilege, named credentials

    Engineers connect through your bastion, VPN, or SSM using named accounts with read-only permissions by default.

  • Change control & approval gates

    Production DDL, parameter changes, and failovers follow your change-management workflow with rollback steps prepared first.

  • Named leadership & direct escalation

    Engagements are led by named senior database reliability engineers in India with direct Slack, Teams, and PagerDuty channels.

Valkey Cluster FAQ

16,384 hash slots, MOVED/ASK, and hash-tag questions.

Direct technical answers on horizontal sharding, multi-key operations, and online rebalancing in Valkey Cluster.

Still have a question?

Ask it on a scoping call. No production access needed.

Book a 30-min scoping call (opens Google Calendar in a new tab)

When should we switch from Valkey Sentinel to Valkey Cluster mode?

Switch to Valkey Cluster mode under two conditions: (1) your working-set dataset exceeds what is safe and economical on a single memory node (typically 64 GB to 128 GB once copy-on-write fork headroom is reserved), or (2) sustained write throughput saturates a single primary node's CPU capacity. Below those thresholds, a single primary with replicas and Sentinel (/databases/valkey/high-availability) is simpler and supports unrestricted multi-key commands.

How many shards should a production Valkey Cluster have?

Divide your total projected working-set memory by your target per-shard maxmemory (usually 16 GB to 48 GB per shard so RDB forks and slot migrations stay fast). A minimum Valkey Cluster requires 3 primary shards (6 nodes with 1 replica per shard). Most production clusters run between 6 and 24 shards; over-sharding past 100+ nodes increases port +10000 gossip overhead without proportional benefit.

What is the difference between MOVED and ASK redirection in Valkey Cluster?

Valkey Cluster partitions the keyspace into 16,384 hash slots via CRC16(key) mod 16384. When a client sends a command to the wrong shard, Valkey returns MOVED <slot> <ip:port> if the slot has permanently moved to another shard (telling the client to update its cached slot map), or ASK <slot> <ip:port> if the slot is currently mid-migration to another shard (telling the client to send ASKING + retry that single command on the target without updating its permanent slot map).

How do hash tags work and why can they cause memory skew?

If a key contains a substring inside curly braces, such as user:{48192}:profile and user:{48192}:cart, Valkey hashes only the characters inside {...}. This guarantees both keys land in the exact same hash slot so MGET, multi-key transactions, and Lua scripts work without CROSSSLOT errors. However, if a team uses a low-cardinality tag like {us-east}, millions of keys pile into one slot on one shard. We design high-cardinality or bucketed hash tags to keep shard memory balanced.

Can you reshard or scale out a Valkey Cluster without downtime?

Yes. Valkey Cluster supports live online slot migration between shards while serving production reads and writes. Before starting a reshard, we scan for bigkeys (large Hashes, Sets, or ZSETs) because migrating a single multi-megabyte key blocks the source and destination shards during the atomic MIGRATE step. With bigkeys remediated and pipeline batching tuned, online resharding completes with sub-millisecond impact.

What support and operational options are available for Valkey Cluster?

Initial-response targets are 2 to 4 hours during covered business hours, Mon–Fri 09:00–18:00 IST (UTC+5:30). Where your service agreement includes 24x7 on-call, the initial-response target for P1 incidents is 15 minutes. Targets are not resolution guarantees. Our engineering team is in India; business-hours coverage is Mon–Fri 09:00–18:00 IST (UTC+5:30), and 24x7 on-call is available under your service agreement. We offer fixed-scope Cluster architecture and resharding projects, continuous management under Valkey Remote DBA (/databases/valkey/remote-dba), and 24x7 P1 incident escalation under a 24x7 support agreement (/databases/valkey/support). A monthly retainer for a set number of engineering hours, or a monthly fee per database instance, HA cluster, or region; projects are scoped and quoted separately.

Valkey engineering ecosystem

Adjacent Valkey services for sharded and non-sharded fleets.

Compare horizontal Cluster sharding against Sentinel HA, or pair Cluster design with performance tuning and managed operations.

Resilience

Valkey High Availability (Sentinel)

Single-primary + replica + Sentinel quorum engineering when you do not need horizontal sharding.

Explore service
Architecture

Valkey Consulting

Upfront sizing to decide between Sentinel and Cluster mode, plus BSD-3 transition planning.

Explore service
Optimization

Valkey Performance Tuning

Valkey 8.0 multi-threaded I/O, jemalloc activedefrag, and bigkey/hotkey optimization.

Explore service
Operations

Valkey Remote DBA

Continuous monitoring, online slot rebalancing, and warm-cache rolling upgrades.

Explore service
Support

Valkey Support Services

15-minute P1 incident response under a 24x7 support agreement for cluster_state:fail and stuck slots.

Explore service
Cloud-Native

Valkey on Kubernetes

Running sharded Valkey Cluster on EKS, GKE, and AKS with the Valkey Operator.

Explore service

Related Valkey Services

Explore more ways our Valkey experts can help with your database infrastructure.

Scale Valkey horizontally without CROSSSLOT or resharding stalls

Architect a balanced 16,384-slot Valkey Cluster with senior DBREs.

Book a scoping call to review your shard count, hash-tag key design, and online resharding runbook.