Redis Vs Memcached

Comparison IndexMemcachedRedis
What isMemcached is in-memory key-value store, originally intended for caching purpose.Redis is in-memory data structure store, used as database, cache and message broker.
DescriptionMemcacheD is easy, simply designed yet powerful. Its simple design promotes fast deployment, ease of exaggeration, and solves many problems related to large data caches. It has its inbuilt APIs which provide a very large hash table distributed across multiple machines & uses internal memory management to provide more efficiency. MemcacheD supports only String data type which are ideal for storing read-only data. Memcached is a volatile in-memory key-value origin. It is multi-threaded and used primarily for caching objects.Redis is an open source in-memory data structure store which also can be used as a database as well as caching. It supports almost all types of data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes through radius queries. Redis also can be used for messaging system used as pub/sub.
Primary database modelMemcached follows Key-value store database model.Redis also follows Key-value store database model.
Developed ByMemcached is developed by Danga Interactive.Redis is developed by Salvatore Sanfilippo.
Initial releaseMemcached was initially released in 2003.Redis was initially released in 2009.
Current releaseMemcached current version is 1.5.1, released in August 2017.Redis current version is 4.0.2, released in September 2017.
LicenseMemcached is free and open source.Redis is also free and open source.
Cloud-basedNoNo
Implementation languageMemcached is implemented in C language.Redis is also implemented in C language.
Server operating systemsFreeBSD Linux OS X Unix WindowsBSD Linux OS X Windows
Supported programming languages.Net, C, C++, ColdFusion, Erlang, Java, Lisp, Lua, OCaml, Perl, PHP, Python, RubyC,C#,C++, Clojure, Crystal, D, Dart, Elixir, Erlang, Fancy, Go, Haskell, Haxe, Java, JavaScript (Node.js), Lisp, Lua, MatLab, Objective-C, OCaml info, Perl, PHP, Prolog, Pure Data, Python, R, Rebol, Ruby, Rust, Scala, Scheme, Smalltalk, Tcl
Server-side scriptsNoLua
TriggersNoNo
Partitioning methodsNoneSharding
Replication methodsNoneMaster-slave replication
MapReduceNoNo
Foreign keysNoNo
Transaction conceptsNoOptimistic locking, atomic execution of commands blocks and scripts
ConcurrencyYesYes
DurabilityNoYes
User conceptsYesSimple password-based access control
InstallationMemcached is little bit complicated to install and run.Installing Redis is so much easier. No dependencies required.
Memory UsageMemcacheD is more memory efficient than Redis because it consumes comparatively less memory resources for metadata.Redis is more memory efficient, only after you use Redis hashes.
PersistenceMemcached doesn't use persistent data. While using Memcached, data might be lost with a restart and rebuilding cache is a costly process.Redis can handle persistent data. By default it syncs data to the disk at least every 2 seconds, offering optional & tuneable data persistence meant to bootstrap the cache after a planned shutdown or an unintentional failure. While we tend to regard the data in caches as volatile and transient, persisting data to disk can be quite valuable in caching scenarios.
ReplicationMemcached does not support replication.Redis supports master-slave replication.
Storage typeMemcacheD stores variables in its memory and retrieves any information directly from the server memory instead of hitting the database again.Redis is like a database that resides in memory. It executes (reads and writes) a key/value pair from its database to return the result set. That's why it is used by develepors for real-time metrics and analytics.
Execution Speed and PerformanceMemcacheD is very good to handle high traffic websites. It can read many information at a time and give you back at a great response time.Redis can neither handle high traffic on read nor heavy writes.
Data StructureMemcacheD uses only strings and integers in its data structure. So, everything you save can either be a string or an integer. It is complicated because with integers, the only data manipulation you can do is adding or subtracting them. If you need to save arrays or objects, you will have to serialize them first and then save them. To read them back, you will need to un-serialize.Redis has stronger data structures, which can handle not only strings integers but also binary-safe strings, lists of binary-safe strings, sets of binary-safe strings and sorted sets.
Key LengthMemcached's key length has a maximum of 250 bytes.Redis' key-length has a maximum of 2GB.





Latest Courses