Company
Date Published
Author
Redis
Word count
799
Language
English
Hacker News points
None

Summary

Redis 4.0 introduced Modules, a significant shift in the Redis ecosystem, but also brought an important new command called UNLINK, which provides a game-changing solution for deleting large keys without tying up the entire server. Until now, deleting large keys with DEL could take a long time due to single-threadedness and memory deallocation, but UNLINK removes the key from the keyspace in one thread and starts reclaiming memory in another, resulting in much faster performance, especially for big values. While there are some edge cases where DEL might be preferred, UNLINK is generally recommended as it provides more consistent behavior and better overall performance with only a small code change required to replace existing DEL commands with UNLINKs.