Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commonly used caching frameworks in Java

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what are the commonly used caching frameworks in Java". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn which caching frameworks are commonly used in Java.

0x01:Ehcache

Ehcache is an open source distributed cache framework implemented by Java. EhCache can effectively reduce the load of the database, make the data stored in the memory of different servers, and can be accessed quickly when the data is needed. At the same time, the EhCache extension is very simple, and there are many official ways to configure Cache. You can declare a configuration, configure in xml, configure in a program, or pass in different parameters when a constructor is called.

Official website

Http://ehcache.org/

Ehcache has the following characteristics

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

Support the application of multiple caching strategies.

Hierarchical caching allows users to specify which data is cached on the hard disk and which data is cached in memory.

Distributed caching can be carried out through RMI, pluggable API, and so on.

A listening interface with cache and cache manager.

Support multiple cache manager instances, as well as multiple cache regions of an instance.

The cache implementation of Hibernate is provided by default.

0x02:Cacheonix

Cacheonix is also a distributed cluster cache system based on Java, which can also easily deploy distributed cache. As an open source distributed cache framework, Cacheonix can meet the system architecture of medium-sized enterprises and plays a great role in improving system performance.

Official website

Http://www.cacheonix.com/

Cacheonix has the following characteristics

Reliable distributed Java caching

High availability through replication

Cached API that supports generics

Can be integrated with ORM framework

Using data partitions to achieve load balancing

Support for non-multicast networks

High performance computing

Fast local Java caching

Distributed locking mechanism

0x03:JBoss Cache

JBoss Cache is a transaction caching system based on Java. Its goal is to build a cluster solution based on Java framework, which can be server application or Java SE application.

Official website

Http://jbosscache.jboss.org/

JBoss Cache has the following characteristics

Cluster high availability

JBoss Cache is a replicable Cache, and the state is always saved synchronously with other servers in the cluster. This allows any state stored in the JBoss Cache to be restored, even if the server crashes or restarts.

Cluster cache removes bottlenecks

JBoss Cache is designed to cache frequently accessed Java objects to dynamically improve application performance. This makes it easier to remove data access bottlenecks, such as database connections.

JBoss Cache instances pay close attention to the update and synchronization of remote Cache.

Enterprise level

JBoss Cache is an advanced, enterprise-class data grid solution that provides features such as transaction processing, recycling, and Cache loading.

License

JBoss Cache is based on the LGPL license and is 100% open source.

0x04:OSCache

OSCache is a widely used high-performance J2EE caching framework, and OSCache can be used for any Java application's common caching solution.

Official website

Http://www.opensymphony.com/oscache/

OSCache has the following characteristics

Cache any object. Some jsp pages or HTTP requests can be cached without restrictions, and any java object can be cached.

Has a comprehensive API. OSCache API provides a comprehensive program to control all OSCache features.

Permanent cache. The cache can be written to the hard disk at will, so it allows expensive expensive-to-create of data to maintain the cache and even allow applications to restart.

Clusters are supported. Cluster cache data can be individually configured without code modification.

Expiration of cache records -. You can greatly control the expiration of cached objects, including pluggable refresh strategies (if default performance is not required)

0x05:Memcached

Memcached is a memory-based key-value storage used to store small chunks of arbitrary data (strings, objects). This data can be the result of database calls, API calls, or page rendering. Memcached is simple and powerful. Its concise design facilitates rapid development, reduces the difficulty of development, and solves many problems of large amount of data cache. Its API is compatible with most popular development languages. In essence, it is a simple key-value storage system.

Official website:

Http://memcached.org/

Memcached has the following characteristics

Event handling based on libevent

Memcached distributed without communicating with each other

The protocol is simple

Built-in memory storage

0x06:J2Cache

J2Cache is the two-tier caching framework currently being used by OSChina. The first-level cache uses Ehcache and the second-level cache uses Redis. Because a large number of cache reads will cause the network of L2 to become the bottleneck of the whole system, the goal of L1 is to reduce the number of reads to L2. The caching framework is mainly used in cluster environment. Stand-alone can also be used to avoid Ehcache cache data loss caused by application restart.

Document

Https://www.oschina.net/doc/652

In addition, the code warehouse of J2Cache is on the cloud, so you can search it. Introduce in more detail

Https://my.oschina.net/javayou/blog/1931381

0x07:JetCache

JetCache is Ali's open source caching framework. JetCache is a java-based caching system encapsulation that provides unified API and annotations to simplify the use of caching. JetCache provides more powerful annotations than SpringCache, can natively support TTL, two-level cache, distributed automatic refresh, and provides a Cache interface for manual caching operations. There are currently four implementations, RedisCache, TairCache, CaffeineCache, and a simple LinkedHashMapCache, and it's easy to add new ones.

Official website

Https://github.com/alibaba/jetcache

JetCache has the following characteristics

Access the Cache system through a unified API

Implement declarative method caching through annotations

Create and configure Cache instances through annotations

Automatic statistics for all Cache instance and method caches

The generation policy of Key and the serialization policy of value can be configured.

Distributed cache automatic refresh, distributed lock

Asynchronous Cache API

Spring Boot support

Thank you for your reading, these are the contents of "what are the commonly used caching frameworks in Java". After the study of this article, I believe you have a deeper understanding of what the caching frameworks commonly used in Java have, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report