DVA-C02 Question 9
Single answerAn e-commerce company is building a microservices-based application to handle user orders. The application consists of separate services for order processing, payment, and inventory management. The company wants to ensure loose coupling between services while enabling real-time communication. Which architectural pattern is best suited for this scenario?
- A
Event-driven architecture
- B
Monolithic architecture
- C
Orchestration-based architecture
- D
Choreography-based architecture
Show answer and explanation
Correct answer: A
Explanation
Event-driven architecture is the best choice for this scenario because it promotes loose coupling between microservices while enabling real-time communication. Each service can publish or subscribe to events without direct dependencies on other services, making it highly scalable and maintainable for a microservices-based application.
- A. Correct.
Event-driven architecture is ideal for microservices as it allows services to communicate asynchronously through events, ensuring loose coupling and real-time updates. This is suitable for the described use case.
- B. Incorrect.
Monolithic architecture is a single, tightly coupled application structure, which goes against the microservices design principle. It is not appropriate for this scenario.
- C. Incorrect.
Orchestration-based architecture involves a central controller coordinating service interactions, which introduces tighter coupling. It is less suited for the goal of loose coupling.
- D. Incorrect.
Choreography-based architecture allows services to interact through reactive events and is loosely coupled, but it is typically more suitable for complex workflows with high inter-service dependencies. While similar to event-driven architecture, the scenario doesn't explicitly describe such a workflow.