Home > Java > javaTutorial > 5 powerful Java distributed caching framework recommendations

5 powerful Java distributed caching framework recommendations

Y2J
Release: 2017-04-18 14:11:57
Original
2481 people have browsed it

When developing medium and large Java software projects, many Java architects will encounter database read and write bottlenecks. If you do not take the caching strategy into consideration when building the system, or do not choose a better caching strategy, then It would be a nightmare to refactor. This article mainly shares 5 commonly used Java distributed caching frameworks. These caching frameworks support the cache read and write functions of multiple servers, making your caching system easier to expand.

1. Ehcache – Java distributed cache framework

Ehcache is an open source distributed cache framework implemented in Java. EhCache can effectively reduce the load of the database and allow data to be stored in The memory of different servers can be quickly accessed when data is needed. At the same time, EhCache extension is very simple, and there are several officially provided Cache configuration methods. You can configure it by declaring it, configuring it in xml, configuring it in the program, or passing in different parameters when calling the constructor method.

Ehcache has the following characteristics:

  • The access speed is very fast and the performance is very good .

  • A variety of caching strategies can be applied.

  • Hierarchical caching, users can specify which data is cached on the hard disk and which data is cached in the memory.

  • Distributed caching can be performed through RMI, pluggable API, etc.

  • Listening interface with cache and cache manager.

  • Supports multiple cache manager instances, as well as multiple cache areas for one instance.

  • The cache implementation of Hibernate is provided by default.

Ehcache configuration example code:

<ehcache>
 <diskStore path=”java.io.tmpdir”/>
 <defaultCache
 maxElementsInMemory=”10000″
 eternal=”false”
timeToIdleSeconds=”120″
 timeToLiveSeconds=”120″
 overflowToDisk=”true”
maxElementsOnDisk=”10000000″
 diskPersistent=”false”
diskExpiryThreadIntervalSeconds=”120″
 memoryStoreEvictionPolicy=”LRU”
/>
 </ehcache>
Copy after login

Among similar Java caching frameworks, Ehcache configuration is relatively simple and easy to get started. The maximum The advantage is that it supports distributed caching

The above is the detailed content of 5 powerful Java distributed caching framework recommendations. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template