How pelumiade/library-management works
Main Components
• Admin API Service: This service handles operations such as adding, updating, or removing books, managing users, and tracking book lending.
• Frontend API Service: This service is tailored for end-user interactions including user enrollment, browsing books, borrowing, and returning books.
• Message Broker (RabbitMQ): The intermediary that facilitates asynchronous, event-driven communication between the two services.
• Databases: Each service has its own isolated database (termed “authoritative” for the Admin API and a “mirror” for the Frontend API).
• Containerization: Docker and Docker Compose are used to deploy both services along with the RabbitMQ management interface.
• Deployment Infrastructure: The system is deployed on AWS EC2 with provided endpoints for each service and RabbitMQ.
Architectural Relationships
• How the Admin API publishes messages to RabbitMQ whenever there’s a change (for example, when books are added or updated).
• How the Frontend API subscribes to the relevant RabbitMQ queues to consume messages and keep its catalog in sync.
• That both services expose RESTful endpoints (with their FastAPI-driven documentation available at separate URLs) and use separate connection pools to their respective databases.
• Interactions between external clients (users and administrators) and the relevant API endpoints.
Architectural Patterns and Design Principles
• Microservices: Emphasize the separation of concerns, with two dedicated services operating independently.
• Event-Driven Communication: Detail the asynchronous message passing using RabbitMQ for data consistency between services.
• Database Isolation: Note that each service uses its own database to maintain integrity and performance.
• Containerization: Include Docker to indicate how services are packaged and deployed, reinforcing scalability and ease of deployment.