The register

Forty microservices, and prices had to stay identical to the cent.

A consumer platform with payments and subscriptions

Consumer platform · PHP microservices · Refactoring in production · Catalogue and promotions

A consumer platform with payments, subscriptions and moderated content runs on more than forty PHP microservices, some twenty shared internal packages and a SQL archive split into twelve sub-projects. The catalogue and promotions had to move to a new version while keeping prices identical, to the cent, to the production system.

In eight weeks we became the first contributor on five of the client's repositories. Add-on calculation went from fourteen calls to one, with response time down by 30%.

40+
microservices and 20 internal packages in one ecosystem
14 → 1
calls to compute the add-ons of an offer
-30%
response time on the catalogue flow

The context

The ecosystem had grown for years with a close-knit internal team and its own conventions: Lumen and Laravel microservices, shared libraries published on a private registry, SQL Server as the main database, Redis everywhere, RabbitMQ for messaging, storage and analytics across several clouds. None of those pieces was up for debate. The task was to step into that code and move the work forward by the house rules.

The catalogue is the platform's commercial heart: products, tiers, features, add-ons, promotions with rules per market and province, discounts with sign conventions inherited from earlier versions. The service orchestrating all of it had grown past four thousand lines in a single file.

The constraint

The constraint was twofold. On one side, the new catalogue's output had to match the old one: same promotions, same prices, for every user and every market, because every difference is a customer paying a different amount. On the other, the refactor had to happen inside the team's workflow, with its pipelines, its QA environments and its weekly releases.

The mandate on the four-thousand-line service was explicit: input and output do not change by a comma, only how it is built inside changes.

The decision

We chose not to rewrite. The monolithic service was broken down into an object structure by category, with typed containers for parameters and data in place of mutable arrays passed from hand to hand. Every step preserved the observable behaviour, verified with the project's tests and with comparisons on real data.

For offer calculation we decided to move the blocking rules from the remote service into the service that uses them: evaluating them locally removes a network call from every evaluation. And where the code called the same data preparation fourteen times in a loop, a facts registry replaces it with a single query. These are custom software choices inside a living e-commerce platform.

The intervention

The first weeks went into entering: reading the shared packages, understanding how services talk through events and queues, getting to know the promotions' SQL schema and its migrations. Then the refactor of the central service, in small commits, always with the QA branch aligned.

Parity with the legacy was verified on real data. That is how the most delicate case surfaced: for the same user the old system returned eleven promotions and the new one fourteen, because of a divergence in how promotion groups were collapsed and in routing by province. Finding it before release avoided different prices in production.

In the same sprint the catalogue API gaps in the new version were closed: tiers, dynamic features with a mutator pattern, aggregated add-ons, a geographic equaliser for differential pricing, the upsell service as a decorator. Circular dependencies between cart and purchases were untangled with lazy initialisation, the simplest solution, confirmed by the team.

APP → AGGREGATORE → CATALOGO / PROMOZIONI → PACCHETTI CONDIVISI → SQL · REDIS · CODE

Simplified diagram. Architectural details and integrations withheld for confidentiality.

The result

Add-on calculation went from fourteen calls to one, with promotions batch-loaded instead of queried one by one: about 1.8 seconds less on the slowest path, and overall response time down by 30%. Rules evaluated locally removed remote latency from every offer evaluation.

In eight weeks we were the first contributor on five repositories, including the events service and the application aggregator. The code stayed in the house style, the team kept releasing every week, and the new catalogue exposes the legacy promotion identifiers where the rest of the system still looks for them.

After the release

The work continues on the same ecosystem: the next proposal is a progressive catalogue response, showing the first offers while the rest arrive, to lower perceived latency without touching the calculation. Entering a system of this size is the typical case in our retail and e-commerce sector.

A new platform for more than 400 agencies →

Describe the system. We'll tell you what we see.

Ten minutes, one question at a time. At the end, our honest read of the case. It's the filter, before the call.