SDA Assignment
SDA Assignment
c. Event-Driven Architecture:
Description: Services emit events and react to events from other services.
Pros:
2. High decoupling and flexibility.
Scalable and resilient.
3. Promotes reactive programming.
Cons:
1. Eventual consistency must be managed.
2. Difficult to trace full business transactions.
Use Cases:
1. Suitable for e-commerce, banking transactions, and audit trails where decoupling
and responsiveness are critical.
User to Account Service: REST APIs for creating and managing accounts.
Transaction Service: Uses REST for initiating transactions and Kafka for transaction
updates.
Notification Service: Listens to transaction and user events via RabbitMQ.
Audit Service: Event-driven, subscribes to all service events for logging.
Loan Service: REST for loan application, Kafka for status updates.
Design Justification:
Scalability:
Fault Tolerance:
Microservices isolate failures; one service failing does not crash the entire system.
Monoliths are more prone to system-wide crashes.
Maintainability:
Microservices enable easier updates, testing, and deployment due to service isolation.
Monoliths become increasingly complex and difficult to manage over time.
Industry Example: