A behind-the-scenes look at how the service works, design decisions, and scalability considerations.
By @Meet Modi
TL;DR: An enterprise-grade email scheduling system designed to handle high-throughput campaigns. It uses an asynchronous worker architecture to decouple API ingestion from email delivery, ensuring strict rate limits and fault tolerance.
In a standard web server, sending an email is a "blocking" operation. It takes 1–3 seconds to handshake with an SMTP server.
Here is how the system handles scale:
1. Decoupling Ingestion from Delivery Sending emails is slow. Accepting requests should be fast. Instead of blocking the API, requests are instantly offloaded to a persistent Redis queue (BullMQ). The API responds in sub-50ms, while background workers churn through the queue asynchronously.
2. Handling the "Noisy Neighbor" Problem If one user schedules 10k emails, they shouldn't block everyone else. I enforced strict tenant isolation using atomic Redis counters and a Token Bucket strategy. If a limit is hit, the system doesn't drop the data, it intelligently calculates the backoff and auto-reschedules the job for the next window.
3. Real-Time Feedback I implemented Server-Sent Events (SSE) to push "Sent" updates to the dashboard instantly without inefficient polling.
