Product discovery
Một process, EMBEDDED. Tập trung customer workflow, business rules, persistence, feedback và failure behavior.
Kiến thức chung · Beginner · Dành cho startup và product team
Đừng thiết kế distributed production topology trước khi sản phẩm chứng minh ranh giới nào thật sự cần phân tán. Giữ business target ổn định; bắt đầu local và chỉ chuyển sang peer khi có lý do cụ thể.
Ứng dụng hiện có
Chọn một việc có kết quả dễ đối chiếu, chẳng hạn tính giá đơn hàng. API hiện tại vẫn nhận yêu cầu, kiểm tra quyền và trả kết quả. Thử thay riêng lời gọi từ API đến hàm tính giá trong môi trường phát triển.
billing.quote, rồi gửi lại đúng yêu cầu mẫu với chế
độ Embedded.01 · Default
stable business target + explicit contract
trước: local handler trong modular monolith
sau: peer process hoặc deployed service khi có bằng chứng
Hạ tầng không biến mất. Quy tắc này chỉ hoãn proxy, container, replica, credential, rollout và on-call work cho tới khi sản phẩm có lý do cụ thể để trả chi phí đó.
02 · Product discovery
Một executable và một debug session vẫn có thể tổ chức theo capability ổn định. Caller biết target và payload contract, không cần biết handler đang ở module, process, container hay host nào.
customer.profile.update → customer module
billing.invoice.create → billing module
inventory.stock.reserve → inventory module
Trong CoAkka Runtime, shape này dùng EMBEDDED, local route
port 0 và không mở TCP listener. Target ownership, bounded
admission, timeout, reply/deadletter, lifecycle và diagnostics vẫn là
contract thật; team không giả vờ local function đã là remote service.
03 · Practical progression
Một process, EMBEDDED. Tập trung customer workflow, business rules, persistence, feedback và failure behavior.
Thêm process khi một ngôn ngữ hoặc runtime khác tạo lợi thế thật. Chạy trực tiếp từ IDE, loopback rõ ràng, breakpoint ở cả hai phía.
Thêm container/Compose để chứng minh package, dependency isolation, CI và network boundary; không dùng container để khám phá business logic.
Tách deployment khi ownership hoặc operational evidence mạnh hơn chi phí của service mới.
04 · Decision gate
Không tách chỉ vì sơ đồ microservice nhìn “đúng chuẩn” hơn. Mỗi service mới thêm packaging, config, credentials, rollout, monitoring, failure modes và on-call work.
05 · Evolution contract
Target name; payload identity/schema; reply/deadletter expectation; timeout/cancellation policy; business owner của handler.
Route endpoint và generation; process owner; network mode; bind/advertise; deployment, scaling và recovery policy.
Call site không nên phải nhận thêm private controller, URL builder, status-code convention, retry wrapper và correlation scheme chỉ vì handler chuyển sang process khác.
Giữ capability local cho tới khi một nhu cầu development, ownership, security, isolation hoặc scaling đo được mạnh hơn chi phí vận hành của service mới.
Ứng dụng vẫn sở hữu transaction, idempotency, payload evolution, authentication/authorization, business retry, discovery input, SLO và incident response. CoAkka Runtime không dùng topology để đoán business policy.