View a markdown version of this page

Operational Excellence - Amazon EMR Migration Guide

Operational Excellence

After your workloads are running on Amazon EMR, the focus shifts from migration to ongoing operations: keeping clusters current, optimizing costs, and maintaining reliability. This chapter covers post-migration operational concerns: upgrading Amazon EMR versions on a regular cadence, optimizing your Amazon S3-based data lake storage for cost efficiency, and general best practices for running Amazon EMR in production.

Upgrading Amazon EMR versions

One best practice is to upgrade your Amazon EMR releases on a regular cadence. Upgrading software ensures that you use the latest features from open source applications. Staying up to date provides the following benefits.

  • Performance enhancements enable applications to run faster.

  • Bug fixes make the infrastructure more stable.

  • Security patches help keep your cluster secure.

These benefits apply to both the open source application software and the Amazon EMR software that manages it.

Amazon EMR support policy. Amazon EMR provides Standard Support for each Minor Release for 24 months from its release date, covering the Runtime Environment and Core Engines, such as Apache Spark, Apache Hive, and Apache Iceberg. After Standard Support ends, a release enters End of Support for 12 months before it reaches End of Life. During End of Support, the release receives no further fixes. Amazon EMR removes the release from the console, but existing clusters continue to run, and you can still access the release through the API and the AWS CLI. Amazon EMR issues a new Minor Release at least every 90 days. Because support windows advance with each release, plan a regular upgrade cadence. Older releases (Amazon EMR 5.36 and 6.6 through 6.15) receive Extended Support only through June 30, 2027, so plan migrations off these releases accordingly. For more information, see Amazon EMR standard support in the Amazon EMR Release Guide.

For the complete list of releases and bundled application versions, see Amazon EMR 7.x release versions and Application versions in Amazon EMR 7.x releases. For guidance on when to patch, see the Software Patching discussion in Securing your Resources on Amazon EMR.

Upgrade process

When upgrading software, the risk of refactoring exists in terms of performance and data quality. Upgrades might change API interfaces, so your code might no longer run as is, and they can introduce new bugs. AWS runs a large suite of integration tests to identify regressions before releases, but some regressions are difficult to identify, so test each release before making it available to your users. The more often you upgrade, the smaller the number of changes between versions, which reduces effort and regression risk.

The following figure shows the recommended steps for upgrading an Amazon EMR release.

Diagram of the recommended Amazon EMR version upgrade steps.

Figure 30: Recommended upgrade steps

Research changes and outstanding issues

All open source applications have release notes, and most provide a JIRA project for issue tracking. Before an upgrade, research bugs, issues, or configuration updates. The following table lists the release notes and issue tracking locations for common applications.

Special emphasis: Apache Spark. Spark upgrades (for example, from on-premises Spark 2.4 to the Spark 3.5 and 4.x versions on Amazon EMR 7.x) are typically the most involved because of API deprecations and behavior changes. Amazon EMR provides the Apache Spark Upgrade Agent, a conversational AI capability that automates PySpark and Scala code upgrades, handling API changes, dependency resolution, and data-quality validation. For more information, see Spark Agents.

Test a subset of applications or queries

Before your users test the new release or configuration, test the version with a subset of use cases that is representative of overall usage. This helps you catch configuration issues before deployment.

Fix issues

If you find an issue when testing, take the following actions in order.

  1. Check whether a configuration value can fix it, for example, by disabling a problematic new feature.

  2. Check whether the issue is already fixed in a later version of the open source project. If so, notify AWS Support, who evaluates including it in the next release.

  3. Change the application or query to avoid the issue.

  4. Contact AWS Support for workarounds.

  5. Abandon the upgrade if there is no workaround, and wait for a release with the fix.

Set up A/B testing (recommended)

Gradually move the workload to the new configuration so that you can abort if a serious issue is found in production. If you use Amazon EMR for interactive user querying, a router helps move load from one cluster to another in a controlled fashion. You can also use a load balancer that supports traffic weighting and sticky sessions.

Diagram showing a router used to gradually move load between clusters.

Figure 31: Using a router to gradually move load

Complete upgrade

Complete your upgrade by moving all Amazon EMR clusters to the new version, and then discontinue use of the older version.

Best practices for upgrading

Apply the following best practices when you upgrade Amazon EMR.

  • Upgrades require time and effort. Schedule them and allow time to complete.

  • Be aware of dependencies that can change when upgrading.

  • When performing manual testing, replicate your Hive metastore to ensure that the schema remains backward compatible.

  • If you can, track job performance to ensure that a significant regression has not occurred.

  • Split your clusters by applications so that you can upgrade components individually.

  • Research what has changed between releases so that issues are easier to identify.

  • Use Amazon Route 53 to automatically register clusters so that your users can point to them. For more information, see Dynamically Create Friendly URLs for Your Amazon EMR Web Interfaces on the AWS Big Data Blog.

