Created: November 27, 2026
Heroku to AWS Migration: Which Platform Behaviors Must You Replace?

Imagine the new AWS service returning healthy HTTP responses while an order remains unprocessed. Its worker stopped during deployment, and nobody can tell whether retrying the job will finish the order or repeat an operation. This illustrative situation exposes the real evaluation problem: moving application code does not establish that its operating behavior survived. A Heroku to AWS migration pilot should reveal those gaps before production traffic moves. By the end of this guide, you can inventory platform dependencies, select one web and worker scenario, and define evidence for proceeding, stopping, and recovering.
Key takeaways
- Describe what Heroku currently does for each web and worker process, including deployment, configuration, scheduling, logging, and recovery. Give every required behavior an AWS owner.
- Stop the pilot worker around the business operation: before its transaction commits, after commit, and after message deletion. Check durable outcomes alongside delivery attempts.
- Approve cutover from recorded recovery evidence. A responding endpoint and a running container do not establish safe job retries.
Inventory what Heroku does for the application
Start with deployed process definitions and operational workflows. Record commands, dependencies, failure responses, and who investigates them. The inventory below is a working template: replace its proposed AWS responsibilities with named people and the behavior your application actually requires.
| Dependency | Required behavior to record | Proposed AWS responsibility |
|---|---|---|
| Web processes | Serve requests, expose readiness, drain active traffic during replacement | Platform engineer: ECS service, load balancer, health and deployment settings |
| Background workers | Consume jobs, preserve committed outcomes, recover interrupted work | Application lead: worker protocol; platform engineer: ECS service and queue access |
| Scheduler | Trigger each intended run with an explicit overlap policy | Platform engineer: scheduled invocation; application lead: duplicate-run protection |
| Release tasks | Run compatible migrations and block promotion on failure | Delivery owner: pipeline gate and controlled one-off task |
| Configuration | Supply required settings and rotate secrets safely | Platform/security owners: configuration delivery, secret storage, access policies |
| Add-ons | Preserve database, queue, email, and storage contracts | Each dependency owner: endpoint, credentials, limits, backups, recovery procedure |
| Logging | Correlate requests, jobs, deployment events, and failures | Platform/application owners: log destination, identifiers, retention, alerts |
| Recovery | Restart processes and restore service or data after failure | Incident owner: replacement, restore, rollback, and escalation procedures |
Treat this as a behavior inventory rather than a shopping list. For each row, attach a verification step: exercise the health check, fail a release task, rotate a staging credential, or restore a backup. Mark an untested dependency as unresolved rather than assuming its AWS counterpart behaves identically.
Shutdown belongs in this inventory. Heroku's dyno shutdown documentation describes graceful termination followed by forced termination when a process does not exit within its allowance. Identify how your worker currently handles that interruption.
Mad Devs' Veeqo infrastructure modernization describes Dockerization using a Heroku Stack image and moving Jenkins to ECS at separate stages. It demonstrates relevant infrastructure work; it does not establish a complete Heroku-to-AWS application migration.
Choose one AWS path for the pilot
For a containerized web application with background workers, use separate ECS Fargate services for the pilot's web and worker processes. Put the web service behind an Application Load Balancer and keep worker consumption independent of HTTP health. This proposed design gives each process its own deployment and capacity controls while keeping the pilot on one container runtime.
The choice has a practical precedent, with limits. Perfsys describes migrating a German fitness brand's application backend to ECS Fargate. That is an anonymous contractor case study, and it does not identify the exact migration date. It supports the feasibility of this path, not a promise about your cost, schedule, or downtime.
The reason to evaluate migration now is separate. In its February 2026 update, Heroku announced a sustaining engineering model while confirming continued platform support. Use that announcement to review dependencies and ownership; it does not establish an immediate service shutdown.
Build the pilot around one image with explicit web and worker commands, or separate images where dependencies require them. Record the image digest, task definitions, configuration, network access, permissions, and deployment procedure. Demonstrate that the web process can submit a job and that the worker can reach its required data store. Verify denied access as well as successful access.
Decide the queue separately. An existing Redis-backed job framework does not become SQS-compatible when its container starts on Fargate. Retain the existing queue for an initial runtime test if connectivity and support permit, or budget an adapter and changed retry semantics. The next section deliberately evaluates SQS Standard as a separate illustrative choice.
A simpler deployment may suffice for a single web process without independent worker scaling or lifecycle requirements. Validate that smaller scope before adopting this design. For this pilot, however, keeping web and worker separate lets you interrupt the worker and assess recovery while the HTTP endpoint remains available.
Test what happens when the worker stops
Use this illustrative example, not a reported client test: an ECS Fargate web service submits an order-processing message to SQS Standard, and a separate worker updates a transactional database. The expected outcomes are hypothetical; no workload was executed.
Define the business operation narrowly. One job changes an order from pending to processed and inserts a durable completion record keyed by job_id. The producer assigns that stable identifier to the logical operation and preserves it across retries. It is separate from the queue's message identifier.
Both database writes must commit in one transaction. Include a durable transition audit in that transaction to verify the business-operation count independently. Enforce uniqueness on job_id and serialize conflicting attempts, using a database-appropriate locking or conditional-write strategy. A preliminary lookup alone is insufficient: two workers could both observe an absent key. A losing concurrent attempt must roll back, then verify the committed completion record before acknowledging success.
On redelivery, the worker checks that the stored job_id belongs to the expected order and operation. If the matching result is already committed, it skips the state change. If the key belongs to a different operation, it raises an error for investigation rather than acknowledging the message as successful. If no result exists, it performs the transaction. Delete the SQS message only after confirming the commit, using the receipt handle from the current receive attempt. If the commit outcome is uncertain, inspect the durable record before treating the operation as complete. If deletion fails, preserve the committed result and let another delivery resolve through the same check.
Graceful shutdown reduces interrupted attempts. ECS StopTask documentation describes a stop signal, normally SIGTERM, before forced termination. Make the container entrypoint deliver that signal to the worker. On SIGTERM, stop accepting new jobs and finish or abandon the current transaction safely. Verify this with the deployed framework and process tree.
The container's stopTimeout controls the wait before forced termination. Choose it within documented platform limits for the worker's shutdown behavior. It is distinct from SQS visibility timeout, which governs when an undeleted delivery becomes available again. Size visibility around processing and deletion, with extensions for longer work where appropriate. Neither setting guarantees exclusive delivery or replaces application duplicate protection.
Add controlled pause points around commit and deletion. First test SIGTERM handling; then force termination at those points to expose the recovery path when graceful completion is impossible. Use a fresh order for each branch and inspect durable state after processing resumes.
| Stop point | Expected sequence | Acceptance criterion |
|---|---|---|
| Before commit | The transaction rolls back; the message remains undeleted and becomes available after visibility timeout | Recovery leaves the order processed, with one committed status change and one job_id record |
| After commit, before message deletion | Redelivery finds the committed job_id; the worker skips the change and deletes the message | The order remains processed; there is one business operation and one job_id record |
| After successful deletion | Stopping requires no recovery of the completed operation; any possible duplicate remains safe | The order remains processed; the business-operation count and single job_id record match the other branches |
SQS Standard permits duplicate delivery, including within the visibility interval. Correlate job_id, message ID, receive count, task identity, transaction outcome, and deletion result. The pilot passes when the delivery history is recorded and every branch preserves one committed business effect. Because a duplicate after deletion is possible but not guaranteed to occur during a test, inject a duplicate with the same job_id to verify that path.
This transaction does not cover an external payment, email, or other remote side effect. Those operations need a separately tested protocol, such as provider-supported idempotency and reconciliation. Do not infer their safety from the order-status test.
Define the migration scope and stop conditions
Turn each failed expectation into a scoped engineering task. If the order recovers but the team cannot link its database result to the interrupted delivery, improve correlation before cutover. If a retry changes the order twice, fix transaction and concurrency control. If recovery depends on manually reconstructing a message, document that dependency and test a repeatable recovery procedure.
The first pilot includes one web route that creates the selected job, one worker command, and the dependencies needed for that path. Deliver task definitions, image promotion, configuration, access rules, health checks, queue handling, and the three interruption branches. Include a failed deployment and a return to the previous application version. Capture the environment and relevant runtime, framework, and configuration versions with the eventual test evidence.
Set operational thresholds before running the pilot. Agree on acceptable job completion delay, backlog age, HTTP errors, and recovery time for this workload. Assign an owner and response for each alarm. Derive threshold values from the application's requirements and baseline behavior; copying an unrelated timeout or latency target would conceal the decision the pilot should resolve.
Stop promotion when any order disappears from reconciliation, a duplicate business operation appears, a committed result cannot be identified, or retries exceed the agreed recovery window. Also stop if the team cannot determine which deployment processed a job. These conditions should create an incident record with the affected identifiers, the last known durable state, and the person authorized to resume.
Rollback must control writes and job consumption as well as routing. Pause new submissions where necessary, stop the AWS consumer, and account for in-flight messages before resuming the designated consumer. Establish one intended producer and consumer path during the transition. Check that the previous version understands any changed schema and message format. Routing HTTP traffic back does not undo committed database work.
Keep unrelated add-on replacements, full database relocation, and other worker families outside this first scope until its results are understood. Mad Devs' cloud migration strategy provides broader planning context for sequencing those dependencies. For this scenario, the release decision is concrete: proceed only when all three branches reconcile to one processed order per logical job and the team can execute the agreed recovery procedure.
Conclusion
Begin with one worker and one critical job whose business outcome you can inspect. Write down the platform behaviors it depends on, assign ownership, and build the smallest web-to-worker path that exercises them on AWS. Then interrupt processing around the transaction and message deletion, checking both delivery history and durable state. Use those results to define the next migration increment and its stop conditions. Migrating from Heroku to AWS becomes a sequence of evidenced decisions when each increment proves how work resumes after interruption. Keep the remaining dependencies in the inventory until their behavior has been verified too.
DevOps & Cloud Engineering Prove your first workload on AWS We can inventory application dependencies, build a pilot for one web and worker pair, and agree on the restart and recovery checks required before cutover. Explore a migration pilot |
