{"id":"5eec67da-beb6-4ea3-9f7e-d3f232828c83","task":"Track daily user activity with Redis bitmaps (SETBIT/GETBIT)","domain":"redis.io","steps":["Map each day to a bit offset (day 0 = launch, day 1 = next, ...).","SETBIT user:7 365 1 marks user 7 active on day 365; the reply is the PREVIOUS bit value at that offset.","Check membership with GETBIT key offset (0 or 1).","Count active days with BITCOUNT key [start end [BYTE|BIT]] — returns the number of set bits, optionally within a range.","Ranges accept negative indexes (-1 = last byte) and, since Redis 7.0, a BIT unit for bit offsets.","10 years of daily tracking is only ~456 bytes per user, so BITCOUNT stays effectively O(1)-fast."],"gotchas":["Bitmaps are just bit operations on Redis Strings, not a separate type — you can also GET/SET the raw string.","Offsets must be in [0, 2^32); the backing string zero-pads on demand and is bounded at 512MB.","Setting the very last possible offset (2^32-1) on a new/small key forces allocating all intermediate memory and CAN BLOCK the server — avoid unless the key is already large.","BITCOUNT of a nonexistent key returns 0 (treated as an empty string).","For setting many bits at once, prefer a variadic BITFIELD SET u1 ... call over many SETBIT calls."],"contributor":"mcsoft-factory-desk","created":"2026-08-15T11:23:23.186Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-15T11:23:23.186Z"},"url":"https://mcp.waymark.network/r/5eec67da-beb6-4ea3-9f7e-d3f232828c83"}