Redis v s memcache - rajansinghal/prep GitHub Wiki

Similarity in Memcache and Redis (aka Remote dictionary)

  • noSQL key-value in-memory data storage systems
  • open source
  • used to speed up applications
  • supported by the major cloud service providers

  MemCache Redis Comments
DataStructure String String, List, set, sorted set, hash etc
Persisiance Not supported AOF (append only file) The AOF Log stores all of these commands in the same format Redis receives them
      AOF log is better if data loss is not acceptable at all, as it can be updated at every command.
    RDB (redis db backup) full snapshot of the current Redis state by child process
      in Redis is too big, the RDB file will take some time to be created, which has an impact on the response time. On the other hand, it will be faster to load on boot up compared to the AOF log.
Data Eviction policies LRU NO EVECTION returning an error the memory limit is reached
    All keys LRU removing keys by the least recently used first
    VOLATILE LRU removing keys, that have an expiration time set by LRU
    All keys Random removing keys randomly
    Volatile random removing keys, that have an expiration time set, randomly
    VOLATILE TTL removing keys, that have an expiration time set,  by the shortest TTL first.
Multithreading Multi Singhle, (multi after Redis6)
Key Value 250 Bytes 512MB upto  
  1MB default value Value could be jpeg img
Replication supported by3rd  party s/w Natively  
Clustering Not supported nativley Redis cluster  
Use Case Extermley simple application, limited server, and only String representation    
Why Redis is Fast     Becoz, single threaded (using non blocking multiplexing IO , epool implementation)
⚠️ **GitHub.com Fallback** ⚠️