How to utilize Redis Streams
Redis, the in-memory multi-model database, is popular for many use cases. These include content caching, session stores, real-time analytics, message brokering, and data streaming. Last year I blogged about how to utilize Redis Pub/Sub, Lists, and Sorted Sets for real-time stream processing. Now, with the arrival of Redis 5.0, Redis has a new information structure developed to managing streams.With the Redis
Streams information structure, you can do a lot more than what was possible with Pub/Sub, Lists, and Sorted Sets. Amongst the many advantages, Redis Streams allows you to do the following:
- Gather big volumes of information getting here in high speed (the only bottleneck is your network I/O);
- Develop a data channel in between lots of producers and many customers;
- Successfully manage your consumption of information even when producers and customers don’& rsquo; t run at the very same rate; Persist information when your customers are offline or detached;
- Interact between manufacturers and consumers asynchronously;
- Scale your number of consumers;
- Implement transaction-like data security when consumers stop working in the middle of consuming information; and
- Use your main memory efficiently.
The best part of Redis Streams is that it’& rsquo; s developed into Redis, so there are no additional steps needed to deploy or handle Redis Streams. In this post, I’& rsquo; ll walk you through the essentials of using Redis Streams. We’& rsquo; ll appearance at how we can add data to a stream, and how we can read that information (at one time, asynchronously, as it shows up, and so on) to please different consumer use cases.
Published at Wed, 14 Nov 2018 11:00:00 +0000