Browsing is a high-volume read path where caches and slightly stale indexes are acceptable. Checkout is lower-volume but correctness-critical: price and inventory must be revalidated and recorded authoritatively. Independent paths let each scale and fail differently.
Example bandwidth calculation: 100,000 reads/s × 10 KB is roughly 1 GB/s of uncached response payload before protocol overhead. CDN/cache hit rate therefore materially changes origin cost and capacity. This is a planning calculation, not a promise that all reads are identical.
Command path vs. event path
Commands ask an owner to perform a decision now (reserve inventory, authorize payment). Use synchronous calls only when the result is required to continue, with strict timeouts.
Events state a fact that already happened (order confirmed). Consumers react independently; retries and duplicate delivery are expected.
Trust boundaries
Clients enter through an edge protected by WAF and identity. Internal services use workload identity, authorization, and encrypted transport. Payment-provider and seller integrations are treated as external/untrusted dependencies.
4. How and why the system is divided
A service boundary should follow a business capability, data ownership, and a change/scaling boundary—not simply one service per database table.
Long-running physical workflows and partner integrations.
Authoritative payment or catalog data.
Notification
Templates, delivery preferences, send attempts
Can retry/fail independently and should not block checkout.
Order lifecycle decisions.
Do not start with dozens of services: keep a modular monolith if team boundaries, independent scaling, or deployment needs do not justify distributed operations. Split when ownership and measured bottlenecks are clear.
5. Example technology stack and why
One credible AWS-oriented stack for this scale. The service boundaries matter more than the brand names; equivalent managed services can be substituted in other clouds.
Layer
Example choice
Why / design note
Web storefront
TypeScript + React / Next.js
Reusable components, SSR for product discovery/SEO, client hydration for interactive cart. Avoid placing payment secrets in the browser.
Mobile
Native iOS/Android or React Native
Use the same domain APIs; push notifications remain a separate asynchronous capability.
Edge/static assets
Route 53 + CloudFront + AWS WAF + S3
Global static/media delivery, cache policies, TLS, bot/rate controls. Version and invalidate content intentionally.
Ingress / API
API Gateway or ALB + BFF
Gateway handles routing/throttling; a BFF composes client-friendly responses. Avoid putting business transactions in a generic gateway.
Backend runtime
Java/Kotlin (Spring Boot) or Go; containers on ECS/EKS
Strong ecosystem and operational flexibility. Choose a primary language per team; avoid a polyglot service per function.
Transactions, unique constraints, and order state consistency. Partition and scale deliberately; do not assume a single writer is infinite.
Cart / high-scale key-value
DynamoDB
Predictable key-based reads/writes, TTL, and partition scaling. Use conditional writes for cart versions and idempotency records.
Inventory
DynamoDB conditional updates or relational store with atomic transactions
Choose based on reservation/query model. The stock owner performs atomic conditional reservation; cache is never the final stock authority.
Cache
ElastiCache for Redis + CloudFront cache
Redis for hot product fragments, sessions/rate-limit counters where suitable; CDN for public static/cacheable responses. TTL + invalidation, stampede protection, and no cache-as-authority for stock/payment.
Search
OpenSearch
Full-text, facets, and ranking over a denormalized index rebuilt/updated from catalog and offer events.
Events / queues
Amazon MSK (Kafka) for durable event streams; SQS for work queues; SNS/EventBridge for fan-out patterns
Select by ordering, replay, consumer model, retention, and operational skill. Use outbox, schema registry/contracts, bounded retries, and DLQs.
Media / documents
S3
Object storage for images/videos; metadata in Catalog DB; CDN serves derivatives. Do not put blobs in order database rows.
Identity / secrets
Amazon Cognito or enterprise IdP; IAM roles; Secrets Manager + KMS
OIDC/OAuth flows, workload identity, key rotation, least privilege, and managed secret delivery.
Observability
OpenTelemetry + CloudWatch; managed Prometheus/Grafana or equivalent
Common trace context, RED metrics (rate/errors/duration), structured logs, dashboards, and alerts tied to SLOs.
Delivery / IaC
Terraform or AWS CDK; GitHub Actions/CodePipeline; canary/blue-green deployments
Client requests a category/search page. CDN serves static assets and only caches public responses with an explicit cache key and policy.
API/BFF authenticates when necessary, validates query limits, and calls Search. Search reads its own index, not a fan-out of service databases.
Search returns product and offer IDs; BFF fetches/cache-reads presentation details in bounded batches, avoiding N+1 calls.
Product detail checks Catalog and current Offer. Displayed availability is an estimate; final stock is checked at checkout.
Catalog/Offer changes publish events through outbox; indexer updates OpenSearch idempotently. Track indexing lag as a metric.
Checkout (orchestrated saga)
Client sends POST /v1/checkouts with cart ID/version, address ID, payment token reference, and a unique Idempotency-Key.
Checkout returns an existing result for the same customer/key; otherwise validates identity, cart version, seller/offer eligibility, price, tax, address, and delivery promise.
Order Service writes PENDING order, immutable item/price/address snapshots, saga state, and an outbox event in one local DB transaction.
Saga requests Inventory to reserve all lines atomically with a stable order/attempt key and an expiry. Inventory returns reserved or rejected; partial reservation is rolled back inside the inventory owner.
Payment authorizes the amount with a stable provider idempotency key. A timeout is an unknown outcome, not proof of failure; query/retry using the same key.
On success, Order transitions to CONFIRMED and publishes OrderConfirmed from the outbox. Return order ID and status to client.
Fulfillment consumes the event and creates work; Notification and Analytics consume independently. Consumers store event IDs to make at-least-once delivery safe.
If authorization is declined, release the reservation and mark payment/order failed. If later cancellation occurs, void authorization or refund according to whether capture already happened.
Compensation is a business operation: release reservation, void authorization, cancel fulfillment, or issue refund. It is not a database rollback across services. If compensation fails, retain a visible pending state, retry safely, and alert operations/customer support.
Premium question 11
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 12
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 13
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 14
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 15
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 16
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 17
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 18
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 19
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 20
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 21
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 22
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 23
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 24
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 25
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 26
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 27
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 28
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 29
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 30
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 31
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 32
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 33
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 34
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 35
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 36
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 37
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 38
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 39
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 40
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 41
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 42
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 43
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 44
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 45
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 46
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 47
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 48
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 49
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 50
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 51
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 52
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 53
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 54
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 55
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 56
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 57
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 58
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 59
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 60
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 61
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 62
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 63
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 64
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 65
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 66
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 67
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 68
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 69
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 70
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 71
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 72
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 73
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 74
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 75
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 76
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 77
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 78
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 79
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 80
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 81
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 82
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 83
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 84
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 85
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 86
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 87
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 88
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 89
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 90
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 91
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 92
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 93
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 94
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 95
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 96
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 97
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 98
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 99
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 100
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 101
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 102
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 103
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 104
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 105
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 106
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 107
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 108
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 109
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 110
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 111
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 112
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 113
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 114
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 115
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 116
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 117
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 118
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 119
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 120
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 121
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 122
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 123
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 124
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 125
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 126
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 127
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 128
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 129
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 130
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 131
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 132
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 133
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 134
Detailed answer, worked example, and practice explanation.
Pro only
Premium question 135
Detailed answer, worked example, and practice explanation.