The Whale: Onboarding an Enterprise Juggernaut
Our public performance tests and the story of the Shark Tank effect started making waves in the Indian D2C community. Our message was clear and backed by data: Dukaan was faster than Shopify. This bold claim acted like a magnet, attracting not just the small sellers we had started with, but also much bigger fish.
One day, Suumit got a call that made us all stop in our tracks. It was from the leadership team at Wow Skin Science, one of the largest and most successful D2C brands in India. They were a 1000-crore-a-year behemoth. They had seen our claims, and they were intrigued, but deeply skeptical. Their challenge was simple: "Prove it."
This was the beginning of a new chapter, one that would force us to move beyond a one-size-fits-all platform and build a true enterprise-grade solution.
Part 1: The Challenge and the "Oh Shit" Moment
The team at Wow Skin Science was sharp. They agreed to a one-week trial. They wouldn't move their whole store, but they would run a small, targeted campaign to a landing page hosted on Dukaan. They wanted to see our edge network in action with their own real-world traffic.
For that week, our entire team was on high alert. We watched the dashboards as their campaign traffic came in. And our platform performed flawlessly. The pages loaded in the blink of an eye, the user experience was fluid, and our performance claims were validated with their own data. They were impressed.
A week later, they called back.
"We're convinced," their Head of Technology said. "The performance is incredible. We want to migrate our entire operation-our full catalog, our millions of customers, our entire 1000 crore/year business-to Dukaan."
The initial reaction in our team Slack was pure euphoria. This was the ultimate validation of everything we had built. Landing a client of this magnitude would change the trajectory of our company overnight.
Then, the euphoria was replaced by a quiet, collective "Oh, shit..." moment of terror.
The scale of Wow Skin Science was unlike anything we had ever handled. Their order volume was projected to be 20 times greater than the current total volume of all our other 5 million stores combined. A single one of their new product launches would generate more traffic than the Jain Shikanji Shark Tank spike.
We were staring at a whale, and we had to figure out how to get it into our boat without sinking the entire fleet.
Identifying the Problem: The "Noisy Neighbor"
Our global edge network was designed to handle massive read traffic. But the write traffic-the new orders, the customer signups, the inventory updates-all eventually had to be processed by our single, central master PostgreSQL database in Mumbai.
Until now, this was fine. Our millions of small sellers created a predictable, distributed load. But Wow Skin Science was different. They were a single entity that could generate an apocalyptic amount of write traffic in a very short period of time.
This created the classic "noisy neighbor" problem.
- Analogy: We had built a massive, efficient public highway system (our platform). Now, a convoy of a thousand giant monster trucks (Wow Skin Science) wanted to use our highway. If they all hit the road during a flash sale, they could create a traffic jam so immense that it would bring all the normal cars (our millions of small sellers) to a complete standstill.
Conversely, a viral moment from one of our millions of smaller stores could, in theory, cause a tiny slowdown that would impact Wow's critical operations. For a brand of their size, this shared risk was a non-starter. We couldn't put the whale in the same fish tank as everyone else. We had to build them their own, private ocean. This led us to our first real implementation of database sharding.
Part 2: The Enterprise Fortress
The architectural solution was clear: we had to isolate them completely. We couldn't just give them more powerful servers; we had to give them their own, dedicated infrastructure, starting with the database.
Technical Deep Dive: What is Database Sharding?
We had already scaled our database reads using replicas. But sharding is a technique for scaling database writes.
- Analogy: Our current database is a single, giant central library for the entire country. It's getting too busy to handle both public requests and the massive, specialized requests from a giant corporation. Sharding is the decision to build a completely separate, new national library dedicated exclusively to "Corporate and Enterprise" clients, while the original library continues to serve the general public. They are two independent systems with their own staff and resources.
In technical terms, sharding is a type of horizontal partitioning. Instead of just having one master database, you have multiple master databases, and a routing layer in your application decides which database to talk to for any given request.
Our Implementation: A Shard per Enterprise
We designed a simple but incredibly powerful sharding strategy.
- The Public Shard: This was our existing, powerful master database cluster. It would continue to serve our millions of existing and future small and medium-sized sellers.
- The Enterprise Shard: We provisioned a brand new, completely separate master database cluster with its own dedicated, top-of-the-line bare-metal hardware. This shard was created for one purpose and one purpose only: to serve Wow Skin Science.
This required a significant change in our application's core logic. We had to build a "shard router" into our code. Before our application executed any database query, it would first perform a simple check:
- What store_id is this request for?
- Is this store_id on our list of enterprise clients?
- If yes, open a connection to the Enterprise Shard DB.
- If no, open a connection to the Public Shard DB.
This logic was implemented across our entire codebase, ensuring that the data and the workload for our enterprise clients and our public sellers would be completely isolated from each other, from the moment the request first hit our application.
The Benefits of the Fortress
This architecture solved the "noisy neighbor" problem perfectly.
- Performance Isolation: A massive flash sale on the Wow Skin Science store would hammer their dedicated enterprise database shard, but our millions of other sellers on the public shard would feel zero impact. Their monster trucks now had their own private superhighway. Conversely, if a product from a small seller went viral, the resulting traffic spike on the public shard would not cause even a millisecond of delay for Wow's operations.
- Enhanced Security and Control: For a large enterprise client, this data isolation was a massive feature. Their customer and order data wasn't just logically separated; it was physically separated onto different machines, providing a higher level of security and making it easier to meet compliance standards.
- A Scalable Model for the Future: This architecture gave us a repeatable playbook for the future. When the next enterprise whale came along, we wouldn't have to panic about the capacity of our public database. We could simply provision a new, dedicated "Shard 3" for them. This decision was the foundation of our new "Dukaan Enterprise" offering, allowing us to serve two vastly different market segments without compromising the experience of either.