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 ...

Get Mastering Redis now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.