DEV Community

Cover image for How I Built a High-Performance SMS Verification Service with Rust and Axum
Zevs
Zevs

Posted on

How I Built a High-Performance SMS Verification Service with Rust and Axum

I built SMSCode because I was frustrated with existing SMS verification services. Overpriced, slow OTP delivery, terrible APIs, and documentation that looked like it was written in 2010.

So I rewrote everything from scratch in Rust.

The Problem

If you've ever tried to automate SMS verification — for testing, privacy, or bulk operations — you know the pain. Most services charge $0.50+ per number, have APIs that randomly fail, and support maybe 50 countries if you're lucky.

I needed something better.

The Stack

  • Backend: Rust with Axum framework
  • Frontend: Astro SSR
  • Database: PostgreSQL + Redis
  • Infrastructure: Bare metal servers on Proxmox

Why Rust? Performance and reliability were non-negotiable. With 100K+ active users making real-time requests, I needed something that wouldn't buckle under load.

Architecture Overview

The system follows a domain-driven design with clear separation between:

  1. Number inventory management — pooling numbers across multiple providers
  2. Order processing — idempotent requests to prevent duplicate charges
  3. OTP delivery — webhook support for real-time notifications
  4. Background workers — cleanup tasks post-verification

Key Technical Decisions

Idempotent requests: Every order has a unique key to prevent duplicates even under network failures.

Live stock checks: Before a user submits an order, we verify number availability in real-time — no more "sorry, that number isn't available" after payment.

Multi-provider pooling: Numbers are sourced from multiple providers simultaneously, giving us 200+ country coverage at competitive prices starting from $0.0044/activation.

Results

SMSCode now serves 100,000+ active users across 200+ countries with support for 700+ platforms including WhatsApp, Telegram, Google, TikTok, and Facebook.

If you're building something that needs SMS verification, check it out at smscode.gg.

Happy to answer any questions about the Rust/Axum architecture in the comments!

Top comments (0)