Engineering

Why we built InboxFlow on Rust + Cloudflare

Thulasi Ram8 min read

When we set out to build InboxFlow, we knew we needed to make a choice that would define the next decade of our infrastructure. Email delivery is infrastructure — it needs to be fast, reliable, and cost-effective at enormous scale.

After extensive evaluation, we chose Rust + the Cloudflare ecosystem as our foundation. Here's why.

The cost problem with legacy providers

Legacy email providers like SendGrid, Mailgun, and AWS SES were built in a different era. They run on traditional cloud infrastructure (AWS EC2, etc.) with garbage-collected languages (Java, Ruby, Node.js). This means:

  • Higher operational costs — More servers needed per connection
  • Limited connection density — ~10K concurrent connections per node vs. 50K+ with Rust
  • Inefficient resource usage — Garbage collection pauses, runtime overhead

These costs get passed down to you. When you pay $19.95/100K emails to SendGrid, much of that is covering their infrastructure inefficiency.

Why Rust?

Rust gives us the performance of C++ with memory safety guarantees. For email infrastructure, this means:

  • 50K+ concurrent SMTP connections per node — vs. ~10K for Postfix-based solutions
  • Zero-cost abstractions — No runtime overhead, no garbage collector
  • Memory safety — No buffer overflows, no use-after-free bugs. Critical for security.
  • Tokio async runtime — Industry-leading async I/O for handling thousands of concurrent connections
  • Axum web framework — Type-safe, tower-based middleware architecture

Why Cloudflare?

Cloudflare's developer platform is a force multiplier. By building on their ecosystem, we get:

  • Workers — Edge compute for tracking pixel serving, link redirects, and webhook delivery. Sub-millisecond response times globally.
  • R2 Storage — Zero egress fees for storing email logs, attachments, and analytics data
  • Queues — Reliable message delivery for async processing pipelines
  • Durable Objects — Strongly consistent state for rate limiting and configuration
  • KV — Fast, globally distributed key-value storage for redirects and cache data

The combination lets us operate at 60-80% lower infrastructure cost than legacy providers — savings we pass directly to our customers.

The result

Our production SMTP servers handle 50K+ concurrent connections on modest hardware. API responses average under 1ms at the edge. And our customers pay a fraction of what they would with incumbents.

Most importantly: none of this came at the expense of reliability. Rust's type system catches entire classes of bugs at compile time. Our crash rate in production is effectively zero.

Email infrastructure doesn't need to be expensive or unreliable. Sometimes you just need to build it with the right tools.

Get Started Free

Start sending in under 2 minutes

No credit card. No onboarding call. No "talk to sales." Just one API key and you're shipping.

SC
MR
PS
JD
+2K
2,500+ developers already shipping