apache / apache/kvrocks

Add TopK Probabilistic Data Structure

Open
#3,176 8 comments 0 reactions 1 assignee Claimed by @hidedim View on GitHub
enhancement
Dominant language
C++
Stars
4.4k
Forks
658
Avg merge
1d 20h
Merged PRs (30d)
10

Description

### Search before asking

- [ ] I had searched in the [issues](https://github.com/apache/kvrocks/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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.