Ehchache and Redis

Source: Internet
Author: User
Tags value store

Ehcache is widely used in Java projects. It is an open source, designed to increase the high cost of data removed from the RDBMS, high latency to take a caching scheme. Because Ehcache is robust (Java-based development), certified (with Apache 2.0 license), full of features (described later), it is used in various nodes of large, complex distributed Web application. 1. Fast Ehcache release for a long time, after several years of effort and countless performance tests, Ehcache was designed in large, high concurrency systems. 2. Simple enough for the developer to provide the interface is very simple and clear, from the Ehcache to the use of the operation only need to be your precious few minutes. In fact, many developers do not know that they are used in the use of Ehcache,ehcache is widely used in other open source projects such as: Hibernate 3. About this feature, the official gave a very cute name small foot print, The release version of General Ehcache will not be 668KB to 2m,v 2.2.3. 4. Light weight core program only relies on SLF4J this one package, not one! 5. Good extension Ehcache provides memory and hard disk storage for big data, most recent versions allow multiple instances, save objects with high flexibility, provide LRU, LFU, FIFO culling algorithms, base properties support thermal configuration, support plug-in more than 6. Listener Cache Manager Listener (Cachemanagerlistener) and Cache Listener (Cacheevenlistener), do some statistical or data consistency broadcast very useful how to use? Simple enough is a major feature of Ehcache, naturally used up just so easy! Redis Redis is written after memcache, we often compare the two, if it is a key-value store, but it has a rich data type, I want to temporarily call it the cache Data Flow Center, as the current logistics center, order, Package, store, classification, distribute, end. Now the popular lamp PHP architecture does not know the performance comparison with Redis+mysql or Redis + MongoDB (listen to people in the group that MongoDB Shard is unstable). Let's first talk about the characteristics of Reidis 1. Local persistence support for persistent Redis is supported in two ways: Rdb and aof. The RDB configures persistent triggers in the redis.conf configuration file, aof refers to theRedis does not add a record will be saved to the persistence file (save is the record of the build command), if not with Redis do not use the DB will not open aof, the data is too large, restart recovery is a huge project! 2. Rich data types Redis supports String, Lists, sets, sorted sets, hashes multiple data types, Sina Weibo will use Redis to do nosql mainly it has these types, time sequencing, functional sequencing, my Weibo, The features that are sent to me list and sorted set are closely related to the powerful operation of the 3. High performance this and memcache very much, the level of memory operation is the millisecond level than the hard disk operation of the second-level operation is naturally more efficient, less head seek, data read, page Exchange These high-overhead operations! This is why NoSQL comes out, it should be high-performance is based on RDBMS derivative products, although the RDBMS also has a cache structure, but always at the app level is not what we want to manipulate. 4.replication Redis provides a master-slave replication scheme, like MySQL incremental replication and replication of the implementation are very similar, this copy is a bit like aof copy is a new record command, the main library new records to send the new script to the slave library, from the library to generate records based on the script, the process is very fast, Just look at the network, the general master and slave are in the same LAN, so it can be said that Redis master-slave approximation in time synchronization, colleagues it also supports a master more from, dynamically added from the library, the number of libraries is not limited. Master-Slave Library building, I think the use of network mode, if using a chain (master-slave-slave-slave-slave If the first slave a downtime restart, first receive data recovery script from master, this is blocked, if the main library data a few terabytes recovery process will take some time, in this process other slave can not synchronize with the main library. 5. Update fast This seems to me that from my exposure to Redis so far has been issued a large version of 4, the small version has not been counted. Redis author is a very positive person, whether it is a mail question or forum post, he can promptly patiently answer for you, maintenance is very high. Someone to maintain, let us use also worry and rest assured. At present, the main development direction of Redis is the cluster direction of Redis. So if you want to simply use Ehcache, if the development task is more complex, want to get more support of what is Redis---------------------This article from the Rye Catcher _ Csdn blog, full-text address please click: 49131061?utm_ Source=copy

Ehchache and Redis

Related Article

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.