Part 16 · Capstone & Mock Interview

Đóng khung Order + Payment trước khi chọn công nghệ

Capstone nhỏ nhưng phải có invariant thật: không charge trùng, trạng thái order giải thích được và recovery không phụ thuộc may mắn.

Functional scope

Create/get order, authorize/capture hoặc simulate payment, observe status và retry/reconcile. Non-goals: full catalog, shipping, real card data và multi-currency accounting nếu chưa có requirement.

Invariants

Mỗi client command có identity; một idempotency key không tạo hai payment effects; state transition hợp lệ; money dùng decimal/minor units; mọi terminal decision có audit evidence.

Quality attributes

Đặt workload, latency/availability target, RPO/RTO, data retention, privacy và cost envelope. Chọn service boundary theo ownership/change/failure—not để khoe microservices.

Views và risks

Context/container/component, sequence sync/async, data/state machine, deployment và failure map. Threat model trust boundaries; pre-mortem duplicate, partial failure, poison event, stale config và overload.

C4 Model · OWASP ASVS