How saiupadhyayula/springboot-microservices-project works
Main Components
• API Gateway Service – Acts as the entry point and request router. It includes its own configuration (e.g., SecurityConfig) and is responsible for handling client requests.
• Configuration Server – Provides central configuration management for all microservices.
• Discovery Server – Serves as the service registry where each microservice registers itself, enabling dynamic discovery and communication.
• Inventory Service – Manages inventory data. It includes controllers, repositories, and model definitions, and even has some predefined data (data.sql).
• Order Service – Handles order processing and interacts with other services. Notice it includes an InventoryClient, security configuration, controllers, models, and repository.
• Product Service – Manages product data and includes dedicated controllers, security configuration, models, and the repository.
• Notification Service – Responsible for notifications (for example, sending emails) when events such as orders are placed.
Out Their Interactions
• Clients (or external consumers) will start by sending requests to the API Gateway.
• API Gateway will route these requests to the appropriate microservices. For instance, product or order management requests go to the corresponding services.
• All microservices (Inventory, Order, Product, Notification) should be registered with the Discovery Server, so they become discoverable.
• They also use the Configuration Server to load centralized configuration properties.
• The Order Service might communicate directly with the Inventory Service (using InventoryClient) to check product availability and with the Notification Service to send order confirmations.
– API Gateway sends incoming requests to the microservices.
– Each microservice registers with and discovers peers via the Discovery Server.
– The Configuration Server supplies configuration to each service.
– There are explicit client calls between the Order Service and other domain services (such as Inventory and Notification).
Architectural Patterns and Technologies
• Microservices architecture using Spring Boot.
• Centralized configuration management via a dedicated Configuration Server.
• Service discovery through Discovery Server.
• API gateway pattern to manage routing, security, and entry point concerns.
• Service-to-service communication (potentially using REST/HTTP and/or client libraries such as Feign for invoking other microservices).
• Each service follows standard layered architecture (Controller, Service/Business Logic, Repository, Model).
Final Design Notes for the Principal Software Engineer
– Start by sketching a high-level overview with external clients communicating with the API Gateway.
– Then, detail the connectivity:
• API Gateway routes traffic.
• Configuration Server and Discovery Server serve all registered services.
– If desired, add additional layers (such as repository and controller layers) within each service for more granularity, but a focus on service-level interactions is usually sufficient at the system design level.