Domain Boundaries, Catalog, Search, and Cart

Separate major responsibilities: catalog owns product facts, search provides a query-optimized index, cart stores a user's intended selections, inventory owns stock availability, order management owns the order lifecycle, and payment integration tracks provider transactions.

Search is a derived index and may lag behind catalog updates. Product detail pages can use cacheable read models, while price and stock must be revalidated at checkout. A cart is not a reservation unless the business explicitly reserves inventory when items are added.

Define API contracts and ownership so two services do not independently become the source of truth for the same field. Denormalize product display data into read models when useful, but specify how updates and deletion propagate.

Key Takeaways
  • Give each domain clear ownership of its authoritative data.
  • Search and catalog views may be eventually consistent.
  • Revalidate price and availability at checkout.
Knowledge Check

Why should an e-commerce search index generally not be the source of truth for inventory?