date: 2025-07-17
topics: [backend, nodejs, redis, bullmq, otp-auth, systemdesign]
day: 2
📘 Day 2 – Scalable OTP Email Verification System
✅ What I Worked On
- Designed & built DevFlow's OTP email verification system
- Used Redis to store hashed OTPs
- Used Bull Queue for async email delivery
- Wrote a full breakdown in my blog post
📚 What I Learned
- Using Redis as a fast key-value store with expiration logic
- Why email queues prevent user-facing lag
- Clean modularization of OTP functions:
generate
, store
, queue
, verify
- Bcrypt hashing for security, even for short-lived OTPs
❌ Blockers
- Bull worker needed retry configuration
- Redis connections maxed out during testing
🧠 Reflection
Felt like I built a real microservice system today — async, scalable, and clean. Redis + Bull made the flow smooth and queue-driven. This is what real backend dev is about.
🖼️ System Architecture

🔗 References / Code