How sqshq/piggymetrics works
Main Components
• Functional Microservices:
– Account Service (deals with account data, validation, and user inputs).
– Statistics Service (performs financial calculations, tracks time series data).
– Notification Service (manages user notification settings and email reminders).
• Infrastructure and Supporting Services:
– Auth Service (handles OAuth2 authentication and authorization using both password and client credentials).
– API Gateway (using Zuul) that routes incoming requests to the proper service.
– Config Service (centralized configuration management using Spring Cloud Config; note the “shared” configuration files shown in the file tree).
– Service Registry (Eureka Server for service discovery and registration).
– Monitoring Service (collects Hystrix metrics, with support from Turbine for aggregating stream data).
– Docker & Deployment: Each microservice is containerized (as indicated by Dockerfiles for each service) and orchestrated via docker-compose.
– Supporting Components: MongoDB instances are set up for persistence in each service, and there is also a RabbitMQ instance for Spring Cloud Bus (as noted in the README under log analysis and configuration sections).
Relationships and Interactions
• The Service Registry (Eureka) is used by all services for service discovery and load balancing (via Ribbon). Illustrate how each service registers itself and also makes calls to Eureka.
• Monitoring elements: Include a Monitoring or Hystrix Dashboard component (with Turbine Stream service as its companion) that collects circuit breaker metrics from all services.
• Optionally, include the messaging system (RabbitMQ) used by Spring Cloud Bus to propagate configuration changes and refresh events.
Architectural Patterns and Technologies
• Microservice architectural pattern with independently deployable services.
• RESTful API communication between services using Feign clients, with integrated mechanisms such as Ribbon (client-side load balancing) and Hystrix (circuit breaker for fault tolerance).
• Centralized configuration management (Spring Cloud Config) and service discovery via Eureka.
• Security implemented using OAuth2 through a dedicated Auth Service.
• All services are containerized using Docker and orchestrated with docker-compose.
• The separation between configuration (Config Service), authentication (Auth Service), routing (Gateway), and business functionalities (Account, Statistics, Notification) is a key design principle here.
Final Touches
• That any dependencies are depicted, including failure safeguards (e.g., circuit breakers in the connections between services as implemented by Hystrix).
• If space allows, include a small inset or sidebar that indicates the flow of Continuous Delivery/CI (Travis CI building Docker images that are then deployed) since that is part of the overall deployment architecture.