Skip to content

[performance] Add (optional) in-memory read cache #18

@hartmut-co-uk

Description

@hartmut-co-uk

Description

For event processing logic where you might read specific, or the most recent data often, an in-memory caching layer would be beneficial to improve the performance, lower the network IO, take load off the database.

Outline

  • optional, opt-in + config via builder
  • fully configurable (size-based eviction vs. time-based expiration, eviction policy, ...)
  • flag to enable/disable adding writes directly to the cache (vs. lazy load on read access)
  • (allow to enable/config metrics, optional)

Implementation

  • Proposed caching library to use: https://github.com/ben-manes/caffeine
  • To consider: impl. with JSR-107 JCache to allow to abstract & choose the caching lib to use
  • build in vs. using a wrapper
  • bundled in vs. separate library (~ CachingReadOnlyKeyValueStore wrapper ??)

Tasks

  • design
  • implementation
  • add unit tests
  • write documentation
  • create follow-up tasks

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions