Repository navigation
M1: foundation — Database per Service, Bounded Context, API Gateway, Observability - #2
Merged
Merged
Conversation
Pattern 1, Database per Service: add payment and inventory services, each with its own database; /health/db on every service; order-service isolation probe shows a real 'no such table' when it tries another service's table. Pattern 2, Bounded Context: inventory owns StockItem keyed by the catalog's product id; gateway endpoint returns one product as Catalog and Inventory each see it; context map page. Pattern 5, API Gateway: request IDs forwarded to every service and echoed back; /api/order-summary aggregates user, order, catalog and inventory; only GET/POST proxied. Pattern 6, Observability: shared shop_common package with OpenTelemetry tracing (Flask, FastAPI, requests, httpx, SQLAlchemy), JSON logs carrying trace and request IDs, Prometheus metrics, and an in-memory span store the gateway stitches into a trace waterfall. Optional OTLP export. Also: remove the unauthenticated DELETE /api/product/<slug>; Bicep and provision deploy payment and inventory; CI installs shop_common per suite; pattern pages with live demos and screenshots in the README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
4 of 12 patterns are now live, each with a page explaining it, when not to use it, and a demo against the real services.
no such table: product)./api/order-summaryfans out to user, order, catalog and inventory; the page lists every call, status, timing and the shared request ID./metrics.What changed
services/payment(5104) andservices/inventory(5105), each with its own DB.shared/shop_common: OpenTelemetry tracing, JSON logs with trace/request IDs, Prometheus metrics,/health/db,/debug/spans,/metrics.DELETE /api/product/<slug>(only used by the old benchmark).provision.pydeploy payment and inventory; images includeshop_common; gunicorn runs 1 worker + 4 threads so the span store sees every request. Not deployed.shop_common.Screenshots
See the README section "The live demos" (images in
docs/screenshots/).Test plan
make test: 38 passed across 7 suitesmake smokewithmake runup: 15 passed, 3 skipped (Azure-only), including table isolation, bounded-context views and a cross-service tracenpm run buildandaz bicep buildpass🤖 Generated with Claude Code