This content originally appeared on DEV Community and was authored by Jonathan Ato Markin
This is a submission for the Redis AI Challenge: Beyond the Cache.
What I Built
In today’s connected world, monitoring critical infrastructure like water systems, power grids, or server farms is a monumental task. A single failure can be catastrophic. The challenge is detecting problems the instant they occur, not minutes later when a traditional database finally runs its report.
I built FastMap, a real-time anomaly detection platform for large-scale sensor networks. It provides a live map-based dashboard where operators can monitor thousands of IoT sensors at a glance. When a sensor reports an anomalous value, like a sudden pressure spike or temperature drop, FastMap identifies it in milliseconds and instantly flags the sensor on the map, allowing for immediate intervention.
The entire application is powered exclusively by Redis, which acts as the high-speed data ingestion layer, the real-time AI/ML feature store, the multi-model primary database, and the real-time notification engine all in one.
Demo
Here is a live demonstration of FastMap in action. You can see the real-time updates as sensors report data and anomalies are triggered.
- Video Demo: FastMap Demo Video
- Source Code: FastMap Redis Github
How I Used Redis 8
For FastMap, Redis wasn’t just a cache; it was the single source of truth and the engine for the entire application. I combined multiple Redis data models to build a robust system without needing a separate relational or NoSQL database.
-
Primary Database:
- Redis Streams: The front door for all incoming data, providing a durable, scalable log for our high-throughput sensor network.
- RedisJSON: Used to store rich, structured metadata for each sensor, including its location, type, and operational parameters. Querying this data was flexible and intuitive.
- Redis TimeSeries: To store historical readings for every sensor, allowing for efficient time-range queries, aggregations, and future trend analysis—all natively within Redis.
- Redis Hashes: For storing the volatile, high-access “current state” of each sensor (e.g., status: ‘ANOMALY’), enabling lightning-fast lookups for the dashboard.
-
Real-Time Messaging:
- Redis Pub/Sub: When an anomaly was detected, a message was published to a Pub/Sub channel. This decoupled the backend logic from the frontend dashboard, allowing us to broadcast alerts to all connected users instantly with minimal overhead.
This multi-model approach, all within a single Redis instance, demonstrates its incredible power and versatility as a complete, real-time data platform.
This content originally appeared on DEV Community and was authored by Jonathan Ato Markin