Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-4212

Add a key-value store that is a TTL persistent cache

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.10.0.1
    • Fix Version/s: None
    • Component/s: streams
    • Labels:

      Description

      Some jobs needs to maintain as state a large set of key-values for some period of time. I.e. they need to maintain a TTL cache of values potentially larger than memory.

      Currently Kafka Streams provides non-windowed and windowed key-value stores. Neither is an exact fit to this use case.

      The RocksDBStore, a KeyValueStore, stores one value per key as required, but does not support expiration. The TTL option of RocksDB is explicitly not used.

      The RocksDBWindowsStore, a WindowsStore, can expire items via segment dropping, but it stores multiple items per key, based on their timestamp. But this store can be repurposed as a cache by fetching the items in reverse chronological order and returning the first item found.

      KAFKA-2594 introduced a fixed-capacity in-memory LRU caching store, but here we desire a variable-capacity memory-overflowing TTL caching store.

      Although RocksDBWindowsStore can be repurposed as a cache, it would be useful to have an official and proper TTL cache API and implementation.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                elevy Elias Levy
              • Votes:
                20 Vote for this issue
                Watchers:
                34 Start watching this issue

                Dates

                • Created:
                  Updated: