http://www.cnblogs.com/EE-NovRain/p/3268476.html
You should not care too much about performances. Redis is faster per core with small values, but memcached is able to use multiple cores with a single executable and TCP port without help from the client. Also memcached is faster with big values in the order of 100k. Redis recently improved a lot about big values (unstable branch) but still memcached is faster in this use case. The point here is: nor one or the other will likely going to be your bottleneck for the query-per-second they can deliver.
You should care about memory usage. For simple key-value pairs memcached is more memory efficient. If you use Redis hashes, Redis is more memory efficient. Depends on the use case.
You should care about persistence and replication, two features only available in Redis. Even if your goal is to build a cache it helps that after an upgrade or a reboot your data are still there.
You should care about the kind of operations you need. In Redis there are a lot of complex operations, even just considering the caching use case, you often can do a lot more in a single operation, without requiring data to be processed client side (a lot of I/O is sometimes needed). This operations are often as fast as plain GET and SET. So if you don’t need just GEt/SET but more complex things Redis can help a lot (think at timeline caching).
有網友翻譯如下[1]:
你需要關注記憶體使用率。對于key-value這樣簡單的資料儲存,memcache的記憶體使用率更高。如果采用hash結構,redis的記憶體使用率會更高。當然,這些都依賴于具體的應用場景。
你需要關注關注資料持久化和主從複制時,隻有redis擁有這兩個特性。如果你的目标是建構一個緩存在更新或者重新開機後之前的資料不會丢失的話,那也隻能選擇redis。
你應該關心你需要的操作。redis支援很多複雜的操作,甚至隻考慮記憶體的使用情況,在一個單一操作裡你常常可以做很多,而不需要将資料讀取到用戶端中(這樣會需要很多的IO操作)。這些複雜的操作基本上和純GET和POST操作一樣快,是以你不隻是需要GET/SET而是更多的操作時,redis會起很大的作用。
對于兩者的選擇還是要看具體的應用場景,如果需要緩存的資料隻是key-value這樣簡單的結構時,我在項目裡還是采用memcache,它也足夠的穩定可靠。如果涉及到存儲,排序等一系列複雜的操作時,毫無疑問選擇redis。
關于redis和memcache的不同,下面羅列了一些相關說法,供記錄:
redis和memecache的不同在于[2]:
1、存儲方式:
memecache 把資料全部存在記憶體之中,斷電後會挂掉,資料不能超過記憶體大小
redis有部份存在硬碟上,這樣能保證資料的持久性,支援資料的持久化(筆者注:有快照和AOF日志兩種持久化方式,在實際應用的時候,要特别注意配置檔案快照參數,要不就很有可能伺服器頻繁滿載做dump)。
2、資料支援類型:
redis在資料支援上要比memecache多的多。
3、使用底層模型不同:
新版本的redis直接自己建構了VM 機制 ,因為一般的系統調用系統函數的話,會浪費一定的時間去移動和請求。
4、運作環境不同: