Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 1.45 KB

2022-10-29-redis-stream-activity-feed.md

File metadata and controls

26 lines (19 loc) · 1.45 KB
title featured description image date_orig date draft tags
Redis Stream Activity Feed
false
I created a new Concept Project utilizing Redis Streams to create an Activity Feed
./../../assets/blog/photo-1474835409173-5dc81aae3faa.jpg
2022-10-29 21:13:43 -0400
2022-10-29
false
devops
github
redis

I recently built a demo project for the purpose of testing the usage of Redis as an activity feed of recent changes to a system. As the project this proof of concept already uses Redis in multiple capacities, we wanted to try to utilize it in this capacity to maintain the current dependency stack.

Redis Stream

I chose to use Redis Streams for multiple reasons:

  1. I can set a Maximum Length of the Stream.
  2. I select from the last ID natively with the Stream.
  3. A Redis Stream is Optimized for this exact use case.

The Project Overview

The project itself is in NextJS utilizing a single  API endpoint for the Redis Connection. I set up a POST action to add a new record to the Stream and a GET method to retrieve the latest items of the feed. A simple interface was developed to interact with the feed through the API endpoint.

You can check out the full concept project here: @CodeVachon/feed-testing