Redis variety of data structures, for a variety of different scenarios.
1. Redis as cache
Redis string, a hash table data structure suitable for storing two kinds of a large number of key information, thereby realizing the cache.
2. Use Redis do queue
Several multiple Redis queue data structure suitable for making:
• Use the "list" data structure, you can achieve general and priority queue function.
• Use the "ordered set" data structures can be implemented priority queue: using the "hash table" data structure, you can achieve the delay queue.
3. to re-use Redis
Redis how several data structures adapted to make weight:
• Use "Set" data structure, small quantities of data deduplication:
Using the bit operation "string" data structure, a Bloom filter can be implemented in order to achieve large scale data
Deduplication:
• use Redis comes HyperLogLog data structures can be implemented to re-count and ultra-large-scale data.
4. Redis implemented Scoreboard
Redis of "ordered set" function can be achieved Scoreboard function, can automatically sort, the ranking function.
5. Use Redis achieve "publish / subscribe" feature
Redis comes with the "publish / subscribe" model can achieve many to many "publish / subscribe" feature