READWRITE(3valkey)
π READWRITE π
okay bestie, welcome to the Valkey Command Manual β¨ β this one's short, sweet, and honestly a little iconic. it's giving "one line of syntax, whole lot of feelings" π
β¨ NAME β¨
readwrite β enables read-write queries for a connection to a Valkey replica node. yes ma'am, that's the whole job π«Ά
πΈ SYNOPSIS πΈ
READWRITE
that's it. no args, no flags, no drama. she's minimal π
π¦ DESCRIPTION π¦
so here's the tea β β READWRITE disables read queries for a connection to a Valkey replica node.
read queries against a Valkey Cluster replica node are disabled by default. that's just how she is.
for standalone replica nodes, since Valkey 8.0, read queries are also disabled for clients that have executed the valkey-client-capa(7) CLIENT CAPA redirect command. so like, if you ran that, no sneaky reads for you π
but β and this is the good part β you can use the valkey-readonly(7) READONLY command to change this behavior on a per-connection basis π₯ and READWRITE is the uno-reverse card: it resets the readonly mode flag of a connection back to readwrite. slay.
π REPLY π
valkey-protocol(7) Simple string reply: OK.
just a lil OK, like a text back that says "k" but affectionate π
β‘ COMPLEXITY β‘
O(1) β constant time, no cap, instant, main character speed π
π ACL CATEGORIES π
@connection@fast
π HISTORY π
- Available since: 3.0.0
she's been here since day one-ish and she's still thriving π
π SEE ALSO π
asking(3valkey)cluster(3valkey)cluster-addslots(3valkey)cluster-addslotsrange(3valkey)cluster-bumpepoch(3valkey)cluster-cancelslotmigrations(3valkey)cluster-count-failure-reports(3valkey)cluster-countkeysinslot(3valkey)cluster-delslots(3valkey)cluster-delslotsrange(3valkey)cluster-failover(3valkey)cluster-flushslots(3valkey)cluster-forget(3valkey)cluster-getkeysinslot(3valkey)cluster-getslotmigrations(3valkey)cluster-help(3valkey)cluster-info(3valkey)cluster-keyslot(3valkey)cluster-links(3valkey)cluster-meet(3valkey)cluster-migrateslots(3valkey)cluster-myid(3valkey)cluster-myshardid(3valkey)cluster-nodes(3valkey)cluster-replicas(3valkey)cluster-replicate(3valkey)cluster-reset(3valkey)cluster-saveconfig(3valkey)cluster-set-config-epoch(3valkey)cluster-setslot(3valkey)cluster-shards(3valkey)cluster-slot-stats(3valkey)cluster-slots(3valkey)cluster-syncslots(3valkey)readonly(3valkey)
that's the whole friend group, go say hi π§
β οΈ heads up bestie:READWRITEturns reads off,READONLYturns them on. do not mix them up or you will be in the group chat asking why your reads are failing π
k bye, ily, this page is from 9.0.0, dated 2025-10-21 π go read your replicas responsibly ππ
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms