OEM product catalog platform
A platform that collects supplier catalogs for a promotional products distributor. I built its API foundation, then took over the ingestion pipeline and the upsert into the catalog.
~70%
faster catalog retrieval via SQL optimization
How it was measured
Catalog query response time before and after SQL optimization (indexes and query rewrites), on the production catalog of 500k+ products.
2+ days → ~22 h
bulk-update pipeline
How it was measured
Wall-clock time of one full bulk update of the catalog, before and after the pipeline rework.
400+
suppliers in the catalog
How it was measured
Supplier records in the platform's supplier list: 418, of which 413 publish a product data service.
On this page
Context
A distributor of promotional products needed one catalog of everything its suppliers sell: products and their parts, colors, decoration options, prices, stock and media. Suppliers publish this data through industry-standard SOAP services. The operations are the same everywhere, but versions differ and many suppliers implement only some of the services.
The platform pulls those catalogs into one SQL Server database, and back-office staff manage suppliers, feeds and sync jobs in an admin app. I was one of five backend engineers, working through Valletta Software.
Problem & constraints
- 418 suppliers, 6 service versions and up to 13 supplier calls per product.
- One product touches 31 tables: parts, colors, sizes, decoration, prices, stock and media.
- Every sync brings the same products back. Rows must update in place, rows the supplier removed must go, and products no longer for sale must be switched off.
- Fetching and writing run in parallel, so two writers must never update the same product at once.
- A full sync runs for hours, and some supplier services time out or return nothing.
Architecture
Scroll the diagram sideways
Key decisions
Two stages, with raw responses kept in S3
- Context
- Supplier SOAP calls are slow, versioned and unreliable, while database writes are heavy.
- Options considered
- A: one consumer fetches a product and writes it in one step. B: the first stage fetches and saves raw JSON to S3, and a second message processes it from S3.
- Trade-offs
- B adds a hop, storage and file bookkeeping. In return supplier calls are decoupled from database load, each stage has its own concurrency limit, unchanged files are skipped by hash, and raw data can be processed again without calling suppliers.
- Outcome
- Chose B. Fetching runs with 12 concurrent consumers and processing with 10.
Idempotent upsert instead of one big transaction
- Context
- Each product means 30+ statements, with 10 writers in parallel and constant re-runs.
- Options considered
- A: wrap everything in one transaction and flag removed rows for later cleanup. B: make every statement idempotent: deterministic IDs, row hashes, unique indexes and a separate delete phase after the MERGE statements.
- Trade-offs
- With B a failure halfway leaves a product partly updated until the next sync. In return re-runs converge, and the cleanup flags are gone.
- Outcome
- Chose B. The procedure went from version 14 to 27, with 68 new indexes and 34 MERGE statements.
A job runner in SQL Server
- Context
- Syncs start from the admin app or an external call. They must not run twice for one supplier, must survive crashes and must be cancellable.
- Options considered
- A: a scheduler library, or cron with a queue. B: a jobs table and a claim procedure in the same database.
- Trade-offs
- B means writing our own heartbeat, frozen-job detection and cancellation, and polling every 30 s. In return there is no new infrastructure, and job status is visible in the admin app next to the catalog.
- Outcome
- Chose B. Jobs are claimed atomically, one per supplier at a time and up to 5 in parallel, and a job without a heartbeat for 2 minutes is marked frozen.
Results
- API foundation: a layered .NET 8 solution, IdentityServer for the admin app, migrations and versioned stored procedures applied on startup, CodeDeploy hooks for IIS.
- A two-stage SQS pipeline with separate concurrency limits, retries and a local in-memory mode.
- A catalog schema mapped to the supplier standard: products and parts, inventory, media, pricing and configuration.
- The upsert procedure taken to version 27: row hashes, 68 indexes and a separate delete phase.
- Products a supplier stops selling are switched off in one set-based pass.
- A job runner with admin endpoints to list, start and cancel jobs and see failed ones.
What I'd do differently
- I would let failures reach the queue. Both consumers caught every exception and only logged it, so a failed product waited for the next full sync.
- I would enforce per-supplier rate limits and timeouts. The settings existed for every feed but were never applied.
- I would test and measure before tuning. A 2,560-line generated procedure had no automated tests.