O'Reilly logo

Mastering Redis by Jeremy Nelson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating memory efficient Redis data structures

The following are some of the methods for memory optimization in Redis:

Small aggregate hashes, lists, sets, and sorted sets

For hashes, lists, and sorted sets, this special encoding is based on ziplist A Ziplist is described from ziplist.c as follows:

The ziplist is a specially encoded dually linked list that is designed to be very memory efficient. It stores both strings and integer values, where integers are encoded as actual integers instead of a series of characters. It allows push and pop operations on either side of the list in O(1) time. However, because every operation requires a reallocation of the memory used by the ziplist, the actual complexity is related to the amount of memory used by ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required