이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 1. Data Grid Caches


Data Grid caches provide flexible, in-memory data stores that you can configure to suit use cases such as:

  • boosting application performance with high-speed local caches.
  • optimizing databases by decreasing the volume of write operations.
  • providing resiliency and durability for consistent data across clusters.

1.1. Cache Interface

Cache<K,​V> is the central interface for Data Grid and extends java.util.concurrent.ConcurrentMap.

Cache entries are highly concurrent data structures in key:value format that support a wide and configurable range of data types, from simple strings to much more complex objects.

1.2. Cache Managers

Data Grid provides a CacheManager interface that lets you create, modify, and manage local or clustered caches. Cache Managers are the starting point for using Data Grid caches.

There are two CacheManager implementations:

EmbeddedCacheManager
Entry point for caches when running Data Grid inside the same Java Virtual Machine (JVM) as the client application, which is also known as Library Mode.
RemoteCacheManager
Entry point for caches when running Data Grid as a remote server in its own JVM. When it starts running, RemoteCacheManager establishes a persistent TCP connection to a Hot Rod endpoint on a Data Grid server.
Note

Both embedded and remote CacheManager implementations share some methods and properties. However, semantic differences do exist between EmbeddedCacheManager and RemoteCacheManager.

1.3. Cache Containers

Cache containers declare one or more local or clustered caches that a Cache Manager controls.

Cache container declaration

<cache-container name="clustered" default-cache="default">
  ...
</cache-container>
Copy to Clipboard Toggle word wrap

1.4. Cache Modes

Tip

Data Grid Cache Managers can create and control multiple caches that use different modes. For example, you can use the same Cache Manager for local caches, distributes caches, and caches with invalidation mode.

Local Caches
Data Grid runs as a single node and never replicates read or write operations on cache entries.
Clustered Caches
Data Grid instances running on the same network can automatically discover each other and form clusters to handle cache operations.
Invalidation Mode
Rather than replicating cache entries across the cluster, Data Grid evicts stale data from all nodes whenever operations modify entries in the cache. Data Grid performs local read operations only.
Replicated Caches
Data Grid replicates each cache entry on all nodes and performs local read operations only.
Distributed Caches
Data Grid stores cache entries across a subset of nodes and assigns entries to fixed owner nodes. Data Grid requests read operations from owner nodes to ensure it returns the correct value.
Scattered Caches
Data Grid stores cache entries across a subset of nodes. By default Data Grid assigns a primary owner and a backup owner to each cache entry in scattered caches. Data Grid assigns primary owners in the same way as with distributed caches, while backup owners are always the nodes that initiate the write operations. Data Grid requests read operations from at least one owner node to ensure it returns the correct value.

1.4.1. Cache Mode Comparison

The cache mode that you should choose depends on the qualities and guarantees you need for your data.

The following table summarizes the primary differences between cache modes:

Expand
Cache modeClustered?Read performanceWrite performanceCapacityAvailabilityCapabilities

Local

No

High (local)

High (local)

Single node

Single node

Complete

Simple

No

Highest (local)

Highest (local)

Single node

Single node

Partial: no transactions, persistence, or indexing.

Invalidation

Yes

High (local)

Low (all nodes, no data)

Single node

Single node

Partial: no indexing.

Replicated

Yes

High (local)

Lowest (all nodes)

Smallest node

All nodes

Complete

Distributed

Yes

Medium (owners)

Medium (owner nodes)

Sum of all nodes capacity divided by the number of owners.

Owner nodes

Complete

Scattered

Yes

Medium (primary)

Higher (single RPC)

Sum of all nodes capacity divided by 2.

Owner nodes

Partial: no transactions.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat