Hi everyone,
This is my submission for the Dev.to Redis Challenge. I've built AidBridge, a real-time emergency response system designed to streamline reporting and managing disaster-related emergencies. The core idea was to showcase the power and versatility of Redis as the central data engine.
GitHub Repo: https://github.com/tenzinl4ma/aidbridge
What I Built
AidBridge is a web application with two main parts:
1. Emergency Reporting Interface
A simple form where people affected by a disaster can submit:
- A short message describing the emergency
- Their location
- Optional contact information
2. Emergency Response Dashboard
A dashboard for responders featuring:
- Real-time Feed — Live incoming reports
- Full-Text Search — Query emergencies by keyword
- AI Pattern Analysis — Automatically matches similar past emergencies
- Cache Performance Monitoring — Displays Redis-based AI cache stats
Demo: https://youtu.be/QSXJDcUzshc
How I Used Redis
Redis is the entire backend. It handles real-time streams, full-text search, structured storage, semantic vector matching, AI caching, and usage analytics — all without needing any external systems.
Redis Streams (emergencies
)
Why: Fast ingestion and real-time display of new reports
How: New reports are added to the stream; dashboard reads with XREVRANGE
Benefit: Ideal for displaying a time-ordered event feed
Redis JSON (emergency:<request_id>
)
Why: Structured storage for emergency data and AI analysis
How: Complete emergency objects stored as JSON
Benefit: Supports nested structured data, queryable via RedisJSON
RediSearch (idx:emergencies
)
Why: Full-text and field-specific search
How: Index on Redis JSON keys; search via FT.SEARCH
Benefit: Enables rapid querying of emergency content
Redis Hashes (emergency:<request_id>:vector
)
Why: Store vector embeddings for semantic similarity
How: SentenceTransformer encodes text to a vector, saved as Redis Hash
Benefit: Enables contextual similarity comparison
Redis Semantic Cache (ai_cache:<hash>
)
Why: Reduce repeated AI API usage
How: Hash of input checked before calling AI; result stored with TTL
Benefit: Improves speed and efficiency, reduces cost
Redis Stats Counters
Why: Monitor AI cache effectiveness
How: Keys like ai_cache_hits
and ai_cache_misses
incremented with INCR
Benefit: Enables real-time tracking of cache usage stats
Redis Modules and Features Summary
Feature | Purpose |
---|---|
Redis Streams | Real-time ingestion and feed display |
Redis JSON | Structured emergency + AI data storage |
RediSearch | Fast full-text and keyword search |
Redis Hashes | Store and retrieve vector embeddings |
Keys with TTL | Cache AI outputs with expiration |
Redis Counters | Track AI cache hit/miss performance |
Summary
AidBridge is a fully Redis-powered application. Redis handles everything—real-time data flow, semantic search, structured storage, caching, and monitoring—without needing any external database. This project demonstrates that Redis can serve as a complete, production-grade backend for modern apps.
Thanks for reading.
Repository: https://github.com/tenzinl4ma/aidbridge
Top comments (0)