Skip to content

Persistent Cache Implementation using RocksDB #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

darkmatter18
Copy link
Contributor

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Description

The Pull request implements Persistent Cache with RocksDB.

The implementation uses an in-memory cache mechanism using Caffeine and a Write-through persistent cache based on RocksDB.

Fixes

  1. When there are too many mutation events (more than cache.max.capacity) being "processed" in a very short period of time, this can occur on high loads on the in-memory cache, causing eviction and duplication in the data topic.
  2. When the connector restarts (manual restart operations or crashes) in between processing events arising from a single mutation, the data is wiped out from the in-memory cache but stays in the persistent cache.

What's added/changed

  • A new class named PersistentCache.java which implements the MutationCache.java interface, having the persistent cache implementation.
  • A new configuration named cache.persistent.directory to enable the persistent cache and set the cache directory at the same time.
  • Renamed the old MutationCache.java to InMemory.java, which has a non-persistent in-memory cache implementation.

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.

@darkmatter18
Copy link
Contributor Author

darkmatter18 commented Jul 28, 2025

Closing this PR as #198 has the same implementation.

@darkmatter18 darkmatter18 deleted the feature/persistent-cache branch July 28, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant