Gigi
Gigi

Reputation: 29421

Redis vs MemoryCache

Redis is often used as a cache, although it offers a lot more than just in-memory caching (it supports persistence, for instance).

What are the reasons why one would choose to use Redis rather than the .NET MemoryCache? Persistence and data types (other than key-value pairs) come to mind, but I'm sure there must be other reasons for using an extra architectural layer (i.e. Redis).

Upvotes: 36

Views: 20495

Answers (1)

DhruvPathak
DhruvPathak

Reputation: 43235

MemoryCache is embedded in the process, hence can only be used as a plain key-value store from that process. A separate server counterpart of MemoryCache would be memcached.

Whereas redis is a data structure server which can be hosted on other servers and can be interacted with over the network just like memcached, but redis supports a long list of complex data types and operations on them, to provide logical and intelligent caching.

Upvotes: 37

Related Questions