CLUSTER-MYSHARDID(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

πŸ’– CLUSTER-MYSHARDID πŸ’–

okay bestie, so this is a valkey command page β€” cluster-myshardid(3valkey) if you wanna be formal about it. it lives in the valkey command manual and it's about to tell you which shard your node is repping. slay.


✨ NAME ✨

cluster-myshardid β€” returns the shard ID of a node. that's it. that's the whole job. and it does it flawlessly, no cap. πŸ‘‘


🌸 SYNOPSIS 🌸

CLUSTER MYSHARDID

literally just that. no args, no drama, no extra syllables. it's giving minimalism. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so when you run this, it hands you back the node's shard id. simple.

but like, let me give you the ✨lore✨ β€” CLUSTER MYSHARDID returns the unique, auto-generated identifier that's associated with the shard that the connected cluster node belongs to. so every shard in your cluster has its own lil fingerprint, auto-minted, one of a kind, main character energy only. and this command is like "hey, this is your shard's fingerprint, bestie." 🫢

no guessing, no counting slots, no vibe check needed β€” the answer just exists, already assigned, ready for you.


πŸŽ€ REPLY πŸŽ€

like a lil string in a bottle. except the bottle is a RESP bulk string and the message is your shard's identity.


⭐ COMPLEXITY ⭐

O(1)

constant time, babes. it does not scale with your cluster size, it does not care how many nodes you got, it does not stress. one lookup, done, periodt. ⚑


🌈 ACL CATEGORIES 🌈

  • @slow

yes it's filed under slow (the command category, not a judgement on its personality). don't @ me, that's just where it lives. 😭


🧚 HISTORY 🧚

  • Available since: 7.2.0

so it's not ancient, it's not brand new β€” it's that perfect middle era. vintage enough to be trusted, fresh enough to be iconic. πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, they're all in the same friend group fr fr:

ok quick fyi bestie: cluster-myid(3valkey) gives you the node id, and this page's cluster-myshardid gives you the shard id. they are not the same thing and i need you to internalize that before you go confusing yourself in prod. πŸ™ˆ

and that's the whole page!! πŸ’– you now know exactly what shard you belong to, which is honestly more than most people know about themselves. iconic behavior. ✨

this page is from valkey 9.0.0, dated 2025-10-21 β€” so yeah, fresh-ish, well-loved, and yes i'm aware the command itself showed up in 7.2.0, don't come for me, that's just when the docs got their lil timestamp. anyway. mwah. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from