sommario
This report describes the design and implementation of an e-commerce platform for wine sales built following a microservices architecture. The system is composed of seven independent services — users, catalog, inventory, cart, orders, and payments — coordinated by an API gateway and communicating via RabbitMQ as a message broker. The main objective of the project is to address two fundamental challenges of distributed systems: managing transactions that span multiple services without global ACID transactions, and maintaining the consistency of a distributed cache. The first challenge is solved through the implementation of the Saga Pattern in choreographed style, where services react to events published on a RabbitMQ topic exchange without a centralized orchestrator. The second is addressed through Redis, used both as a cache layer for the catalog and for temporary persistence of guest user carts, with asynchronous key invalidation when the underlying data changes. User authentication is handled via JSON Web Tokens, while payments are delegated to Stripe with cryptographic verification of incoming webhooks. The entire system is containerized with Docker Compose, which manages the lifecycle of all infrastructure components including six PostgreSQL databases, RabbitMQ, and Redis.
prodotti