Optimizing an Amazon S3-based central data repository

By using Amazon S3 as the central repository, you have already optimized total cost of ownership (TCO) by decoupling storage and compute and paying for compute based on actual need. AWS and Amazon S3 have features to optimize the storage footprint to further reduce costs. By using columnar file formats, you can speed up queries while reducing costs.

Optimizing storage cost

Amazon S3 offers a range of storage classes for frequently, infrequently, and rarely accessed data, plus S3 Glacier classes for long-term archive. Amazon S3 also offers configurable lifecycle policies and analytics tools such as Amazon S3 Storage Class Analysis and Amazon S3 Storage Lens.

Amazon S3 storage classes

Amazon S3 provides the following storage classes.

  • S3 Standard is for frequently accessed data, with low latency and high throughput.

  • S3 Express One Zone is a high-performance, single-Availability Zone storage class that delivers single-digit millisecond data access. It makes data access up to 10x faster and request costs up to 50% lower than S3 Standard, using directory buckets co-located with compute.

  • With S3 Intelligent-Tiering, your data automatically moves to the most cost-effective access tier with no retrieval fees. It provides three low-latency tiers: Frequent Access, Infrequent Access (after 30 days, approximately 40% savings), and Archive Instant Access (after 90 days, approximately 68% savings, with millisecond retrieval). It also provides two optional archive tiers: Archive Access (90 or more days, configurable up to 730 days, 3–5 hour retrieval, equivalent to S3 Glacier Flexible Retrieval) and Deep Archive Access (180 or more days, configurable up to 730 days, retrieval within 12 hours, equivalent to S3 Glacier Deep Archive).

  • Use S3 Standard-Infrequent Access for data accessed approximately once a month. It provides low per-GB storage with a per-GB retrieval fee and stores data across multiple Availability Zones.

  • S3 One Zone-Infrequent Access stores data in a single Availability Zone at 20% less than S3 Standard-IA. Use it for backups, re-creatable data, or cross-Region replication replicas.

Note

Objects smaller than 128 KB are not monitored or tiered in S3 Intelligent-Tiering and stay in the Frequent Access tier. Only activate the Archive Access tier for 90 days if you want to bypass Archive Instant Access.

Amazon S3 Glacier storage classes

The S3 Glacier storage classes are purpose-built for archiving. All of them provide 11 nines of durability and integrate with Amazon S3 lifecycle management.

  • S3 Glacier Instant Retrieval is for rarely accessed data (approximately once each quarter) that needs millisecond retrieval. Storage is up to 68% lower than S3 Standard-IA, with a 90-day minimum and a 128 KB minimum billable object size.

  • S3 Glacier Flexible Retrieval is for archive data that does not need immediate access. It provides free bulk retrievals (typically 5–12 hours), expedited retrievals (1–5 minutes), and standard retrievals (3–5 hours), with a 90-day minimum.

  • S3 Glacier Deep Archive is the lowest-cost class, for data accessed less than once each year. Standard retrieval completes within 12 hours and bulk retrieval within 48 hours, with a 180-day minimum.

Note

When you use the S3 Glacier classes, objects remain in Amazon S3 and are managed through the Amazon S3 API. You must restore S3 Glacier Flexible Retrieval and S3 Glacier Deep Archive objects before access.

Amazon S3 Lifecycle management

Create lifecycle rules that automatically transition data to lower-cost tiers or expire it. Each bucket supports up to 1,000 lifecycle rules. Rules support filtering by prefix, object tags, object size (ObjectSizeGreaterThan and ObjectSizeLessThan), and combinations (AND logic). The supported transition waterfall is S3 Standard → S3 Intelligent-Tiering → S3 Standard-IA → S3 One Zone-IA → S3 Glacier Instant Retrieval → S3 Glacier Flexible Retrieval → S3 Glacier Deep Archive. Combine lifecycle rules with object tagging for granular management.

Amazon S3 Storage Class Analysis and Amazon S3 Storage Lens

Amazon S3 Storage Class Analysis helps you understand how individual buckets or prefixes are accessed and recommends when to transition data. Amazon S3 Storage Lens provides organization-wide visibility across hundreds or thousands of accounts, with 29 or more usage and activity metrics, interactive dashboards, drill-downs at the organization, account, Region, bucket, and prefix levels, contextual recommendations, and performance metrics. It offers a free tier and an advanced tier.

Note

Use Amazon S3 Storage Lens for organization-wide visibility, and use Amazon S3 Storage Class Analysis for bucket-level access-pattern insights.

Tiering your data lake storage

Use the following tiering strategy for your data lake storage.

  • Active or hot data (frequently queried results, dashboards, ML features): S3 Standard or S3 Express One Zone.

  • Warm data (recent raw data, intermediate results): S3 Intelligent-Tiering or S3 Standard-IA.

  • Cold data (historical raw data, older transformed datasets): S3 Glacier Instant Retrieval or S3 Glacier Flexible Retrieval.

  • Archive data (compliance records, long-term backups): S3 Glacier Deep Archive.

For compliance and audit, enforce immutability with Amazon S3 Object Lock (write once, read many, or WORM) in two retention modes. In Governance mode, most users cannot delete or overwrite objects, but users with specific IAM permissions can modify retention or delete objects. In Compliance mode, no user, including the root user, can delete or overwrite objects until the retention period expires. You can enable Amazon S3 Object Lock on new and existing buckets, and it provides an audit trail through AWS CloudTrail. For data lakes with regulatory requirements such as SEC 17a-4, HIPAA, and FINMA, Compliance mode satisfies WORM mandates.

Note

Amazon S3 Glacier Vault Lock remains available for legacy architectures. For new implementations, use Amazon S3 Object Lock, which provides the same WORM guarantees while working natively with Amazon S3 storage classes and lifecycle policies and integrates with AWS Backup Vault Lock.

General best practices for operational excellence

The following practices apply across all Amazon EMR deployment options and workload types, organized by operational domain.

Infrastructure as code

Define all clusters and infrastructure as code

Use infrastructure as code (IaC) to define, version, and deploy Amazon EMR environments reproducibly. This eliminates configuration drift, enables peer review, and supports rapid disaster recovery. The following table compares common IaC tools.

Infrastructure as code tools for Amazon EMR
Tool Best For EMR Support
AWS CDK Teams wanting type-safe, programmatic definitions with constructs Full Amazon EMR construct library (L2 constructs for clusters, steps, and security configurations)
Terraform Multi-cloud teams or those with an existing Terraform investment HashiCorp AWS provider covers Amazon EMR on Amazon EC2, Amazon EMR on Amazon EKS, and Amazon EMR Serverless
CloudFormation Teams preferring declarative YAML or JSON templates Native AWS support with all Amazon EMR resource types
Amazon EMR CLI or SDK Rapid prototyping and one-off clusters Full API coverage for all deployment options

Apply the following key practices.

  • Store all IaC templates in version control alongside application code.

  • Use parameterized templates with environment-specific configuration rather than separate templates per environment.

  • Include Amazon EMR security configurations, IAM roles, and VPC resources in the same IaC stack.

  • Implement drift detection.

Implement CI/CD pipelines for Amazon EMR workloads

Treat Amazon EMR job deployments with the same rigor as application deployments. A pipeline typically includes the following stages: Source (a commit triggers the pipeline), Build (compile JARs or packages, run unit tests, and lint PySpark), Test (deploy a transient Amazon EMR cluster, run integration tests, and validate output quality), Deploy (update AWS Step Functions workflows, Apache Airflow DAGs, or Amazon EMR step definitions), and Validate (run smoke tests and compare output checksums against a baseline). Recommended tools include AWS CodePipeline, AWS Step Functions, Apache Airflow (Amazon MWAA), or Jenkins with the Amazon EMR plugin. For Spark testing, use frameworks such as pytest with spark-testing-base or Great Expectations.

Cluster lifecycle and scaling

Prefer transient clusters where possible

Transient clusters eliminate idle cost, launch with fresh configurations, and isolate failures. Use them for scheduled batch ETL, periodic ML training, and ad hoc analytics. Reserve long-running clusters for interactive query engines (Trino, Hive LLAP), Apache HBase, and shared development environments. For more information, see Configuring cluster termination in the Amazon EMR Management Guide.

Use Amazon EMR Managed Scaling and instance fleets

Amazon EMR Managed Scaling automatically adjusts capacity based on demand. Combine it with instance fleets (5–10 instance types per fleet) to maximize Spot availability and minimize cost. As a migration-specific recommendation, start conservatively: set MinimumCapacityUnits to match your on-premises baseline, and then progressively lower it. For more information, see Using managed scaling and Configure instance fleets in the Amazon EMR Management Guide.

Compute optimization

Adopt Graviton instances for cost-performance improvement

AWS Graviton-based instances (the m6g, m7g, c6g, and r6g families) deliver up to 30% better price-performance than equivalent x86 instances for Spark and Hadoop on Amazon EMR. Use the following adoption path for migrations.

  1. Phase 1: Start with task nodes (lowest risk).

  2. Phase 2: Validate performance parity against your x86 baseline.

  3. Phase 3: Extend to core nodes.

  4. Phase 4: Use instance fleets with a mix of Graviton and x86 instances.

As a compatibility note, Graviton uses the ARM architecture, so validate that custom native libraries (JNI and shared objects) have ARM builds. Pure Java, Scala, and PySpark workloads require no code changes. For more information, see Amazon EMR supported instance types and the AWS Big Data Blog post on Graviton price-performance.

