Back to results for “Applications”
Redis › Strings & Bitmaps in Redis

What are practical real world applications where using bitmaps provides a significant memory advantage over alternative approaches like sets?

Advanced

Answer

Bitmaps excel at tracking simple binary states across a large number of sequential numeric identifiers, such as daily active users, feature flag enablement per user, or attendance tracking, where using a set to store the same information would require far more memory per tracked item, since a bitmap uses just a single bit per item rather than the overhead of a full set member entry.
-- Bitmap: 1 bit per user
SETBIT feature_enabled:new_ui 12345 1

-- Set: significantly more overhead per entry
SADD feature_enabled_users 'user12345'
Real-world example A feature flag system tracks which users have a new feature enabled using a bitmap indexed by user id, achieving dramatically lower memory usage compared to storing the same information as a set of individual user identifiers.

Common follow-ups: At what point does a bitmap's memory advantage over a set become less significant?;What are the limitations of using sequential numeric identifiers as bit positions?