What Is Amazon EMR? EC2 vs Serverless vs EKS Explained
Amazon EMR (Elastic MapReduce) is AWS’s managed platform for running distributed data processing at scale. Give it a cluster size and a framework — Apache Spark, Hive, Presto — submit your job, and EMR handles the infrastructure. It can process terabytes to petabytes of data using EC2 compute and S3 storage, without you managing servers or configuring networking. AWS EMR is the right tool when workloads are too large or too custom for Glue. If your ETL is straightforward, start with Glue. If you are running ad-hoc SQL on S3 data, start with Athena. And if you are new to EMR entirely, start with EMR Serverless: no cluster lifecycle to manage.
Simple explanation
Think of Amazon EMR like a temporary factory floor you rent by the hour. You have five billion records to sort. You hire the factory (the cluster), hand over your instructions (the Spark job), and the factory splits the work across hundreds of machines running in parallel. When the job finishes, you return the keys and stop paying.
The raw materials — your data — live in Amazon S3, not on the factory floor. The factory just processes them. This separation of compute and storage is the core design idea behind EMR. You can shut the factory down tonight and your data is still intact in S3. Spin up a new one tomorrow.
Compute and storage are separate in EMR. The cluster is disposable. Your data in S3 is permanent. Understanding this distinction will inform every decision you make about cluster sizing, cost control, and when to terminate.
The frameworks EMR runs, primarily Apache Spark, are open-source distributed processing engines that split a large computation across many machines in parallel. EMR’s job is to provision those machines, install the software, wire them together, and manage the cluster lifecycle for you.
How Amazon EMR works
When you submit a job to EMR, here is what happens in order:
- You create a cluster (or application, for Serverless) and specify the frameworks to install, instance types, and cluster size.
- EMR provisions the EC2 instances, installs Spark (or Hive, Presto, etc.), configures YARN and networking, and brings the cluster online.
- You submit a job: a Spark script stored on S3, passed as a step or job run.
- The Spark driver splits the input data into partitions. Executors on the worker nodes process those partitions in parallel across all machines.
- Results are written back to S3. The cluster terminates or stays running, depending on your configuration.
Your raw data, scripts, and output all live in S3. The cluster is purely compute: it reads from S3, processes in memory, and writes back to S3. This is what makes data lake architectures practical — the data lake sits in S3 and EMR is one of several tools that can process it, alongside Glue and Athena.
AWS manages: cluster provisioning, software installation, YARN configuration, auto-scaling, and fault recovery.
You manage: your job code, Spark configuration tuning, instance type selection, and cost controls.
EMR deployment options
Amazon EMR offers three deployment models. They share the same underlying frameworks but differ significantly in how much infrastructure you manage.
| Option | How it works | Best for | Trade-offs | Complexity |
|---|---|---|---|---|
| EMR on EC2 | You define a cluster of EC2 instances. The cluster persists until you terminate it. You submit jobs as steps. | Jobs running multiple times per day; workloads needing custom Spark config; interactive analysis; long-running clusters | You pay per instance-hour, including idle time. Requires cluster lifecycle management. | Medium to High |
| EMR Serverless | No cluster. You create an application (a named environment), then submit job runs. AWS provisions compute automatically for each run and releases it when done. | Batch jobs running once or a few times per day; infrequent large jobs; beginners wanting EMR without cluster management | 1 to 3 minute cold-start per job run. Less suitable for jobs running every few minutes. | Low |
| EMR on EKS | Runs Spark jobs as pods on an existing Amazon EKS cluster. EMR submits the job; Kubernetes manages the pod lifecycle. | Teams already running Kubernetes who want unified infrastructure; mixed workloads on one EKS cluster | Requires Kubernetes expertise. More moving parts. Not beginner-friendly. | High |
If you are new to EMR, start with EMR Serverless. You get full Spark capability without managing cluster nodes, scaling policies, or termination. Once you hit cold-start limitations or need fine-grained configuration, move to EMR on EC2.
Node types in an EMR on EC2 cluster
An EMR on EC2 cluster works like a construction crew with three roles: one site manager, a crew of builders, and optional day labourers you bring in for heavy lifting.
Primary node (the site manager): One instance that coordinates the cluster. Runs YARN and the Spark driver. If it fails, the cluster is lost. Always use a larger, On-Demand instance here.
Core nodes (the builders): The main workers. Run Spark executors and store HDFS data if you use it. Avoid removing core nodes mid-job as it can cause data loss. Most workloads need 4 to 20 core nodes.
Task nodes (the day labourers): Optional extra workers that run executors but store no HDFS data. Safe to add or remove mid-job. Use these for Spot Instances. If a task node is reclaimed, the job slows but does not fail.
When to use Amazon EMR
EMR is the right choice when the job is too large, too custom, or too performance-sensitive for simpler tools. Here are concrete scenarios:
Large Spark ETL pipelines. You have 500 GB to multiple TB of raw data that needs to be cleaned, joined, and transformed daily. Glue can handle this, but you need fine-grained Spark configuration (executor memory, shuffle partitions, dynamic allocation) to hit your SLA. EMR gives you that control. See the Running Spark on AWS guide for job submission details.
ML data preprocessing at scale. Training a large model requires feature engineering across hundreds of millions of rows. EMR Spark can distribute this across a large cluster in minutes. The output lands in S3 and feeds directly into a training pipeline.
Repeated large-scale aggregations. You run an aggregation job every hour that joins three tables, each hundreds of GB. The job is predictable and runs frequently enough that a warm EMR on EC2 cluster is cheaper than Glue DPU billing or EMR Serverless cold-starts.
Multi-framework workloads. Your pipeline uses Spark for transformation, Hive for SQL queries over HDFS tables, and HBase for random lookups. Only EMR gives you all three on one cluster. Glue is Spark-only.
Workloads that have outgrown Glue. AWS Glue has maximum DPU limits and less flexibility in Spark version management. When a Glue job consistently hits DPU caps or fails due to configuration constraints, migrating to EMR is the natural next step.
When NOT to use Amazon EMR
EMR is more complex and more expensive than simpler alternatives for jobs that do not need it. Be honest about when to avoid it.
Many teams reach for EMR because it sounds powerful. But power comes with an operational cost: cluster management, Spark tuning, IAM setup, and cost monitoring. If AWS Glue covers your workload, use Glue. Choosing EMR unnecessarily is one of the most common reasons data teams overspend on AWS.
Standard ETL that fits within Glue. If your job reads from S3, transforms, and writes to Redshift or S3, and you are not hitting Glue’s DPU limits, use AWS Glue. It is serverless, integrates with the Glue Data Catalog, and requires far less setup.
Ad-hoc SQL queries on S3 data. If you are exploring a dataset or running one-off analytical queries, Athena is the right tool. It charges per byte scanned, requires no cluster, and results appear in seconds to minutes.
Simple event-driven row processing. Transforming individual records as they arrive belongs in AWS Lambda, not a distributed cluster. Lambda handles this in milliseconds with no cluster overhead.
Teams new to distributed systems. EMR requires understanding Spark configuration, cluster sizing, and job tuning. If your team is new to distributed processing, the time investment in Glue is almost always worth it first.
Interactive dashboards and BI queries. EMR is a batch processing tool, not a sub-second query engine. Use Amazon Redshift for warehouse workloads, or Athena for serverless SQL.
EMR vs Glue vs Athena
All three services can process large amounts of data stored in S3. The difference is in what they abstract away and what they expose.
| Service | What it abstracts | Choose it when | Avoid it when |
|---|---|---|---|
| Amazon Athena | Everything. Serverless SQL on S3, zero setup. | Ad-hoc SQL queries; exploring data; low-frequency queries; teams that know SQL but not Spark | Complex transformations; heavy compute; high query concurrency at low latency |
| AWS Glue | Cluster management; tight integration with Glue Data Catalog | Standard ETL pipelines; S3-to-Redshift loads; schema cataloguing; teams new to Spark | Very large jobs needing custom Spark config; non-Spark frameworks; jobs running every few minutes |
| Amazon EMR | Hardware provisioning and OS management only. You configure Spark. | Large-scale or performance-critical Spark jobs; multi-framework workloads; jobs that outgrow Glue | Simple ETL; ad-hoc queries; teams without distributed systems experience |
The typical progression on a data team: start with Athena for exploration, move to Glue for repeatable ETL, and bring in EMR when Glue jobs hit performance limits or you need framework flexibility.
EMR Serverless vs AWS Glue: the closest comparison
EMR Serverless and AWS Glue are the most directly comparable options. Both are serverless, both run Spark, and both charge for compute consumed rather than idle time. The practical differences:
- Glue uses the Glue Data Catalog natively, includes a visual job builder (Glue Studio), and handles IAM and logging boilerplate for you. It abstracts more of the plumbing.
- EMR Serverless gives you a vanilla Spark runtime you configure directly. You get more Spark version choices, tighter performance control, and higher capacity for very large jobs. You also set up IAM roles and monitoring yourself.
- For a team already invested in Glue’s catalog and workflows, staying in Glue is the right call. For teams that need raw Spark capability without cluster management, EMR Serverless closes that gap.
How EMR fits into a data platform
A common pattern in an AWS data lake:
- Raw data lands in S3. Application logs, database exports, event streams. All arrive in a raw S3 prefix, untouched.
- EMR processes it. A daily Spark job reads the raw data, cleans it, joins it with reference data, and writes the output as Parquet to a processed S3 prefix.
- Output goes back to S3. The processed data is partitioned by date and registered in the Glue Data Catalog so downstream tools can find it.
- Downstream tools query or consume it. Athena runs SQL on the processed files. Redshift Spectrum joins them with warehouse tables. A BI tool reads the curated aggregations. See the data pipeline design guide for how these pieces connect end to end.
In this architecture, EMR is a compute layer only. It reads from S3, transforms data, and writes back to S3. The cluster does not own any data. Tear it down after the job and nothing is lost.
For workloads where processed data goes to Redshift, the ETL vs ELT distinction matters. EMR performs the transformation before loading (ETL). Redshift Spectrum or dbt can transform after loading (ELT). Neither is universally better: the right choice depends on your compute budget and where your team’s skills are stronger.
Pricing and cost traps
EMR has two concurrent charges on every EC2 cluster:
- EC2 instance cost: the normal EC2 price for the instances in your cluster (On-Demand, Reserved, or Spot).
- EMR service fee: an additional per-instance-hour charge on top of EC2 costs, roughly 25 to 30 percent of the On-Demand EC2 price depending on instance type.
For EMR Serverless, you pay for vCPU-hours and GB-hours of memory consumed during execution only. There is no idle cost between jobs.
Where cost surprises happen
An idle EMR on EC2 cluster charges for every instance-hour, even when no job is running. A five-node cluster that processes data for two hours but stays up all day wastes 22 hours of EC2 plus EMR fees. Use transient clusters (create, run, terminate) or switch to EMR Serverless for infrequent jobs.
On-Demand task nodes. Task nodes hold no HDFS data, so they are safe to run on Spot Instances, which are typically 70 to 90 percent cheaper than On-Demand. If a Spot task node is reclaimed, the job slows but does not fail. Run primary and core nodes On-Demand; use Spot for task nodes.
Oversized clusters. More nodes does not always mean faster jobs. Spark jobs are often bottlenecked by shuffle or data skew, not raw CPU. Profile with Spark UI before scaling up. See the EC2 cost optimisation guide for rightsizing guidance.
EMR Serverless cold-starts for frequent jobs. Each EMR Serverless job run takes 1 to 3 minutes to provision compute. For jobs running every 10 to 15 minutes, this overhead adds up quickly. A warm EMR on EC2 cluster is cheaper in that pattern.
Running core nodes On-Demand and task nodes on Spot can cut overall EMR on EC2 cluster cost by 50 to 60 percent compared to all On-Demand, while keeping jobs reliable.
Creating a cluster and submitting a job
# Create an EMR on EC2 cluster with Spark
aws emr create-cluster \
--name "my-spark-cluster" \
--release-label emr-7.0.0 \
--applications Name=Spark \
--ec2-attributes KeyName=my-key-pair \
--instance-type m5.xlarge \
--instance-count 3 \
--use-default-roles \
--log-uri s3://my-emr-logs/
# Submit a Spark step (job) to the cluster
aws emr add-steps \
--cluster-id j-XXXXXXXXXXXX \
--steps '[{
"Name": "Process Orders",
"ActionOnFailure": "CONTINUE",
"HadoopJarStep": {
"Jar": "command-runner.jar",
"Args": [
"spark-submit",
"--deploy-mode", "cluster",
"s3://my-scripts/process_orders.py"
]
}
}]'For EMR Serverless, you create an application once and submit individual job runs to it:
# Create an EMR Serverless application (one-time setup)
aws emr-serverless create-application \
--name my-spark-app \
--type SPARK \
--release-label emr-7.0.0
# Submit a job run
aws emr-serverless start-job-run \
--application-id 00faaaaaaaaaaaaaa \
--execution-role-arn arn:aws:iam::123456789012:role/EMRServerlessRole \
--job-driver '{
"sparkSubmit": {
"entryPoint": "s3://my-scripts/process_orders.py",
"sparkSubmitParameters": "--conf spark.executor.cores=4"
}
}'For a full walkthrough including PySpark scripts, S3 read/write patterns, and job monitoring, see Running Apache Spark on AWS with EMR.
Common beginner mistakes
Leaving clusters running when not in use. An idle EMR on EC2 cluster charges for every instance-hour regardless of whether a job is running. Use transient clusters (create, run, terminate) or EMR Serverless for infrequent jobs. This is the single biggest source of unexpected EMR bills.
Storing job data on HDFS instead of S3. Writing output to HDFS on cluster core nodes and then terminating the cluster means the data is gone. Always read and write S3. Treat EMR compute as ephemeral and S3 as the durable layer.
Choosing EMR when Glue or Athena would do. EMR is more capable but significantly more complex. If your pipeline fits in Glue — standard ETL from S3 to Redshift, no exotic Spark tuning required — use Glue. The configuration overhead of EMR is only worth paying when you genuinely need it.
Running all nodes On-Demand. Task nodes are safe for Spot Instances because they hold no HDFS data. Running them On-Demand wastes 70 to 90 percent of what you could save on that portion of cluster cost.
Summary
- Amazon EMR is a managed platform for running distributed data processing frameworks, primarily Apache Spark, on AWS at scale
- Three deployment options: EMR on EC2 (full cluster control), EMR Serverless (no cluster, pay per job), EMR on EKS (Kubernetes-based, for advanced teams)
- Beginners should start with EMR Serverless: same Spark capability, no cluster lifecycle to manage
- The compute-storage split is fundamental: data lives in S3, clusters are ephemeral compute. Always use S3 as the durable layer, never HDFS.
- Use Athena for ad-hoc SQL, Glue for standard ETL, and EMR for large-scale or custom-framework jobs that Glue cannot handle
- EMR on EC2 cluster cost equals EC2 instance cost plus EMR service fee. Idle clusters waste money: use transient clusters or Serverless.
- Cut task node costs by 70 to 90 percent with Spot Instances. Keep primary and core nodes On-Demand for stability.
Frequently asked questions
What is Amazon EMR used for?
Amazon EMR is a managed platform for running large-scale distributed data processing jobs on AWS. Common use cases include Spark ETL pipelines that transform terabytes of raw data, ML data preprocessing, log analysis, and large aggregation workloads that are too big or too slow for AWS Glue. EMR handles cluster provisioning, configuration, and scaling so you can focus on writing the job code.
What is the difference between EMR on EC2 and EMR Serverless?
EMR on EC2 gives you a persistent cluster of EC2 instances you control: you choose instance types, node counts, and Spark configuration. You pay per instance-hour whether or not the cluster is doing work. EMR Serverless removes the cluster entirely. You submit a job and AWS provisions the compute automatically, scales it during execution, and releases it when done. You pay only for the vCPU-seconds and GB-seconds actually consumed. For most beginners running batch jobs, EMR Serverless is the easier and cheaper starting point.
When should I use EMR instead of AWS Glue?
Use EMR when your Glue jobs are hitting performance limits, when you need fine-grained Spark configuration (custom executor memory, partitions, shuffle settings), when you need a framework Glue does not support (Hive, Presto, HBase, Flink), or when jobs run continuously and keeping a warm cluster is cheaper than Glue DPU billing. For standard ETL pipelines reading from S3 and writing to Redshift, Glue is almost always the simpler and faster choice.
Is Amazon EMR only for Apache Spark?
No. EMR supports Apache Spark, Hive, Presto/Trino, HBase, Flink, and other Hadoop-ecosystem frameworks. You choose which to install at cluster creation. Spark is the most popular choice, but teams with existing Hive or Presto workloads often use those runtimes on EMR directly.
Is Amazon EMR expensive?
EMR costs the EC2 instance price plus an EMR service fee of roughly 25 to 30 percent of the On-Demand EC2 price. An idle EC2 cluster that runs all day but only does work for two hours wastes most of its spend. The main cost-saving levers are using transient clusters (create, run job, terminate), adding Spot task nodes (typically 70 to 90 percent cheaper than On-Demand), and using EMR Serverless for infrequent batch jobs where you only pay during execution.