DUMP(3valkey)

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

πŸ’… 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. RESTORE makes 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 the valkey-pttl(7) PTTL command. 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:

RESP3

One of the following:


πŸ¦‹ 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