Zerodha (India's largest stockbroker) recently gave a talk on YouTube on how they scaled from zero to 11M users.
Here is the gist:
A decade back they started with automating financial processes that they ran on Excel sheets with Python scripts. With this, processes that required 2 work hours were smashed in 2 seconds.
They moved on to set up a self-hosted Postgres database that hosts tens of terabytes containing hundreds of billions of rows of financial records today.
Self-hosting a technology, tinkering with it, getting acquainted and eventually mastering it proved to be a crucial factor in enabling the company to grow, keeping the costs at a bare minimum, in addition to avoiding the licensing costs that would come along when using proprietary managed services.
They get approx. 2M+ concurrent users logged in as the markets open in the morning handled by Redis instances running for years requiring zero maintenance. The infrastructure is hosted on AWS instances without the use of any managed services.
Their original ticketing system was a Gmail inbox logged in simultaneously by a dozen support people. Later, when the number of clients became sizeable, they deployed a PHP-based support ticketing system, which still powers the support today used by a thousand employees handling millions of clients and the same number of tickets.
The support system infrastructure costs them peanuts (a few hundred dollars every year) in contrast to when leveraging a managed support SaaS, which would have cost them millions of dollars annually.
Self-hosting everything took time initially, but in the longer run helped them scale, keeping the costs at a bare minimum, in addition to avoiding vendor lock-in.
They originally built the backend services in Python around 2014 but stumbled across performance issues and bottlenecks, which led them to rewrite their services in Go. Their high-frequency concurrent trading service today runs on Go with a response baseline of less than 50ms.
For infrastructure orchestration, they leverage Nomad. With it, they achieved visibility into their infrastructure, enabling a new developer to make changes significantly faster by understanding a few lines of configuration code.
They built an in-house open-source email software called ListMonk, which they leverage to send out 200 million emails every month with a cost of just a couple of hundred dollars in hosting.
Their tech team is comprised of 30 people with the core philosophy of staying close to the software via self-hosting, keeping things simple and keeping external dependencies to an absolute minimum, which helps them avoid layers of abstractions and opaqueness that comes with managed software. This philosophy has significantly contributed to their profit margins.
They believe having to invest significant energy managing the self-hosted software may have been an issue a decade before but is not now given how robust the open source software is today.
During COVID-19, the number of orders on their platform grew exponentially from 2 million to 12 million per day, and the same philosophy helped them scale with the same team size without changing the infrastructure and provisioning additional hardware.
If you wish to go from zero to confidently contributing to system design discussions at your workplace, making informed decisions while having a firm grasp on the fundamentals, regardless of your current role and experience level, check out the Zero to Mastering System Architecture learning path that educates you step by step on web architecture, cloud computing, the infrastructure supporting scalable web services and distributed system design, starting right from zero.
If you found this post insightful, do share the web link with your network for more reach. You can connect with me on LinkedIn & X in addition to replying to this post.
I'll see you around in my next post. Until then, Cheers!
Reminds me of an article I read back in the day where the company moved out of the cloud hosting everything themselves saving millions.