All eyes on AI: 2026 predictions – The shifts that will shape your stack.

Read now

Tutorial

Building a Popup Store application using Redis

February 26, 20264 minute read
Ajeet Raina
Ajeet Raina
TL;DR:
Build a real-time popup store with Redis by using Redis Streams for event-driven order processing, Redis time series for live analytics, and a Node.js backend to simulate customer traffic. Visualize the entire data pipeline in Grafana with the Redis Datasource plugin. Clone the repo and run docker-compose up to get started.
Pop-up stores are becoming a popular channel for retailers to create a new revenue stream, generate buzz with customers, test product concepts, or unload excess inventory. Since the idea is to spin up the store quickly and then close it shortly thereafter, it doesn't make sense to spend a lot of time on development. With the right Redis data structures, you can create a robust, real-time customer experience without a lot of development effort.

#What will you learn?

  • How to use Redis Streams for real-time event processing in an e-commerce scenario
  • How to track inventory and sales metrics with Redis time series
  • How to visualize a live data pipeline using Grafana and the Redis Datasource
  • How to process and complete orders in real time using stream consumers

#Prerequisites

#What is a popup store application?

This pop-up store demo illustrates a company that sells a single product and has 10,000 units available for purchase. Each customer can purchase one unit and the sale lasts only 10 minutes, so order processing must be instantaneous. The demo shows how to visualize a data pipeline in real time using Redis Streams, Redis time series, and Redis Datasource with Grafana.
Animated diagram showing the popup store data flow between Node.js, Redis Streams, time series, and Grafana
NOTE
This demo originally used RedisGears for stream processing. RedisGears has been deprecated and is no longer available as a standalone module. The stream processing concepts demonstrated here can be implemented using Redis triggers and functions or application-level stream consumers. The repository may require updates to run with current Redis versions.

#How do you clone and run the popup store?

#Step 1. Clone the repository

#Step 2. Run the application

#How do you access the Grafana dashboard?

Open http://localhost:3000 to access the Grafana dashboard.
Grafana dashboard for the popup store showing real-time inventory counts, order queues, and completed sales charts
Grafana queries Redis Streams and time series keys every 5 seconds to display live samples using the Grafana Redis Datasource. The dashboard displays:
  • Product Available: the value of the product key, which decreases as orders complete
  • Customers Ordering, Orders Processing, and Orders Completed: the length of queue:customers, queue:orders, and queue:complete streams
  • Customers Overflow: the difference between customer-submitted orders and orders completed
  • Customers Ordering: orders created in the last 5 seconds
  • Orders In Queue: orders waiting to be processed
  • Completed Flow: orders completed in the last 5 seconds

#How does the popup store architecture work?

Architecture diagram showing the popup store components: Node.js producer, Redis Streams for customer and order queues, time series for metrics, and Grafana for visualization
The application follows an event-driven architecture. The code samples below use the deprecated RedisGears API for reference; see the note above for modern alternatives.
  1. A Node.js script adds random data to the customers and orders streams, simulating flash sale traffic.
  2. A stream processor watches all queue: keys and adds time series samples for monitoring.
  1. Another stream processor completes orders by:
    • Adding data to the queue:complete stream
    • Deleting the client's ordering entry
    • Decreasing the product amount
    • Trimming the orders queue

#Next steps