How microservices-patterns/ftgo-application works
Project type and purpose
• This is an example microservice application (“FTGO”) illustrating the patterns in the “Microservice Patterns” book.
• It is a polyglot microservice architecture composed of multiple Spring Boot services, a GraphQL API gateway, shared libraries, and infrastructure components (Kafka, MySQL, DynamoDB).
File structure
• Top-level modules correspond to individual services:
• ftgo-consumer-service
• ftgo-restaurant-service (also an AWS Lambda flavor)
• ftgo-order-service
• ftgo-kitchen-service
• ftgo-accounting-service
• ftgo-order-history-service (CQRS read model)
• ftgo-api-gateway / ftgo-api-gateway-graphql
• Shared libraries under ftgo-common*, common-swagger, test-util, JSON schema codegen.
• Infrastructure & deployment manifests: Docker Compose yaml at root, Kubernetes yamls in deployment/kubernetes and each service’s src/deployment/kubernetes.
• Build orchestrated via Gradle (including custom plugins in buildSrc).
Main components
• External client(s) or UI (Swagger UI, GraphQL client, curl).
• API Gateway (REST or GraphQL)
• Six microservices: Consumer, Restaurant, Order, Kitchen, Accounting, Order History
• Message Broker (Kafka + Zookeeper)
• Databases: MySQL (for services), DynamoDB (for order history)
• Shared libraries (logical grouping, not runtime component)
Interactions and data flows
• Client → API Gateway (HTTP/GraphQL)
• API Gateway → downstream services via synchronous HTTP or gRPC
• Services communicate inter-process via Eventuate Tram (Kafka) for commands/events
• Sagas orchestrate long-running transactions (Order creation, cancellation, revision)
• Each service subscribes to commands/events on its own topic.
• Order History service builds CQRS view by subscribing to domain events and writing to DynamoDB
• Each service persists its own state in a private database (MySQL for most; AWS Lambda variant uses embedded storage)
Architectural patterns & design principles
• Microservice per bounded context, spring-boot modules
• Database per service
• Synchronous APIs (REST, gRPC) for client-service and service-service queries
• Asynchronous messaging via Kafka for decoupling and saga orchestration (Eventuate Tram & Sagas)
• Event sourcing in Accounting service
• CQRS read model in Order History service
• API composition via API Gateway (GraphQL or REST)
Relevant technologies & frameworks
• Spring Boot (web, Data JPA)
• Eventuate Tram (transactional messaging), Eventuate Tram Sagas
• Apache Kafka & Zookeeper
• MySQL, DynamoDB (via test-local containers)
• Swagger UI for each service
• GraphQL in ftgo-api-gateway-graphql
• Docker Compose & Kubernetes for deployment
Detail but clarity
• Both sync and async interactions