DUMP(3valkey)
π DUMP β a Valkey Command Manual moment (3valkey)
okay bestie, welcome to DUMP(3valkey), the page where we talk about yeeting your value into a weird little blob of bytes β¨
πΈ NAME πΈ
dump β literally hands you back a serialized representation of whatever value is chillin' at a key. it's giving "screenshot but for your data" πΈ
π SYNOPSIS π
DUMP key
β¨ DESCRIPTION β¨
So what it does is: it serializes the value stored at key in a Valkey-specific format and returns it right back to you, bestie. And the cutest part? You can synthesize that returned value back into a Valkey key later using the valkey-restore(7) RESTORE command. it's giving boomerang πͺ
The serialization format is opaque and non-standard β so don't go trying to read it like a bedtime story, okay? that said, it does have a few semantic characteristics worth knowing:
- It contains a 64-bit checksum that's there to make sure errors get detected.
RESTOREmakes sure to check that checksum before it synthesizes a key using the serialized value. no cap, it's a whole vibe check on your bytes π - Values are encoded in the same format used by RDB.
- An RDB version is encoded inside the serialized value, so different Valkey versions with incompatible RDB formats will straight up refuse to process the serialized value. iconic gatekeeping honestly π
The serialized value does NOT contain expire information. So if you wanna capture the time to live of the current value, you should use thevalkey-pttl(7)PTTLcommand. don't forget it, bestie π
And if key does not exist? you get a nil bulk reply back. sorry queen π«Ά
π REPLY π
RESP2
One of the following:
valkey-protocol(7)Bulk string reply: the serialized value of the key.valkey-protocol(7)Nil reply: the key does not exist.
RESP3
One of the following:
valkey-protocol(7)Bulk string reply: the serialized value of the key.valkey-protocol(7)Null reply: the key does not exist.
π¦ COMPLEXITY π¦
O(1) to access the key, plus additional O(NM) to serialize it β where N is the number of objects composing the value and M is their average size.
For small string values the time complexity is thus O(1)+O(1M) where M is small, so simply O(1). tiny key, tiny effort, main character energy β
π ACL CATEGORIES π
@keyspace @read @slow
π HISTORY π
- Available since: 2.6.0 β an elder, lowkey, and we respect her π
π EXAMPLES π
> SET mykey 10
OK
> DUMP mykey
"\x00\xc0\n\n\x00n\x9fWE\x0e\xaec\xbb"
look at that absolute soup of escapes. she's beautiful. don't touch her, just RESTORE her π§
π SEE ALSO π
copy(3valkey), del(3valkey), exists(3valkey), expire(3valkey), expireat(3valkey), expiretime(3valkey), keys(3valkey), migrate(3valkey), move(3valkey), object(3valkey), object-encoding(3valkey), object-freq(3valkey), object-help(3valkey), object-idletime(3valkey), object-refcount(3valkey), persist(3valkey), pexpire(3valkey), pexpireat(3valkey), pexpiretime(3valkey), pttl(3valkey), randomkey(3valkey), rename(3valkey), renamenx(3valkey), restore(3valkey), scan(3valkey), sort(3valkey), sort_ro(3valkey), touch(3valkey), ttl(3valkey), type(3valkey), unlink(3valkey), wait(3valkey), waitaof(3valkey)
and that's the whole page, bestie!! this was DUMP(3valkey) from the 9.0.0 era, dated 2025-10-21 β go forth and serialize 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