A large Spark job on Amazon EMR runs nightly, can tolerate losing some worker nodes, and costs too much. What lowers its cost?
- Exam domain
- Data Ingestion and Transformation34% of the exam
- Difficulty
- Medium
- In this mock
- 33 questions on this domainPractise this domain
Why the exam asks this
Task Statement 1.2: Transform and process data.
Objective in the exam guide: Optimize costs while processing data.
Processing is usually the biggest data platform bill. Purchasing options and cluster lifecycle are the main levers.
Why B is the answer
Use Spot Instances for task nodes, keeping core and primary nodes on-demand
Spot Instances for interruption-tolerant task nodes cut cost while core nodes keep the data safe.
Remember: Cut EMR cost with Spot task nodes and clusters that stop when done.
How it works
Spot Instances use spare EC2 capacity at a discount, but can be interrupted.
In EMR, task nodes only compute and hold no HDFS data, so they suit Spot; core and primary nodes stay on-demand.
Shutting clusters down after the job avoids paying for idle time.
Clues in the question
The words that point to the answer, and what each one tells you.
- Can tolerate losing some worker nodes
- Interruption-tolerant: Spot.
- Costs too much
- Change the purchasing option.
In detail
- Task nodes do not store HDFS data, so losing them only slows the job.
- Right-sizing and turning clusters off after jobs also lower cost.
Side by side with look-alikes
| Node type | Spot suitable? |
|---|---|
| Task nodes | Yes, compute only |
| Core nodes | Risky, they hold data |
| Primary node | No |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Move the job to a single Lambda functionWrong
Lambda cannot run a large Spark job.
B. Use Spot Instances for task nodes, keeping core and primary nodes on-demandRight
Cut EMR cost with Spot task nodes and clusters that stop when done.
C. Use only on-demand instances, sized largerWrongMost tempting
Larger on-demand instances cost more.
Why it tempts: Larger instances can finish faster. But on-demand is the expensive option, and size raises the hourly cost.
D. Run the job twice for safetyWrong
Running twice doubles cost.
In practice
- Use instance fleets with several instance types to improve Spot availability.
Use case
An illustrative scenario, not a real incident.
A team runs EMR task nodes on Spot and terminates the cluster after each nightly job.
See how it works
flowchart TB P["Primary node: on-demand"] --> C["Core nodes: on-demand, hold data"] P --> T["Task nodes: Spot, compute only"]
How to read this chart
- "Primary node: on-demand" leads to "Core nodes: on-demand, hold data" and "Task nodes: Spot, compute only".