Skip to content

Dukaan shifts from using cloud services to a self-hosted bare metal infrastructure to cut its $80,000 per month cloud bills

Dukaan shifts from using cloud services to a self-hosted bare metal infrastructure to cut its $80,000 per month cloud bills

SUMMARY

Indian e-commerce Dukaan initiated a planned, thoughtful transformation of its deployment of cloud services to self-hosted bare metal infrastructure to reduce its soaring operational expenses significantly. Subhash Choudhary, co-founder and Chief Technology Officer (CTO) of Dukaan, in his book The Accidental CTO, described this step as a reaction to avoid an enormous $80,000 per month bill to Amazon Web Services (AWS). The significant savings in money have been attained, and this guarantees long-term financial sustainability of the company and demonstrates an option that is very potent in place of unending cloud reliance by firms of a specific size.

Escalating price tag and zero-downtime migration

At the initial phases of the development of Dukaan, the use of cloud computing, such as AWS, was an advantageous choice, providing convenience, processing, and velocity. This made the company move at a phenomenally fast pace in its early development because of the convenience of not having to deal with the underlying hardware. With this convenience came a cost that was huge and fast increasing.

Dukaan used the Strangler Fig Pattern method of migration to implement this complex shift without affecting its users. The process will entail incrementally moving the traffic away (instead of a one-time move) from the legacy system (AWS) onto the new system (self-hosted bare metal). This slow and gradual approach guaranteed the users zero downtime.

One of the primary reasons that enabled this zero-downtime migration was the decision of startup to have its own IP address space. This gave Dukaan a permanent, mobile address over the internet, i.e., the company could be moved around but still retain the same address to the outside world. This ownership was the key that facilitated smooth migration since the users would never realise that there had been a change in the underlying infrastructure. The decision of Dukaan to switch to bare metal is not a one-time occurrence. Other companies have recorded similar high cost reductions by abandoning a public cloud infrastructure.

Monitoring and building of the bare metal infrastructure

Dukaan chose the German-based provider Hetzner to set up the new infrastructure. The company subsequently leased physical servers in data centres located strategically based on geographical location to their current regions in AWS. The new environment was developed through the use of efficient and powerful tools, including the k3s, which is a lightweight Kubernetes distribution, to ease the complexity of the orchestration process. The technical team of Dukaan was also very keen to build and test their new self-hosted Kubernetes clusters in nine new data centres worldwide in a span of several weeks.

The physical moving of live traffic was done with a lot of care. It started by moving 1% of its European traffic out of the AWS cluster to the new bare metal cluster in Helsinki. The rest 99%  of the traffic was still supported by the existing stable AWS system, which served as a safe backup.

All the steps of this process were observed. In case of any problem identified, the company could have immediately moved all the traffic to AWS without any downtime. After the initial phase was confirmed to be stable, a continuous increase in the traffic to 10%, 25%, and 100% was moved off AWS in that region. And then this excruciatingly cautious and painstaking process happened again and again over the next two months, region by region, until the entire global application was fully operational on self-hosted bare-metal infrastructure by Dukaan.

Conclusion

The calculated decision by Dukaan to switch an $80,000 monthly AWS bill to a much lower bare metal price shows that it is a strategic shift typical of established startups that have a steady workload requirement. Through the adoption of the Strangler Fig Pattern approach to effect a zero-downtime migration and the use of its own IP address space, Dukaan was able to optimize its operational costs without compromising performance or service availability. The CTO of the company has recorded the process in The Accidental CTO, making it available to the rest of the tech community.

Note: We at scoopearth take our ethics very seriously. More information about it can be found here.

Publish Your Startup Story