Redsi and memcached Difference summary

Source: Internet
Author: User
Tags memcached cpu usage

  1. First of all, the Redis and memcached are all cached in memory, and the only difference is that Redis itself periodically writes some updated data to the disk or modifies it to the appended record file, and implements Master-slave master-slave synchronization on this basis.
  2. As far as performance is concerned, Redis is a high-performance Key-value memory database. Official Performance Test results: Set operation 110,000 times per second, get operation 81,000 times per second
  3. Redis itself supports a relatively large number of data types, including string, list, set (set), Zset (ordered collection).
  4. Redis data persistence is mainly a snapshot and aof log two durable ways, in practical applications, it is important to pay attention to the parameters of the profile snapshot, to prevent frequent dump.
  5. Memcachedis a high-performance distributed memory cache server, which can improve the speed and scalability of applications such as dynamic Web by caching database query results and reducing database access times.
      1. memcached features as a distributed cache server:                         &NBS P                          ,         &NB Sp                                 
      2. protocol Simple
      3. Libvent-based event handling
      4. internal memory storage
      5. memcached distributed without communication
      6. MEMCA Ched the default support for the largest storage object is 1M. This value is determined by its memory allocation mechanism. (It uses the slab allocator mechanism to allocate and manage memory by default.)
      7. memcached set data is the default compressed
      8. Business scenario for memcached:
        1. A Dynamic Web page with very high site traffic. Because most data requests are read, memcached can effectively reduce the load on the database.
        2. assumes that the load on the database server is low but the CPU usage is very high, so that the computed results (computed objects) and the rendered page template (enderred templates) can be cached. The
        3. caches some files that are very small but frequently accessed.
      9. memcached can accept the maximum length of a key is 250 characters
  6. redis 
    1. Redis as a high-performance Key-value database has the following characteristics
      1. diversification
      2. Persistence
      3. li> master-Slave sync                                 &N Bsp                          ,         &NB Sp                 
    2. Redis supports a wide variety of data types, typically five: String, Hash, L ist, Set, and Sorted set. Redis typically stores data in memory or is configured to use virtual memory. One of the most important features of Redis is that it can implement persistent data, which can be persisted in two ways: using an Rdb snapshot to keep the in-memory data written to disk, or logging each update with a aof log method like MySQL. The former performance is high, but may cause some degree of data loss; the latter is the opposite. Redis supports synchronizing data to multiple slave databases, a feature that is useful for improving read performance.
  7. A place of careful attention
    1. Memcached single Key-value size is limited, one value Max supports only 1MB, and Redis supports 512MB maximum
    2. Memcached is simply a memory cache that requires little reliability, and Redis prefers a memory database, so the reliability requirements are high
    3. In essence, memcached is just a single key-value memory cache, and Redis is a data structure memory database that supports five data types, so Redis has a simple cache and can handle some simpler logic, and it can also be used as a database
    4. The new version (3.0) of Redis refers to the cluster distributed, that is, the cluster itself balanced client requests, each node can communicate, can expand line, maintainability more powerful.

      

Redsi and memcached Difference summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.