Learning From Bukalapak: Design A WebApp to Serve Millions of Users

How I learned from them evolving their architecture systems

Ramadhani Baharzah
3 min readAug 17, 2023

Disclaimer: As an ex Bukalapak Engineer I don’t have rights to share their architecture design. This article is only show general knowledge I have learned in the past 5 years based on my experience, including there.

Photo by Alex wong on Unsplash

In the ever-evolving landscape of web development, the structure and architecture of websites have seen remarkable transformations. One such transformation can be witnessed in the evolution of eCommerce websites. These online platforms, which have become integral to modern shopping experiences, have undergone a significant shift in their underlying design principles.

The journey begins with a conventional approach known as the monolithic design. In this initial stage, the entire eCommerce website operates as a single, self-contained unit hosted on a solitary server. This approach, while straightforward to implement, poses challenges as the website grows in complexity. As the website gains more features and experiences higher traffic, the limitations of the monolithic design become apparent. Scaling the system becomes a cumbersome task, often requiring the entire application to be taken down for updates or maintenance.

Recognizing the limitations of the monolithic design, developers and architects have explored alternative approaches that can address these challenges more effectively. One of the noteworthy advancements is the adoption of a service-oriented architecture, often manifested through the microservices paradigm. This architectural shift marks a significant departure from the monolithic model.

The diagram below illustrates the evolution of a simplified eCommerce website. It goes from a monolithic design on one single server to a service-oriented/microservice architecture.

image source: bytebytego.com

Let me explain the whole diagram above.

Suppose we have two services: inventory service (handles product descriptions and inventory management) and user service (handles user information, registration, login, etc.).

Step 1 – With the growth of the user base, one single application server cannot handle the traffic anymore. We put the application server and the database server into two separate servers.

Step 2 – The business continues to grow, and a single application server is no longer enough. So we deploy a cluster of application servers.

Step 3 – Now the incoming requests have to be routed to multiple application servers, how can we ensure each application server gets an even load? The load balancer handles this nicely.

Step 4 – With the business continuing to grow, the database might become the bottleneck. To mitigate this, we separate reads and writes in a way that frequent read queries go to read replicas. With this setup, the throughput for the database writes can be greatly increased.

Step 5 – Suppose the business continues to grow. One single database cannot handle the load on both the inventory table and user table. We have a few options:

  • Vertical partition. Adding more power (CPU, RAM, etc.) to the database server. It has a hard limit.
  • Horizontal partition by adding more database servers.
  • Adding a caching layer to offload read requests.

Step 6 – Now we can modularize the functions into different services. The architecture becomes service-oriented / microservice.

This new architecture breaks down the various functions and components of the eCommerce website into smaller, specialized services. Each service operates independently and can be developed, deployed, and scaled individually. This granularity not only promotes better organization within the development team but also allows for improved fault isolation and enhanced resilience. Additionally, scaling specific services based on demand becomes more feasible, resulting in a more efficient utilization of resources.

In conclusion, the transformation from a monolithic design to a service-oriented/microservice architecture showcases the adaptability and innovation within the realm of eCommerce website development. This evolution not only addresses the challenges posed by the limitations of the monolithic approach but also paves the way for more flexible, scalable, and robust online shopping platforms.

--

--