Case Study DigitalRoute Case Study: Success Story

Background Pattern

Hepsiburada Case Study - Success Stories

Dealing with 500 microservices in the largest Turkish eCommerce

Hepsiburada logo
Hepsiburada is the largest and fastest-growing e-commerce platform in Turkey and is one of the top 5 fastest growing e-commerce companies in Europe, according to Internet Retailer. With over 150 million monthly visits, the platform offers its customers the widest product selection, availability, best pricing, and delivery to make their lives easier: over 50M product variations in more than 35 categories, including mobile phones, cosmetics, consumer goods, and fashion.

Visit: Hepsiburada

Turkey
E-commerce

Hepsiburada is the largest and fastest-growing e-commerce platform in Turkey and the top 5 in Europe. With over 150 million monthly visits and over 50 million product variations in mobile phones, cosmetics, consumer goods, fashion, and more, Hepsiburada is a business and technology leader in Turkey.

Hepsiburada challenges

A company of such dimensions as Hepsiburada had several challenges before choosing KrakenD as their API gateway solution:

  • Operating 500 microservices and 40+ autonomous product development teams has many complex issues.
  • Engineers had to develop outside their business domain additional features that consumed a lot of time: authentication, rate limiting, access management, etc. Each service had to implement JWT authorization mechanisms and be maintained and updated individually.
  • Malicious attacks and scrapping of their services is always on, a side effect of being a significant player.
  • Complicated separation between public and internal APIs.
  • Onboarding new microservices and change boundaries wasn’t easy.

How does Hepsiburada use KrakenD

KrakenD acts as Kubernetes ingress controller, even that KrakenD is not actively vendored as an ingress controller. The API gateway can receive all the incoming traffic through a NodePort. KrakenD is then plugged into internal services to offer several APIs using the micro frontend pattern, using VoltranJS (an open-source project by Hepsiburada).

Ten autonomous frontend teams write their use cases on independent KrakenD deployments. Each group of engineers operates its KrakenD instances as a Backend For Frontend (BFF). KrakenD aggregates responses amongst the very different Hepsiburada’s catalog of microservices, and pick those fields that are relevant for the micro frontend usage.

Microfrontend pattern

KrakenD becomes a handy and easy to implement solution for frontend developers who are implementing the micro frontend pattern. KrakenD sends over the internet the information needed and saves bandwidth to the end-user by not delivering everything else that is available on their services.

In addition to BFF, to reduce the pressure on microservices and speed up even more responses, KrakenD’s HTTP-cache feature is used intensively.

The microservices no longer need to implement shared concerns, and non-business features are offloaded to KrakenD API Gateway. Security, authorization, rate-limiting, access management, logs, and other vital pieces are in a single place.

Additionally, an intensive use of the KrakenD’s templating system, the Flexible Configuration, helps them implement complex workflows and permissions across multiple teams sharing most of the code base.

Today KrakenD runs in approximately 800 Docker containers summing all Hepsiburada’s Kubernetes clusters

According to Alper Hankendi’s calculations -the Engineering Director at Hepsiburada- the usage of KrakenD in the company has around 800 Docker containers in total, distributed in 2 Availability Zones x 2 Kubernetes environments x 10 Frontend Teams x 20 Containers each.

KrakenD deploys in a multi-region environment, and since the API gateway has no state, it can scale linearly. Developers use the GitOps principles, and automated pipelines are responsible for pushing changes into each Kubernetes environment and roll out the product. As the containers are very lightweight, the time to production is swift.

How KrakenD helped Hepsiburada

Hepsiburada chose KrakenD for several reasons, both technical and organizational. The following benefits have been outlined by Hepsiburada to us.

Organizational benefits:

  • No vendor lock-in, open-source project with Enterprise support available.
  • Ability to adapt the solution and write custom functionality for the company.
  • Reduce company complexity by delegating to the gateway those responsibilities that are not in the business domain.
  • Circumvent malicious attacks by using Krakend’s layer of protection.
  • Prevent exposing internal concerns to external clients.

Architectural benefits:

  • Separate public APIs from internal microservice APIs, add new microservices and change boundaries conveniently.
  • Move authentication and authorization from each service to KrakenD only.
  • Hide service discovery and versioning details from the client.
  • Mock or virtualize services to validate design requirements or assist in integration testing.
  • Act as if it were an ingress controller of their multiple K8S clusters.
  • Remove the in-house Backend For Frontend service, and use the response manipulation feature of KrakenD.
  • Cross-Origin Resource Sharing (CORS) to expose services to the public internet and restrict non-allowed origins
  • Build some parts of endpoint data using sequential calls.
  • Enable support for mixing communication protocols.

Hepsiburada, the technology leader in Turkey, has decreased the complexity of dealing with microservices. All teams are autonomous and can easily change their microservices as the client is not coupled to the backend services, plus internal concerns are hidden to external clients.

So far, the engineering team is delighted with the results obtained by KrakenD, and they are looking further to use even more functionalities.

KrakenD is the best API Gateway and has helped us reduce the complexity of dealing with 500 microservices.

History about Hepsiburada

Hepsiburada launched its marketplace platform in mid-2015, integrating major merchant brands to its platform to provide superior service competitive differentiation. Over the last decade, Hepsiburada has achieved an impressive track record, growing its revenues more than 25 fold while maintaining profitability. Hepsiburada has been a pioneer in growing the online retail space in Turkey with a strong focus on offering the widest product selection available and improving customer experience by providing value-added services such as same-day delivery. It is also the country’s first online retailer to launch the One-Click Pay service, allowing customers to make swift online purchases using express check-out functionality.

Hepsiburada recently expanded its ecosystem with new subsidiaries such as Hepsijet, a delivery company bringing an innovative perspective to the logistics industry; Hepsipay, a digital payment services provider; Hepsiexpress offering grocery delivery directly to the customer door at their desired times; HepsiAd, an advertisement platform for brands; Hepsiglobal, providing the opportunity to become a global player through e-export and many more to their stakeholders.

More Case Studies

Scarf

Stay up to date with KrakenD releases and important updates