ADR-00005 — Event-Driven Catalog Synchronization, Local Publish-Readiness Gate
- Status: Approved / Implemented
- Date: 2026-09-25
- Authors: Engineering Team
Context
A product’s sellable data is split across two services by ownership: product-catalog owns descriptive/merchandising data (name, category, images), while inventory-service owns everything transactional about a SKU (variants, stock thresholds, dimensions, compliance/pricing, shipping package). The nine-step admin wizard writes across both services as the operator progresses, and product-catalog must know, at publish time, whether every inventory-service-owned piece of data is actually complete — without either service holding a direct write dependency on the other’s data store.
Decision Drivers (FRs & NFRs)
See SR-004 for the full requirement list.
- FR-08 (Publish Readiness Check):
product-catalogmust reject a publish attempt unless every requiredinventory-service-owned step is complete. - FR-10 (Event-Driven Completion Signals): Each wizard step’s completion in
inventory-servicemust reachproduct-catalogwithout a tight request/response coupling between the two services. - FR-11 (No Synchronous Cross-Service Call at Publish): Publish must not block on a live call to
inventory-service. - NFR-01 (Eventual Consistency Window): A bounded propagation delay between a step being saved and
product-cataloglearning about it is an accepted trade-off, not a defect.
Options Evaluated
Option 1 — Independent best-effort Pub/Sub events, local sync-marker gate (CHOSEN)
inventory-service publishes one independent, best-effort Pub/Sub event per completed step (variant builder, SKU dimensions, compliance/pricing, package map, opening entry). product-catalog subscribes to all five and updates a per-step sync marker on its own product document as each event arrives. Publish reads only these locally-held markers — it never calls inventory-service synchronously.
- Pros:
product-catalogandinventory-servicecan be deployed, scaled, and fail independently — the wizard’s earlier steps stay usable even ifproduct-catalog’s event consumer is momentarily behind.- Each step’s completion event is independent of the others, so a slow or retried step never blocks a different step’s event from being recorded.
- No new gRPC surface, connection pool, or timeout/retry budget is required between the two services purely for readiness checking.
- Cons & Accepted Trade-offs:
- The publish check trusts sync markers that were set by a past event delivery, not a live re-check of
inventory-service’s current state — if aninventory-serviceedit’s event is ever lost or a marker is set and the underlying data is later changed by a path that doesn’t re-publish the event, the marker can go stale. See Technical Debt — Product Catalog Admin-to-Mobile Gaps, TD-04. - A shopper-visible or operator-visible “ready to publish” state can lag the true state of
inventory-serviceby however long event delivery takes.
- The publish check trusts sync markers that were set by a past event delivery, not a live re-check of
Option 2 — Synchronous gRPC validation call from product-catalog to inventory-service at publish time
product-catalog’s Publish would call a synchronous inventory-service RPC (e.g. a ValidateAndCreateSkus-shaped call) to re-check and finalize every SKU’s readiness at the moment of publish, before allowing the product to go live.
If this design were ever built, the orchestration would sit in product-catalog, not inventory-service — product-catalog already owns the Publish action and is the aggregate root combining all five step signals into one readiness decision (Option 1’s sync markers are read the same way); inventory-service has no reason to know about product-catalog’s publish lifecycle, only to answer read/validation queries about the SKU data it already owns. The call itself would use gRPC, not REST, consistent with every other synchronous inter-service call in this platform — see ADR-00009 — gRPC for Synchronous Inter-Service Calls.
- Pros:
- Publish readiness would always reflect
inventory-service’s true, current state — no staleness window. - A single call site to reason about, instead of five independent event subscriptions.
- Publish readiness would always reflect
- Cons (Why Rejected):
- Couples
product-catalog’s publish path toinventory-service’s availability and latency — aninventory-serviceoutage or slow response would directly block every tenant’s publish action, not just the one being validated. - This option was never actually implemented — it exists only as a description in older module documentation that does not match the real
Publishimplementation, which performs a local sync-marker check exactly as described in Option 1. Choosing it now would mean building new cross-service coupling specifically to match stale prose, not a requirement driving new value.
- Couples
Option 3 — Single shared database across product-catalog and inventory-service
Both services would read and write the same underlying product/SKU records directly, eliminating the need for any synchronization mechanism.
- Pros:
- No propagation delay at all — both services would always see the same data.
- Cons (Why Rejected):
- Directly violates this monorepo’s per-service data-ownership boundary — every other microservice in this platform owns its own store, and no precedent exists for two services sharing write access to one collection.
- Removes independent deployability and schema evolution for either service; a schema change in one now requires coordinated migration in both.
Option 4 — Synchronous workflow orchestration (saga) across all nine wizard steps
A workflow engine would drive the entire wizard as a single long-running saga, with each step as an activity and publish as the saga’s final compensating-aware step.
- Pros:
- Centralized visibility into where a given product currently sits in its creation lifecycle.
- Built-in compensation/retry semantics for a failed step.
- Cons (Why Rejected):
- The admin wizard is operator-paced across an unbounded, human-driven timespan (an operator can leave a draft mid-wizard for days) — saga/workflow orchestration in this platform is reserved for short-lived, system-paced sequences (e.g. the checkout saga), not operator-driven multi-day data entry.
- Introduces a new dependency (a workflow engine) purely to solve a problem the existing event-subscription pattern already solves at lower operational cost.
Final Decision
Option 1 is selected. It is the only option that satisfies the no-synchronous-coupling requirement (FR-11) while keeping each service’s ownership boundary intact. The accepted staleness-window trade-off is bounded and monitorable (event-delivery latency), whereas Option 2’s coupling risk is unbounded (any inventory-service slowness directly blocks every tenant’s publish action) and, notably, was never actually built despite being described as if it were in older documentation — the real system already runs on Option 1’s design.
Related Documents
- BRD-004 — Product Catalog: Admin Creation to Mobile Presentation
- SR-004 — Product Catalog: Admin to Mobile System Requirements
- ADR-00008 — Polyglot Persistence: MongoDB for Product-Catalog, PostgreSQL for Inventory-Service
- ADR-00009 — gRPC for Synchronous Inter-Service Calls
- Architecture: Product Catalog — Admin to Mobile Flow
- Technical Debt — Product Catalog Admin-to-Mobile Gaps
- Microservices: product-catalog, inventory-service, shop-service