How mayank-yadav26/springboot-microservices works
Main Components
• API Gateway: Acts as the single entry point routing incoming requests to the proper backend services. Emphasize its integration with Spring Cloud Gateway and potential use of Spring Security for authentication and Resilience4j for circuit breaking.
• Discovery Server (Eureka): Central registry for all microservices enabling dynamic service discovery. Illustrate Eureka’s role in eliminating hardcoded URLs and enabling dynamic scaling.
• Microservices:
– Product Service (with MongoDB): Emphasize its flexible schema design, storing products with fields such as id, name, description, and price.
– Inventory Service (with MySQL): Highlight the relational database ensuring transactional integrity and stock consistency.
– Order Service (with MySQL): Include its responsibilities regarding processing orders, maintaining transactional integrity, and using Kafka for event-driven communication (sending order placed events).
– Notification Service: Show that it processes events (for example, order events) and likely triggers notifications.
• External Systems & Infrastructure:
– Kafka Messaging Queue: Indicate its role in the order service for event communication.
– Monitoring Tools: Include Prometheus (and associated Actuator endpoints) for health and metrics monitoring.
• Kubernetes (k8s) Deployment: Represent the deployment manifests, Kind cluster, and your k8s configurations that are used for container orchestration and scaling.
Relationships and Interactions
• Monitoring/metrics flow from each service to Prometheus.
Architectural Patterns and Design Principles
• Microservices pattern by individually isolating each service.
• Mention the use of API Gateway for abstraction, load balancing, and security.
• Service discovery (Eureka) which abstracts inter-service communication.
• Use of event-driven patterns with Kafka in the Order Service.
• Underline the separation of concerns by assigning different databases for structured (MySQL) vs. unstructured (MongoDB) data.
Technologies and Frameworks
• Spring Boot (core framework for microservices)
• Spring Cloud Gateway (API routing, security, and resiliency)
• Eureka (service registry/discovery)
• Resilience4j (circuit breaker, retry mechanisms)
• Kafka (messaging/event streaming)
• MongoDB (NoSQL database for Product Service)
• MySQL (relational database for Inventory & Order Services)
• Kubernetes (for container orchestration and deployment)
• Prometheus (monitoring and health check endpoints)