Bloom module
Valkey Bloom provides compact filters for probabilistic membership checks. Use it to check whether an item might be present before consulting an exact data store.
Confirm the module configuration and required commands with your account support representative when arranging deployment with Momento Cache.
Features
- Add individual items or batches to a filter.
- Check possible membership for one or more items.
- Configure the false-positive rate and initial capacity when creating a filter.
Scaling filters can expand as you add items. Non-scaling filters have a fixed capacity and reject new item additions when full. Review capacity and scaling configuration with your support representative.
Membership results and use cases
A negative membership result means the item is absent from that filter. A positive result means the item might be present; false positives are possible. Verify positive results against authoritative data whenever you need an exact membership decision.
Skip exact lookups on negative results only when the filter contains every relevant item from your authoritative data store. For duplicate screening, treat a positive result as a duplicate candidate and verify it in your authoritative data store before discarding the item.
Key commands
Use these Valkey Bloom commands to identify the operations your application needs.
| Command | Purpose |
|---|---|
BF.RESERVE | Create a filter with a chosen capacity and false-positive rate. |
BF.ADD | Add one item to a filter. |
BF.MADD | Add multiple items to a filter. |
BF.EXISTS | Check possible membership for one item. |
BF.MEXISTS | Check possible membership for multiple items. |
BF.INSERT | Add items with filter-creation options. |
BF.INFO | Inspect filter properties and usage. |
BF.CARD | Read the number of items successfully added to a filter. |
Further reading
- Valkey Bloom overview: membership semantics and filter behavior.
- BF.RESERVE reference: false-positive rate, capacity, and scaling options.
- BF.EXISTS reference: membership results and false positives.
- BF.INFO reference: filter properties and usage.