メインコンテンツまでスキップ

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.

CommandPurpose
BF.RESERVECreate a filter with a chosen capacity and false-positive rate.
BF.ADDAdd one item to a filter.
BF.MADDAdd multiple items to a filter.
BF.EXISTSCheck possible membership for one item.
BF.MEXISTSCheck possible membership for multiple items.
BF.INSERTAdd items with filter-creation options.
BF.INFOInspect filter properties and usage.
BF.CARDRead the number of items successfully added to a filter.

Further reading​