EngineeringReliabilityCloudflare

How HuskMail Stays Online: The Cloudflare Architecture

The Cloudflare-based architecture that keeps HuskMail reliable, low-latency, and resistant to single-point failures.

7 min readBy the HuskMail team

A temp-mail service has exactly one job to do well: be there when you paste an address into a signup form and need the verification code to land in seconds. If the inbox is down, slow, or unreliable, the entire service is worthless — you've already given out the address, and you can't get the code.

This post walks through how HuskMail is built, why it's resilient to the kinds of failures that take down typical temp-mail services, and what tradeoffs we accept to keep the system simple and cheap to run.

The infrastructure: 100% on Cloudflare

HuskMail runs end-to-end on Cloudflare. No third-party VPS, no AWS region, no separate mail server. Every component runs on Cloudflare's global edge network — the same one that fronts roughly 20% of the internet.

Email Routing — the front door

Inbound mail to *@huskmail.space hits Cloudflare Email Routing, an enterprise-grade SMTP receiver that handles authentication (SPF, DKIM, DMARC), spam filtering, and message parsing. From there, each accepted message is dispatched to a Cloudflare Worker we control.

What this means in practice: even if the HuskMail web app or API were briefly down, inbound mail would still be accepted by Cloudflare and processed moments later when the worker came back online. Messages are never lost in transit.

Workers — the API and email handler

All of HuskMail's logic — creating inboxes, serving the dashboard API, parsing incoming emails, extracting OTP codes and trial dates, signing JWTs — runs in Cloudflare Workers. Workers execute at over 300 edge locations globally, which means your request is handled by the data center physically closest to you, not by a server in a single region.

There is no single application server to crash, no "us-east-1 outage" to wait through. If one edge location has issues, Cloudflare automatically routes around it.

D1 — the database

Account records, messages, and verification codes are stored in Cloudflare D1, a globally-replicated SQLite database. D1's primary copy lives in one region (Cloudflare picks the optimal one), but reads can be served from edge replicas, which keeps the dashboard responsive worldwide.

R2 — attachments

Email attachments (PDFs, images, etc.) are written to Cloudflare R2, an S3-compatible object store with no egress fees. Pro users can download the original attachment bytes directly from R2, served through the same Workers API for access control.

Why this matters — three concrete reliability wins

  1. No single point of failure. Email Routing, Workers, D1, and R2 are independent services, each with their own redundancy. Even an outage in one (rare) only degrades part of the experience temporarily — incoming mail is still queued.
  2. Global low latency. Because everything runs at the edge, both the web dashboard and the message-arrival notification are typically delivered in under 50 ms from wherever you are.
  3. No scaling work as we grow. Workers automatically scale from 0 requests to millions per second. We don't have to provision capacity ahead of a traffic spike, so there's no point at which the service falls over because too many people showed up at once.

What we monitor

We run a continuous health-check dashboard against the live production deployment that tracks:

  • API worker response time and error rate
  • Database query latency (P50 and P99)
  • Time since the last accepted inbound email (catches silent failures)
  • Time since the last successful billing webhook
  • Rate-limit hits in the last 24h

Any number that crosses an unhealthy threshold turns red — and we see it. The goal is to discover problems before customers do, not after they email support.

What we don't claim

HuskMail is a young product. We don't quote a "99.99% uptime SLA" because we don't have months of production data to back that claim up yet, and we'd rather under-promise than oversell. What we can say is that the infrastructure underneath us consistently runs at 4-nines reliability, and we don't add anything on top that would meaningfully degrade that.

What you can do if HuskMail ever fails you

Save your inbox password somewhere safe. As long as you can log back in, your messages — including verification codes — are still in the database and accessible from any device. If you ever can't reach the site, mail us at support@huskmail.space.

Related reading

Open a HuskMail inbox

Free, no signup, no card. Fresh address in two seconds.

Open a temp inbox