Tagging and cost allocation

Implement a consistent tagging strategy

Implement a consistent tagging strategy across your Amazon EMR resources. The following table shows a recommended set of tags.

Recommended tagging strategy
Tag Key Purpose Example Values
Environment Deployment stage production, staging, development
Team Owning team for cost allocation data-engineering, data-science, analytics
Project Business project or initiative customer-360, fraud-detection
CostCenter Finance cost center code CC-4521
Workload Workload name for operational tracking daily-etl, ml-training, ad-hoc-query
ManagedBy IaC tool that created the resource cdk, terraform, manual

To enforce tagging, use AWS Service Control Policies (SCPs) or tag policies to require mandatory tags at cluster creation. Configure AWS Cost Explorer to group by team or project tags, and set up AWS Budgets alerts for cost anomalies. For more information, see Best Practices for Tagging AWS Resources and Tag and categorize Amazon EMR cluster resources.

Development workflows

Use SageMaker Unified Studio or EMR Studio for interactive development

Use Amazon SageMaker Unified Studio (recommended), a unified environment for SQL, Spark, and ML with AWS Lake Formation governance, or EMR Studio, which provides managed Jupyter notebooks connected to Amazon EMR clusters or Amazon EMR Serverless. Both eliminate SSH access to cluster nodes and support Trusted Identity Propagation. For more information, see the Phase 5 advisory in Securing your Resources on Amazon EMR. As a best practice, use Studio environments for development and testing, deploy validated code through CI/CD pipelines to production clusters, and do not run production workloads directly from notebooks.

Incident response and runbooks

Maintain operational runbooks for common scenarios

Maintain operational runbooks for common scenarios. The following table lists the contents to capture for each scenario.

Operational runbooks for common scenarios
Scenario Runbook Contents
Cluster launch failure Check IAM roles, subnet capacity, instance availability, security group rules, and bootstrap script logs.
Job failure or stuck job Check YARN application logs, driver stderr, executor OOM patterns, and shuffle failures.
Spot Instance interruption Verify instance fleet diversity, check Managed Scaling recovery, and validate job retry configuration.
Performance degradation Check Amazon CloudWatch metrics for resource contention, review the Spark UI for data skew, and validate Amazon S3 throttling.
Storage capacity alert Review HDFS utilization (if used), check Amazon EBS volume capacity, and validate Amazon S3 lifecycle policies.
Security incident Isolate the cluster (security group lockdown), preserve logs to Amazon S3, and review AWS CloudTrail for unauthorized access.

To automate response, use AWS Systems Manager runbooks or AWS Step Functions to automate diagnostic and remediation steps, which reduces mean time to recovery (MTTR).

Configure alerting for critical operational events

Set up proactive alerting for the following categories.

  • Cluster health: IsIdle indicates an abandoned cluster, MRUnhealthyNodes, and HDFSUtilization > 80%.

  • Job failures: AppsFailed > 0 within a 5-minute window.

  • Capacity exhaustion: YARNMemoryAvailablePercentage < 15% and ContainerPending > 10 for 5 or more minutes.

  • Cost anomalies: AWS Cost Anomaly Detection for Amazon EMR service spend.

Use Amazon SNS topics for notifications to Slack, PagerDuty, or email based on severity. For more information, see Monitoring Amazon EMR Metrics with CloudWatch. For observability architecture, including Prometheus and Grafana, see EMR Observability.

Multi-account and governance

Consider a multi-account strategy for production isolation

Separate Amazon EMR workloads across AWS accounts by environment or team.

  • Production account: restricted access, change management gates, and no interactive access.

  • Development or staging account: broader access, experimentation, and cost-bounded with AWS Budgets.

  • Shared services account: hosts the AWS Glue Data Catalog, AWS Lake Formation permissions, and shared IAM Identity Center configuration.

Use AWS Organizations with Service Control Policies to enforce guardrails, and share the data catalog across accounts using AWS Lake Formation cross-account grants.

Evaluate workload placement across deployment options

Periodically review your workload portfolio.

  • Move batch jobs to Amazon EMR Serverless if they don't require custom cluster configurations, Apache HBase, or specific Hadoop ecosystem components.

  • Move containerized Spark jobs to Amazon EMR on Amazon EKS if your organization already operates Amazon EKS.

  • Keep complex multi-framework workloads on Amazon EMR on Amazon EC2 where you need full control, custom AMIs, or applications beyond Spark.

Consider alternative services for specific workload patterns

Evaluate the following services for workloads that don't require the full flexibility of Amazon EMR.

  • AWS Glue for serverless ETL with automatic scaling.

  • Amazon Athena for serverless interactive SQL against Amazon S3.

  • Amazon Redshift Serverless for a serverless data warehouse for structured analytics.