This page requires JavaScript to display.
E
Unpacking...
← Cloud Platforms
Cloud Platforms

Amazon EMR for Data Engineers

EMR on EC2, Serverless and EKS; node types and instance fleets; creating clusters and steps; Glue Catalog integration; EMR Serverless jobs; tuning, security and monitoring.

Contents
1. What Amazon EMR Is 2. Cluster Architecture 3. Creating a Cluster & Submitting Steps 4. EMR Serverless 5. Spark Tuning & Table Formats on EMR 6. Security & Monitoring 7. Common Interview Questions

1. What Amazon EMR Is

Amazon EMR runs open-source big data frameworks (Spark, Hive, Trino/Presto, Flink, HBase, Hudi, Iceberg, Delta) on AWS-managed infrastructure. Compared with Glue, it gives full control over versions, configuration, instance types and tuning, and is usually cheaper for large, steady workloads (especially with spot instances).

Deployment optionWhat you manageBest for
EMR on EC2Clusters: instance types, scaling, bootstrap actionsFull control, many frameworks, long-running or interactive clusters
EMR ServerlessOnly applications and job runsSpark/Hive jobs without capacity planning; spiky workloads
EMR on EKSYour Kubernetes clusterSharing Kubernetes infrastructure with other workloads

2. Cluster Architecture

Node typeRunsSpot?
Primary (master)YARN ResourceManager, HDFS NameNode, Spark history server, Hive metastore clientNo: losing it ends the cluster
CoreTasks plus HDFS DataNodesOnly if losing HDFS data is acceptable
TaskTasks only, no HDFSYes: ideal for spot

3. Creating a Cluster & Submitting Steps

aws emr create-cluster \
  --name "nightly-enrichment" \
  --release-label emr-7.5.0 \
  --applications Name=Spark Name=Hive \
  --service-role EMR_DefaultRole_V2 \
  --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole,SubnetIds=subnet-0abc123 \
  --instance-fleets file://fleets.json \
  --managed-scaling-policy '{"ComputeLimits": {"UnitType": "InstanceFleetUnits", "MinimumCapacityUnits": 4, "MaximumCapacityUnits": 40}}' \
  --auto-termination-policy IdleTimeout=1800 \
  --log-uri s3://acme-emr-logs/ \
  --bootstrap-actions Path=s3://acme-code/emr/bootstrap.sh,Name=install-deps \
  --configurations file://configurations.json \
  --steps Type=Spark,Name=enrich,ActionOnFailure=TERMINATE_CLUSTER,Args=[--deploy-mode,cluster,s3://acme-code/jobs/enrich.py,--run-date,2026-10-26] \
  --auto-terminate  # terminate after the steps finish (transient cluster)
[
  {
    "Classification": "spark-hive-site",
    "Properties": {
      "hive.metastore.client.factory.class": "com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory"
    }
  },
  {
    "Classification": "spark-defaults",
    "Properties": {
      "spark.sql.adaptive.enabled": "true",
      "spark.dynamicAllocation.enabled": "true",
      "spark.sql.shuffle.partitions": "400"
    }
  }
]

The spark-hive-site classification makes Spark use the Glue Data Catalog as its metastore, so tables are shared with Athena and Glue.

# add work to a running cluster
aws emr add-steps --cluster-id j-2AXXXXXXGAPLF --steps \
  Type=CUSTOM_JAR,Name=load,Jar=command-runner.jar,ActionOnFailure=CONTINUE,Args=[spark-submit,--deploy-mode,cluster,s3://acme-code/jobs/load.py]

aws emr list-steps --cluster-id j-2AXXXXXXGAPLF --step-states FAILED
aws emr terminate-clusters --cluster-ids j-2AXXXXXXGAPLF

4. EMR Serverless

aws emr-serverless create-application --name spark-etl --type SPARK --release-label emr-7.5.0 \
  --maximum-capacity '{"cpu": "200 vCPU", "memory": "800 GB"}' \
  --auto-stop-configuration '{"enabled": true, "idleTimeoutMinutes": 15}'

aws emr-serverless start-job-run \
  --application-id 00fabcdexample \
  --execution-role-arn arn:aws:iam::111122223333:role/emr-serverless-job \
  --name enrich-2026-10-26 \
  --job-driver '{"sparkSubmit": {
      "entryPoint": "s3://acme-code/jobs/enrich.py",
      "entryPointArguments": ["--run-date", "2026-10-26"],
      "sparkSubmitParameters": "--conf spark.executor.cores=4 --conf spark.executor.memory=16g --conf spark.dynamicAllocation.maxExecutors=50"}}' \
  --configuration-overrides '{"monitoringConfiguration": {"s3MonitoringConfiguration": {"logUri": "s3://acme-emr-logs/serverless/"}}}'

5. Spark Tuning & Table Formats on EMR

6. Security & Monitoring

AreaPractice
NetworkPrivate subnets, VPC endpoints for S3/Glue; Block Public Access for EMR on
EncryptionSecurity configurations: at rest (S3, EBS, local disks) and in transit (TLS)
AccessEC2 instance profile (least privilege) or per-job runtime roles; Lake Formation for fine-grained table access; Kerberos for multi-user clusters
LogsCluster and step logs to S3; persistent Spark UI / history server after termination
MetricsCloudWatch: YARN memory available, apps pending, HDFS utilisation, IsIdle

7. Common Interview Questions

QuestionShort answer
Primary, core and task nodes?Primary coordinates; core runs tasks and stores HDFS; task runs tasks only, so it is the safest place for spot instances
Why keep data in S3 instead of HDFS?Clusters become disposable (transient), storage scales independently, and other services can read the data
EMR on EC2 vs Serverless vs EKS?EC2: full control; Serverless: no cluster management, pay per job; EKS: run on shared Kubernetes
How do you use spot safely?Spot for task nodes, instance fleets with multiple types, on-demand primary, managed scaling, data in S3
Glue vs EMR?Glue for serverless, moderate jobs with minimal ops; EMR for large or steady workloads needing control, more frameworks or lower cost at scale