All Projects
BackendDeployment
Microservices Architecture (Spring Boot)
Production microservices: Spring Boot, Apache Kafka event streaming, OAuth2/Keycloak auth, gRPC inter-service calls, API gateway, Docker. Event-driven design with per-service PostgreSQL isolation.
Approach
Event-driven Kafka + Keycloak OAuth2 + gRPC sync calls + Spring Cloud Gateway
Tech Stack
JavaSpring BootApache KafkaKeycloakgRPCDockerPostgreSQL
Keywords
Spring BootKafkaKeycloakgRPCDockerJavaMicroservices
Deep Dive
Production microservices system with event-driven architecture.
Service Topology
Client → Spring Cloud Gateway (API gateway)
→ Keycloak (OAuth2/OIDC auth)
→ Service A ←→ Kafka ←→ Service B
→ Service C --gRPC--> Service D
→ PostgreSQL (per-service DB isolation)
Key Decisions
| Problem | Solution | Rationale |
|---|---|---|
| Async communication | Apache Kafka | Decoupling + durability + replay |
| Sync internal calls | gRPC | Typed contracts + 5–10× faster than REST |
| Authentication | Keycloak OAuth2 | Centralized, industry-standard |
| Service routing | Spring Cloud Gateway | Filter chains + circuit breaking |
Kafka Events OrderCreated, PaymentProcessed, InventoryUpdated — 7-day retention enables service replay after failures.
gRPC vs REST
- ▸Internal (service→service): gRPC (binary, typed, fast)
- ▸External (browser→gateway): REST/JSON (compatibility, debuggability)
Keycloak OAuth2 JWT tokens with service-level scopes. Service accounts for machine-to-machine auth. Token introspection at gateway — no per-service auth logic.