Sportland · Scandiweb · Backend engineer · 2025
Getting in-store sales into the platform under 100ms
Replacing per-item lookups with a single query
- 100ms
- ingestion time
The problem
Sportland sells in shops as well as online, and those purchases have to land in the platform. The first approach looked up each incoming item on its own, which is fine on a test batch and falls apart at real transaction volume: the work grows with the number of items, and the shops do not stop selling while you catch up.
What I did
I restructured how incoming data is matched against the catalogue so the whole batch resolves in a single query rather than a sequence of lookups. Most of the work was in the matching strategy and the indexes behind it, not in the code that calls them.
The outcome
The operation runs in under 100ms, and the cost no longer scales with the size of the batch.
Built with
- PHP
- Magento 2
- MySQL