본문으로 건너뛰기

Microservices

Domain Decomposition

Core Domain

ServiceStackData Store
product-catalogPython/FastAPIDocumentDB
inventoryGo/GinAurora DSQL
cartGo/GinElastiCache (Valkey)
searchPython/FastAPIOpenSearch

User Domain

ServiceStackData Store
user-accountJava/Spring BootAurora
user-profilePython/FastAPIDocumentDB
reviewPython/FastAPIDocumentDB
wishlistPython/FastAPIDocumentDB

Fulfillment Domain

ServiceStackData Store
orderJava/Spring BootAurora
paymentJava/Spring BootAurora
shippingGo/GinAurora DSQL
returnsJava/Spring BootAurora

Business Domain

ServiceStackData Store
notificationPython/FastAPIDocumentDB
recommendationPython/FastAPIDocumentDB
analyticsPython/FastAPIClickHouse / S3
sellerJava/Spring BootAurora

Platform Domain

ServiceStackData Store
api-gatewayGo/Gin
event-busGo/GinMSK (Kafka)
pricingJava/Spring BootAurora
warehouseJava/Spring BootAurora

Technology Stack Summary

StackCount서비스
Go / Gin5api-gateway, event-bus, cart, inventory, shipping
Python / FastAPI8product-catalog, search, user-profile, review, wishlist, notification, recommendation, analytics
Java / Spring Boot7user-account, order, payment, returns, seller, pricing, warehouse

Container Configuration

설정
Image Registry123456789012.dkr.ecr.us-east-1.amazonaws.com/shopping-mall/*:latest
Container Port8080
K8s Service Port80 → targetPort: 8080
Health Probes/health/ready, /health/live, /health/startup
imagePullPolicyAlways (:latest 태그 노드 캐시 방지)

Inter-Service Communication

  • HTTP: mall_common/service_client.py — httpx async로 서비스 간 HTTP 호출
  • Kafka: event-bus 서비스를 통한 비동기 이벤트
  • K8s Service DNS: {service}.{namespace}.svc.cluster.local

K8s Namespaces

NamespaceServices
core-servicesproduct-catalog, inventory, cart, search
user-servicesuser-account, user-profile, review, wishlist
fulfillment-servicesorder, payment, shipping, returns
business-servicesnotification, recommendation, analytics, seller
platformapi-gateway, event-bus, pricing, warehouse

Build & Deploy

# 전체 서비스 빌드
scripts/build-and-push.sh

# Go: context=src/
# Java: Maven build, context=src/
# Python: copies mall_common into service context
Python 공유 의존성

Python 서비스는 mall_common 패키지를 공유합니다. mall_common/tracing.pyredis + motor 패키지를 requirements.txt에 포함해야 합니다.