Mesut Can
RSS feed

WorkCase study

One portal, many small services

Türk Telekom's move from a legacy monolith to event-driven microservices and micro-frontends for 30M+ subscribers, where I was lead developer on the migration, and the online subscriber portal I architected.

  • Spring Boot
  • Apache Kafka
  • MongoDB
  • Kubernetes
  • Polymer
  • Cloudify
For
Türk Telekom and its 30M+ subscribers, through Innova, the group's IT company
My part
Lead developer on the migration; architect of the online subscriber portal
Built with
Spring Boot, Apache Kafka, MongoDB and Kubernetes, with DDD and CQRS; Web Components with Polymer; Cloudify
When I was there
2011 to 2018, from Application Developer to Application Development Consultant

The situationLink to this section

Behind Türk Telekom's 30M+ subscribers sat a legacy monolith: one big application where every module shared one fate.

A monolith is not a mistake on day one. One codebase, one deployment, one place to look. The trouble starts as it grows. In one big app, a failure in one module can take the whole app down. Every release ships every module together. And a new tariff waits until the whole app is ready to go out.

That was the shape we set out to change. We wanted releases to become continuous, a failing module to stay a local problem, and new campaigns and tariffs to go live faster.

What we builtLink to this section

Two pieces of work went hand in hand: the migration from the monolith to event-driven microservices and micro-frontends, where I was the lead developer, and the online subscriber portal, which I architected.

One roof for every sub-brandLink to this section

The portal brought all of Türk Telekom's sub-brands under one roof, so 30M+ subscribers manage every product from a single place. For a subscriber it is one site. Behind it, the parts are separate services.

Services that talk in eventsLink to this section

The services are built with Spring Boot and keep their data in MongoDB. Domain-driven design (DDD) draws the borders between them, and they talk to each other through events on Apache Kafka. Inside, they separate the commands that change data from the queries that read it (CQRS). Everything runs on Kubernetes, with auto-scaling and self-healing.

Micro-frontends as Web ComponentsLink to this section

The page itself was split the same way. I built the micro-frontends as Web Components with Polymer, so each part of the portal is its own component and can change without the rest of the page.

Pipelines for continuous releasesLink to this section

I automated the deployment pipelines with Cloudify. It is the least glamorous part of the story, and the one that made continuous releases possible.

Figure 1: the shape of the subscriber portal, simplified At the top, one subscriber portal made of four micro-frontends built as Web Components with Polymer, here called Tariffs, Campaigns, Billing and Profile. Each one talks to its own service below, built with Spring Boot and keeping its data in MongoDB. The services exchange events through Apache Kafka. Services and Kafka run on Kubernetes with auto-scaling and self-healing. Automated Cloudify pipelines make continuous releases possible. The module names are illustrative. one subscriber portal Tariffsweb component Campaignsweb component Billingweb component Profileweb component Kubernetes: auto-scaling and self-healing serviceTariffsSpring Bootdata in MongoDB serviceCampaignsSpring Bootdata in MongoDB serviceBillingSpring Bootdata in MongoDB serviceProfileSpring Bootdata in MongoDB Apache Kafkaevents between services Cloudify pipelines: continuous releases
Figure 1. The shape of the portal, simplified. Every part of the page has a service behind it, and the services share events instead of one big codebase. The module names are illustrative.

Try it: break a moduleLink to this section

The clearest way to see the difference is to break something. The toy below is an illustration, not a measurement: four modules with made-up names, the page a subscriber sees, and what happens behind it.

One big app or services?

An illustration, not a measurement. Pick how the app runs, break a module, then step time forward and watch what the subscriber sees.

The app runs as

One big app: all four modules run inside it, and every page works. Break a module to see what happens.

What this shows: in this toy's one big app, a single failure is everybody's failure, and nothing comes back until the whole app is fixed and released again. With services, the failure stays the size of the part that failed, its events wait in Kafka instead of getting lost, and self-healing brings it back.

What changedLink to this section

  • Releases became continuous. The automated Cloudify pipelines made that possible.
  • One failing module no longer took the app down. A failure stays inside the part that failed, and the rest of the app keeps working.
  • New campaigns and tariffs went live faster. A change to one part no longer waits for every other part.
  • One place for every product. Subscribers manage every product from a single place, whichever sub-brand it belongs to.

My partLink to this section

I was the lead developer on the migration from the legacy monolith to event-driven microservices and micro-frontends, and I architected the online subscriber portal. I built the micro-frontends as Web Components with Polymer and automated the deployment pipelines with Cloudify.

The idea I kept from it: design so that a failure stays the size of the thing that failed. Most of what we built, from the services to the pipelines, serves that one idea.