CloudGuild · Blog · Cheat sheets · Lessons · Certifications
Understanding Event-Driven Workloads with AWS Lambda
Learn why AWS Lambda is the best choice for running event-driven code without managing servers. Explore the question and options in detail.
Choosing the right AWS service for event-driven workloads can confuse many candidates. The options may seem similar at first glance, but understanding the nuances can lead to the right choice.
The question
A company wants to run event-driven code for unpredictable, spiky workloads without managing servers or paying for idle capacity. Which service fits BEST?
- A. Amazon EC2 reserved instances
- B. AWS Lambda
- C. Amazon EMR
- D. AWS Outposts
Think before you scroll
Before jumping to an answer, consider the requirements: the need for event-driven execution, handling unpredictable workloads, and avoiding server management. Each option addresses different use cases, so weigh them carefully against these criteria.
The answer
The correct option is B. AWS Lambda. AWS Lambda runs code on demand, automatically scales with workload, and charges only for the compute resources used. This makes it the perfect fit for unpredictable, spiky workloads without the need for server management.
Why the other options lose
- A. Amazon EC2 reserved instances: This option requires managing servers, which contradicts the requirement for serverless operation. Reserved instances are also not ideal for spiky workloads, as you pay for capacity regardless of usage.
- C. Amazon EMR: While Amazon EMR can handle large-scale data processing, it requires cluster management and is not specifically designed for event-driven code execution. It’s not ideal for unpredictable workloads that need instant scaling.
- D. AWS Outposts: This service extends AWS infrastructure to on-premises environments. It involves managing hardware and is unsuitable for the serverless, event-driven model required in this scenario.
The concept behind it
The key principle here is serverless computing. AWS Lambda allows developers to run code in response to events without worrying about the underlying infrastructure. This approach is ideal for workloads that are unpredictable and do not require constant resources.
Exam trap to remember
Remember: for event-driven, unpredictable workloads, choose serverless services like AWS Lambda. Server management options will not meet the requirements.