SAVE(3valkey)

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

πŸ’Ύ SAVE (3valkey) β€” bestie, we're writing to DISK πŸ’Ύ

okay so bestie, this is the SAVE command from the Valkey Command Manual, and she is not subtle. no flags, no options, no little garnish β€” just vibes and a full sync dump. let's get into it 🫢


✨ NAME ✨

save β€” synchronously saves the database(s) to disk.

like. synchronously. as in, she blocks. as in, everyone waits for her. main character energy fr fr πŸ’…


✨ SYNOPSIS ✨

SAVE

that's it. that's the whole thing. no args, no keys, no nothing. she simply is πŸŽ€


✨ DESCRIPTION ✨

okay so here's the tea 🍡

The SAVE command performs a synchronous save of the dataset, producing a point in time snapshot of all the data inside the Valkey instance, in the form of an RDB file. so like, everything you've got in there? frozen in time, written out to an RDB file. iconic honestly ⭐

now the part you actually need to hear:

You almost never want to call SAVE in production environments, because it will block all the other clients. not "slow them down a little". block. them. all. 😭

instead, usually valkey-bgsave(7) BGSAVE is used β€” that's the girl who does it in the background while everybody else keeps living their lives. much more considerate, we love her πŸ’–

however β€” and this is the plot twist β€” in case of issues preventing Valkey to create the background saving child (for instance errors in the fork(2) system call), the SAVE command can be a good last resort to perform the dump of the latest dataset. so when BGSAVE literally cannot, SAVE steps in like the emergency contact she is πŸ”₯

Please refer to the persistence documentation for detailed information. (go read it bestie, it's giving necessary context) πŸ“–


✨ REPLY ✨

valkey-protocol(7) Simple string reply: OK.

just OK. no essay, no drama, just OK. she ate and left no crumbs ✨


✨ COMPLEXITY ✨

O(N) where N is the total number of keys in all databases

so the more keys you have, the longer this takes. big dataset = long wait. plan accordingly bestie πŸ¦‹


✨ ACL CATEGORIES ✨

  • @admin
  • @dangerous
  • @slow

three whole categories and every single one of them is a warning label. @dangerous AND @slow?? she's not even hiding it πŸ’€


✨ HISTORY ✨

  • Available since: 1.0.0

she's been here since the very beginning. an OG. a legend. a founding mother πŸ‘‘


✨ SEE ALSO ✨

go read these too, they're all in the family 🫢

acl(3valkey), acl-cat(3valkey), acl-deluser(3valkey), acl-dryrun(3valkey), acl-genpass(3valkey), acl-getuser(3valkey), acl-help(3valkey), acl-list(3valkey), acl-load(3valkey), acl-log(3valkey), acl-save(3valkey), acl-setuser(3valkey), acl-users(3valkey), acl-whoami(3valkey), bgrewriteaof(3valkey), bgsave(3valkey), command(3valkey), command-count(3valkey), command-docs(3valkey), command-getkeys(3valkey), command-getkeysandflags(3valkey), command-help(3valkey), command-info(3valkey), command-list(3valkey), commandlog(3valkey), commandlog-get(3valkey), commandlog-help(3valkey), commandlog-len(3valkey), commandlog-reset(3valkey), config(3valkey), config-get(3valkey), config-help(3valkey), config-resetstat(3valkey), config-rewrite(3valkey), config-set(3valkey), dbsize(3valkey), debug(3valkey), failover(3valkey), flushall(3valkey), flushdb(3valkey), info(3valkey), lastsave(3valkey), latency(3valkey), latency-doctor(3valkey), latency-graph(3valkey), latency-help(3valkey), latency-histogram(3valkey), latency-history(3valkey), latency-latest(3valkey), latency-reset(3valkey), lolwut(3valkey), memory(3valkey), memory-doctor(3valkey), memory-help(3valkey), memory-malloc-stats(3valkey), memory-purge(3valkey), memory-stats(3valkey), memory-usage(3valkey), module(3valkey), module-help(3valkey), module-list(3valkey), module-load(3valkey), module-loadex(3valkey), module-unload(3valkey), monitor(3valkey), psync(3valkey), replconf(3valkey), replicaof(3valkey), restore-asking(3valkey), role(3valkey), shutdown(3valkey), slowlog(3valkey), slowlog-get(3valkey), slowlog-help(3valkey), slowlog-len(3valkey), slowlog-reset(3valkey), swapdb(3valkey), sync(3valkey), time(3valkey)


and that's the whole page bestie!! πŸ’–

this lil masterpiece is from Valkey 9.0.0, dated 2025-10-21, and it lives at SAVE(3valkey). go forth, save responsibly, and please please please use BGSAVE in prod πŸ™ˆπŸ’œ

πŸ“¦ where this page comes from