kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

Add TopK Probabilistic Data Structure

Open anupsingh3292 opened this issue 3 months ago • 2 comments

Search before asking

  • [ ] I had searched in the issues and found no similar issues.

Motivation

Hello Kvrocks Team,

I would like to request support for the TopK probabilistic data structure (similar to the RedisBloom module in Redis) in Kvrocks.

TopK is widely used for tracking the most frequent items in a stream of data with fixed memory usage — for example, trending items, top searches, or heavy-hitters analytics. Redis already provides this functionality via the RedisBloom module, and having native TopK support in Kvrocks would make it more suitable for large-scale analytics workloads.

Feature expectations:

  • Commands: all the possible cmd from redis topk module
  • Approximate top-K tracking with configurable width, depth, and decay parameters
  • Persistent storage in the RocksDB backend

Thank you for considering this feature. Kvrocks already provides excellent Redis-compatible features, and TopK would complement its existing probabilistic data structures (like Bloom filters and Count-Min Sketch) very well.

Solution

Redis topK : https://redis.io/docs/latest/develop/data-types/probabilistic/top-k/

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

anupsingh3292 avatar Sep 15 '25 20:09 anupsingh3292

I hope to complete this issue. Can you assign it to me.

hidedim avatar Oct 24 '25 09:10 hidedim

@hidedim Assigned, thank you!

git-hulk avatar Oct 24 '25 09:10 git-hulk