How saiupadhyayula/spring-boot-microservices works
Project type and overall purpose
• This is a containerized, Kubernetes-oriented Spring Boot microservices ecosystem.
• It demonstrates: service discovery (Eureka), an API Gateway, synchronous REST calls, asynchronous eventing via Kafka, per-service data stores, observability (Prometheus, Grafana, Zipkin), and centralized auth (Keycloak).
File structure to extract main components
• Infrastructure folder (k8s/infrastructure) defines core platform services:
– discovery-server (Eureka)
– api-gateway (Spring Cloud Gateway)
– kafka + zookeeper (event broker)
– keycloak + mysql (identity, auth)
– prometheus, grafana, zipkin (observability, tracing)
– mongo, postgres-inventory, postgres-order (databases)
• Services folder (k8s/services) deploys individual business microservices:
– inventory-service (manages inventory, backed by Postgres)
– product-service (manages product catalog, backed by e.g. Mongo or Postgres)
– order-service (manages orders, backed by Postgres)
– notification-service (listens for OrderPlacedEvent on Kafka, sends notifications)
• Source code folders correspond exactly to these runtimes.
Extract architectural patterns from the README and code
• API Gateway routes all external traffic
• Eureka server enables service registration & discovery
• Microservices communicate:
– Synchronously via REST (through WebClient configs in order-service)
– Asynchronously via Kafka topics (OrderPlacedEvent)
• Each service has its own database (Postgres or Mongo) – database per microservice pattern
• Cross-cutting concerns handled by infrastructure: security (Keycloak), tracing (Zipkin), metrics (Prometheus), dashboards (Grafana)
Components & relationships
– API Gateway
– Discovery Server
– Product Service
– Inventory Service
– Order Service
– Notification Service
– Kafka Cluster + Zookeeper
– Keycloak (with MySQL)
– Postgres (Order DB)
– Postgres (Inventory DB)
– MongoDB (Product DB)
– Prometheus, Grafana, Zipkin
– Client → API Gateway → Discovery Server (for routing lookup) → Services
– Order Service → Inventory Service (REST call)
– Order Service publishes OrderPlacedEvent → Kafka → Notification Service
– Services connect to their own DBs
– Services / Gateway send metrics & traces → Prometheus & Zipkin
– Grafana reads metrics from Prometheus
– Keycloak secures API Gateway and microservices (OIDC tokens)
c. Key architectural patterns to note:
– API Gateway pattern
– Service Discovery (Eureka)
– Circuit breaker / resilient calls (if present in WebClientConfig)
– Event-driven architecture (Kafka topics)
– Database per service
– Observability pipeline (metrics, tracing, dashboards)
– Centralized authentication/authorization
d. Technologies (annotate each component):
– Spring Cloud Gateway, Eureka Server, Spring Boot
– Spring WebFlux or WebClient, Spring Kafka
– PostgreSQL, MongoDB
– Apache Kafka, Zookeeper
– Keycloak, MySQL
– Prometheus, Grafana, Zipkin
– Kubernetes (Deployments, Services in k8s folder), Docker