Running Big Data Frameworks with Amazon EMR
This lesson explains how Amazon EMR runs open-source big data frameworks, such as Apache Spark, Hive, Presto and HBase, at scale on managed clusters or serverless capacity.
Learning outcomes
After completing this lesson, you will be able to:
- Choose between EMR on EC2, EMR on EKS and EMR Serverless.
- Describe the primary, core and task nodes of an EMR on EC2 cluster.
Deployment options
Amazon EMR can run in three ways, which trade control against management. EMR on EC2 runs clusters of instances in three roles: a primary node that coordinates the cluster, core nodes that run tasks and store data, and task nodes that only run tasks and suit Spot Instances. It gives full control of instances and configuration. EMR on EKS runs Spark jobs on an existing Kubernetes cluster, sharing it with other workloads. EMR Serverless has no clusters: capacity is provided for each job and scales automatically. The following table summarises the options.
| Option | Characteristics |
|---|---|
| EMR on EC2 | Clusters of primary, core and task nodes; full control of instances and configuration |
| EMR on EKS | Spark jobs on an existing Kubernetes cluster |
| EMR Serverless | No clusters; capacity scales per job |
Cluster design on EC2
An Amazon EMR cluster on EC2 has three node types. The primary node manages the cluster, core nodes run tasks and store HDFS data, and task nodes only run tasks. Because task nodes hold no data, they suit Spot Instances: losing one costs only the work in progress.
With EMRFS, clusters read and write data in Amazon S3 rather than HDFS, so the data outlives the cluster. Clusters can then be transient: started for a job, used to process data and terminated, so the customer pays only while work runs. Long-running clusters can cover their core nodes with Reserved Instances or Savings Plans.
The following diagram shows the three node types and where the data lives.

EMR cluster design
Cutting the cost of nightly Spark jobs
A long-running EMR cluster of 40 On-Demand instances runs Spark jobs for three hours each night and sits idle the rest of the day.
| Change | Effect |
|---|---|
| Keep data in S3 through EMRFS | The cluster holds no data that must be kept |
| Launch a transient cluster each night and terminate it | No idle cost for 21 hours a day |
| Use Spot Instances for task nodes | Large discount; losing a task node loses no data |
| Or move to EMR Serverless | No cluster to size or manage at all |
The jobs run unchanged, at a fraction of the cost.
What is the difference between EMR on EC2 and EMR Serverless?
Show answer
EMR on EC2 runs clusters that you size and configure. EMR Serverless runs Spark and Hive jobs without clusters and scales resources for each job.
Exam Tips
Remember for the exam
- For existing Spark or Hadoop jobs, use EMR.
- To reduce EMR cost, run task nodes on Spot Instances.
- To avoid running clusters between jobs, keep data in S3 and use transient clusters or EMR Serverless.