Performance & scale · 2025
Smaller rules payloads. More sales requests completed.
Inditex · via VirtualCave
Optimizing business-rule payloads in Inditex’s sale-time stock distribution service, reducing Kafka lag and processing overhead as the team prepared for record peak demand.
The context
Every sale depended on a stock distribution decision. Through VirtualCave, I worked on the Inditex service that calculated where products should depart from and which route they should take. That calculation ran before a sale could complete, making service availability critical: downtime meant sales could not proceed.
We were modernizing an existing service, which remained available as a fallback. The new algorithm was driven by business rules that needed continuous synchronization as sales were processed. Large JSON rule payloads made those updates expensive, and Kafka lag grew during peak demand.
My contribution
- Targeted a bottleneck in rule synchronization. Focused on the large JSON payloads carrying business rules, where frequent updates were adding Kafka lag during peak traffic.
- Made the rules smaller and easier to process. Compressed the rule payloads into a more compact representation, reducing the data to transfer and the work required to read and process it.
- Improved a dependency in the sales path. The change improved performance in a core service that needed to stay updated with each sale, directly supporting the team’s main metric: completed sales requests per minute.
The outcome
The system reached 42,000 completed sales requests per minute in stress tests, with the production limit set at 35,000 per minute. These were overall team results; reducing the rules payload was one of the most impactful contributions to that throughput improvement.
During the sales period, the service ran without issues and finished with a new record for peak request throughput, exceeding previous sales periods. The work showed how reducing the cost of a frequently synchronized payload could improve a service on the critical path to completing a sale.