MicroStream Reference Manual
MicroStream HomeAPI Docs
4.0
4.0
  • Preface
  • System Requirements
  • License
  • Changelog
  • Installation
  • Data-Store
    • Overview
    • Getting Started
    • Root Instances
    • Configuration
      • Properties
      • Storage Files and Directories
      • Using Channels
      • Housekeeping
      • Backup
      • Lock File
    • Storage Targets
      • Local File System
      • SQL Databases
        • Oracle
        • MySQL
        • SQLite
      • Blob Stores
        • Oracle Cloud
        • Oracle NoSQL
        • Coherence
    • Storing Data
      • Convenience Methods and Explicit Storing (Transactions)
      • Lazy and Eager Storing
      • Transient Fields
      • Best Practice
    • Loading Data
      • Lazy Loading
        • Touched Timestamp, Null-Safe Variant
        • Clearing Lazy References
    • Deleting Data
    • Queries
    • Application Life-Cycle
    • Legacy Type Mapping
      • User Interaction
    • Backup Strategies
    • Import / Export
    • Housekeeping
    • Customizing
      • Custom Type Handler
      • Custom Legacy Type Handler
      • Custom Class Loader
      • Custom Storing Behavior
      • Optional Storage Manager Reference in Entities
    • REST Interface
      • Setup
      • REST API
      • Client GUI
    • FAQ
      • Data Model
      • Data Management
      • File Storage
      • Java Features
      • Miscellaneous
    • Addendum
      • Supported Java Features
      • Specialized Type Handlers
      • Examples and Demo Projects
  • Cache
    • Overview
    • Getting Started
    • Configuration
      • Properties
      • Storage
    • Use Cases
      • Hibernate Second Level Cache
      • Spring Cache
  • Basic Concepts
    • Layered Entities
      • Configuration
      • Defining Entities
      • Creating Entities
      • Updating Entities
      • Versioning
      • Logging
      • Multiple Layers
    • Wrapping
      • Configuration
      • Usage
Powered by GitBook
On this page
  • Motivation
  • Basic Concepts of JCache
Export as PDF
  1. Cache

Overview

PreviousExamples and Demo ProjectsNextGetting Started

Last updated 3 years ago

This is the manual for older MicroStream versions (Version < 5.0).

The new documentation (Version >= 5.0) is located at:

Since version 3 MicroStream provides a JCache () implementation, which is optionally backed by the MicroStream Storage.

JCache standardizes caching for the Java platform. It provides a common mechanism to cache values in a map-like structure. It expedites the mainstream adoption of in-memory computing by giving all Java developers an easy way to access memory from within Java. Businesses can change providers without rewriting their applications or maintaining a proprietary cache abstraction layer.

This caching standard is used in a wide variety of environments. The most common use cases are:

  • Second-level cache in JPA (e.g. )

  • and many more

Motivation

Why another JCache implementation, you may wonder. There is already a myriad of providers out there. MicroStream's very own serialization and storage can be utilized to get the best out of caches. For example you are not limited to java.io.Serializable types, when storing by value. That means every key-value pair gets copied every time you put and get entries in and out of a cache. And if a cache is used with a backing store, MicroStream's storage can be used to get the best possible performance.

And now, MicroStream being a JCache provider, you can use it as a drop-in replacement in your existing application.

Basic Concepts of JCache

CachingProvider

The caching provider represents the implementation of JCache that you are using. You can use more than one JCache implementation in your project if you wish, and CachingProvider is how you access the different providers that are in use.

CacheManager

It is responsible for managing and providing access to many named caches.

Cache

The cache holds the different values being cached. You can have several caches, each of which may be holding data for a different purpose. Each one can have a different configuration; for example, different caches may evict old data using different techniques.

Entry

Each item of data in a cache is an entry, which is a key-value pair. The key is a unique value used to store and look up the data. The value is the actual data you wish to cache. Caches have some different properties than Maps, but the calls that you would use to store and lookup data is very similar.

https://docs.microstream.one/
JSR-107
Hibernate
Spring Cache Abstraction