tencent cloud

Tencent Cloud Distributed Cache (Redis OSS-Compatible)

Bloom Filter Module Family

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-08-11 11:12:00
AI 번역

Command Introduction

The Bloom Filter Module (valkey-bloom) provides a probabilistic data structure for efficiently determining whether an element may be present in a set. This module is suitable for big data scenarios such as cache penetration protection, URL deduplication, user recommendation deduplication, traffic anomaly detection, and real-time quantile monitoring. This module is supported starting from Valkey 8.0 and is not part of the Redis core command set.
BF.RESERVE: Creates a Bloom filter and specifies its capacity and error rate.
BF.ADD / BF.MADD: Adds a single element or multiple elements.
BF.EXISTS / BF.MEXISTS: Checks whether a single element or multiple elements may be present (a non-existent result is always correct, while a present result may be a false positive).
BF.CARD: Obtains an estimated number of the unique elements that have been added.
BF.INFO: Views information about the filter, such as its capacity, the number of elements added, and the error rate.
BF.INSERT: Creates a filter with initial elements, combining the features of RESERVE and ADD.
BF.LOAD: Is used for Bloom filter restoration during AOF rewriting.
For more information, see the Valkey official documentation: valkey-bloom module.

Command Support Overview

Basic Read/Write Commands: BF.ADD, BF.MADD, BF.EXISTS, BF.MEXISTS, and BF.CARD. These commands are used to add an element to a Bloom filter, add elements in batches, check whether an element exists, check for existence in batches, and obtain an estimated number of unique elements added. Both the Valkey 8.0 standard architecture and cluster architecture support them. Among these, BF.ADD and BF.MADD automatically create a filter with default parameters when the filter does not exist.
Filter Management Commands: BF.RESERVE, BF.INSERT, and BF.INFO. These commands are used to create an empty Bloom filter with specified attributes (where the error rate and capacity can be preset), create a filter with initial elements, and view the filter's usage information and attributes. Both the Valkey 8.0 standard architecture and cluster architecture support them.
Persistence Command: BF.LOAD. It is used for Bloom filter restoration during AOF rewriting. Both the Valkey 8.0 standard architecture and cluster architecture support it.
Cross-Slot Restriction: All Bloom Filter commands operate on a single Bloom filter key, adhere to the standard key routing rules, and have no cross-slot restriction.

Command Compatibility Matrix

Note:
The Bloom Filter Module is a Valkey-exclusive extension module and is not a Redis core feature. Therefore, it is not supported by any Redis edition. All commands operate on a single key. In a cluster architecture, they are distributed according to the standard key routing rules and have no cross-slot limitation.
Command
Valkey 9.0 Standard Architecture
Valkey 9.0 Cluster Architecture
Valkey 8.0 Standard Architecture
Valkey 8.0 Cluster Architecture
bf.add
bf.madd
bf.exists
bf.mexists
bf.card
bf.reserve
bf.insert
bf.info
bf.load

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백