0

How redis performs below functionality internally.

  1. Memory Management: I know memcache does memory management using fixed size and frame and fixed sized slab inside frame.How different redis memory management is?
  2. For eviction memcache uses LRU .For this each memcache node has Map and Doubly linked list.On read write operation both data structure is accesses using global lock. Again how Redis perform this? As Redis in single threaded locking for these data structure would not be required.
Nishat
  • 711
  • 12
  • 28

1 Answers1

0

First of all I'll suggest you to go through this post. In that stackoverflow answer, you can see answer of your first point "Memory Management" along with many other detailed information. Rest for your second point, I would like to tell that you can check default configuration file of redis from where you can manage different available behaviours.

This snippet is mentioned in redis configuration file:

# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
# is reached. You can select among five behaviors:
#
# volatile-lru -> remove the key with an expire set using an LRU algorithm
# allkeys-lru -> remove any key according to the LRU algorithm
# volatile-random -> remove a random key with an expire set
# allkeys-random -> remove a random key, any key
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
# noeviction -> don't expire at all, just return an error on write operations

Hope that it will help you. Rest if I'm missing something then please update me with that.

Mayank Jain
  • 361
  • 4
  • 18