DVA-C02 Question 11
Single answerYou are designing a serverless application on AWS that processes user-uploaded images. The images need to be resized into multiple formats and stored in Amazon S3. Each resize operation should be independent of others, and the architecture should scale automatically as the application grows. Which architectural pattern is most suitable for this use case?
- A
Monolithic architecture
- B
Event-driven architecture
- C
Microservices with orchestration
- D
Microservices with choreography
Show answer and explanation
Correct answer: B
Explanation
An event-driven architecture is best suited for this scenario as it allows the processing of user-uploaded images to scale independently. Each image upload can trigger an event (e.g., an S3 event notification) that invokes an AWS Lambda function to handle resizing. This pattern supports scalability, reliability, and loose coupling, making it an ideal choice for serverless applications with independent workflows.
- A. Incorrect.
Monolithic architecture would bundle all logic into a single application. This approach lacks scalability and independence in processing tasks, making it unsuitable for this use case.
- B. Correct.
Event-driven architecture is the most suitable option here. User uploads can trigger an event (e.g., an S3 event), which can initiate independent resizing tasks via services like AWS Lambda. This pattern provides scalability, reliability, and loose coupling.
- C. Incorrect.
Microservices with orchestration involves a central coordinator to manage workflows, which adds unnecessary complexity for this use case. The resizing tasks can be handled independently without a central orchestrator.
- D. Incorrect.
Microservices with choreography involves distributed coordination where services react to events, but it is typically used in more complex, multi-service workflows. For this use case, event-driven architecture is simpler and more effective.