Back to Blog
EngineeringNovember 18, 202412 min read

How We Scaled to 50 Million Messages Per Day

A deep dive into the architecture decisions and engineering challenges we faced.

Sarah Kim
VP of Engineering

The Journey to 50 Million Messages

When we started BotLaunch, we were processing a few thousand messages per day. Today, we handle over 50 million messages daily. This is the story of how we got here.

The Early Days

Our initial architecture was simple: a monolithic Node.js application with PostgreSQL. It worked great for our first customers, but cracks started showing around 100,000 messages per day.

The First Big Challenge

At 500,000 daily messages, our database became the bottleneck. We implemented several optimizations:

  • <strong>Read replicas</strong> for analytics queries
  • <strong>Connection pooling</strong> with PgBouncer
  • <strong>Query optimization</strong> through careful indexing
  • <strong>Data archiving</strong> for old messages
  • This bought us time, but we knew we needed a more fundamental change.

    The Microservices Migration

    At 5 million daily messages, we made the decision to migrate to microservices. This was a 6-month project that involved:

  • Identifying service boundaries
  • Implementing message queues (RabbitMQ)
  • Building service mesh with Istio
  • Gradual traffic migration
  • Today's Architecture

    Our current architecture handles 50M+ messages daily with room to grow:

  • <strong>Event-driven</strong> - All services communicate via Apache Kafka
  • <strong>Horizontally scalable</strong> - Services auto-scale based on load
  • <strong>Globally distributed</strong> - Data centers in US, EU, and Asia
  • <strong>99.99% uptime</strong> - Thanks to redundancy at every layer
  • Key Learnings

  • <strong>Measure everything</strong> - You can't optimize what you don't measure
  • <strong>Plan for 10x</strong> - Always design for 10x your current scale
  • <strong>Embrace eventual consistency</strong> - Not everything needs to be real-time
  • <strong>Invest in observability</strong> - Good logs and metrics save lives
  • We're already planning for 500 million messages per day. Stay tuned for that blog post!

    Share this article
    Sarah Kim
    VP of Engineering

    Sarah leads the engineering team at BotLaunch, bringing 15 years of experience scaling distributed systems.