Scaling Rails to 50 Million messages with a boring stack.

By Shivam Mishra

Elevator Pitch

Chatwoot is a popular open source platform to talk to your customers, over the last two years we have grown to over 40K accounts and processed over 50M messages. All this with a boring Rails monolith and a single PostgreSQL database, the talk is about our story, current challenges and future plans.

Description

Chatwoot is an open source customer engagement and communication platform with close to 20K stars on GitHub. Our SaaS platform has scaled to over 40K active accounts, 1 Million messages daily from various sources like Email, Facebook, Instagram, WhatsApp and more. Our tech stack is fairly boring, we have a Rails Monolith, realtime events (a lot of them) with ActionCable, background jobs with Sidekiq, PostgreSQL and Redis, and growing healthily with a 99.99% uptime for the past 1 year which we have managed to scale to processing 50 Million messages so far.

Along the way, we learned many things about our DB and Rails both, we have faced concurrency issues, the obligatory slow queries (real slow), bottlenecked jobs, cache eviction issues and more. We have said “no” to bringing Kafka, ElasticSearch to keep our stack as boring and vanilla as possible, and there still is a lot of room to grow with this. My talk focuses on how we got here, the learnings, some best practices in ensuring the health of your app and DB. The challenges we face and how we plan to tackle them with growing trust in our stack.

Notes

Hey folks, thanks for hosting the conf. Looking forward to it. I am a lead engineer at Chatwoot (YC W21), been working here for well over a year. Before getting here I was a long time python developer, Previously I was a Framework engineer at Frappe.io (A leading OSS startup in India) and Product Engineering Lead at DeepSource (YC W20, a dev-tool startup). I’ve built my career on Open Source software and developer tooling, I have a great affinity towards elegant frameworks and great abstractions, Ruby & Rails is right up the alley when it comes to these.

About the technical requirements of the talk, it’s not ideal for students, or beginners, but will for sure have a good amount to learn from here, specifically the question “Does it scale”. A slightly seasoned audience, who have shipped web apps to production (regardless of the framework), this talk is perfect, they will be able to relate the most. For an advanced audience, it’s a good story, an introduction to Chatwoot and a chance for me to get some new ideas. Overall for a lot of people in the audience just an introduction to Chatwoot, a battle-tested, fully open-source Rails codebase is a great resource, to seek inspiration from.