3 ms·
It is very good to see this article and Redis bitmaps exploited, since it is an extremely memory efficient way to store data, and given the encoding, it is extr
by antirez 15y ago
It is very good to see this article and Redis bitmaps exploited, since it is an extremely memory efficient way to store data, and given the encoding, it is extremely fast to also fetch big amount of information this way.
I really suggest to also looking at GETRANGE and SETRANGE operations that allow to access sub-ranges of a large bitmap fetching or setting arbitrary ranges fo bits.
Probably Lua scripting in 2.6 will enable a lot more interesting things combining server side execution and bitmaps. Thanks for sharing this work.
- jubos 15y agoJust curious, how does the Lua runtime perform with bitmap operations?
- deleted 15y ago[deleted]
- yesbabyyes 15y agoBitmaps surely seem usable in Redis today - how can you do AND, OR, XOR on Redis bitmaps in Lua? Also, will you create some kind of market for Redis scripts? That seems useful - even if it's just links to Github! ;)
- pjscott 15y agoFor example, with Lua scripting, you could add custom commands for working with Bloom filters, to do fast approximate set membership testing: http://en.wikipedia.org/wiki/Bloom_filter http://en.wikipedia.org/wiki/Bloom_filter I'm pretty excited about this.
- rubyorchard 15y agoGreat point and looking forward to Lua support in 2.6. GETRANGE and SETRANGE operations also allow buffered writes at the collection time because setting bit to 1 is an idempotent operation. They are particularly attractive in sharded environment where one can perform: WATCH bits = GETRANGE ... bits = bits | buffered_bits MULTI SETRANGE .... bits EXEC
- pbrumm 15y agoIt would be really cool if redis supported the ability to count the high bits in a string as a native command. No need to pull a 16k string down to client Although it is another command in a growing list of them. maybe something for lua.
- pjscott 15y agoThis is something that should probably be implemented natively, for speed. Preferably with GCC's __builtin_popcount intrinsic, if it's available.