Nov 18, 20269 min read

Heroku vs AWS: Managed Platform or Your Own Cloud Account?

How Heroku's dynos, add-ons and git push workflow compare with running the same backend on ECS, RDS and SQS in your own AWS account, and what changes after Heroku's move to sustaining engineering.

Illustration for Heroku vs AWS: Managed Platform or Your Own Cloud Account?

Heroku is the platform that made git push heroku main the normal way to ship a web app, and for one app with a Postgres database it is still about as little infrastructure as you can run. It gets harder when the app needs something Heroku does not sell as an add-on, when a second team wants the database inside the company's own AWS account, or when the bill for several Standard dynos and a Premium Postgres plan starts to look like a line item someone has to defend.

AWS is the other end of that trade: every primitive Heroku hides is available and configurable in your own account, and all of it is yours to wire together. This guide compares the two on compute, databases, background work, networking and cost, and covers how to keep the Heroku-style workflow while the app runs in AWS.

Heroku vs AWS at a Glance

EncoreHerokuAWS by hand
Where the app runsECS on Fargate or EKS in your AWS accountDynos in Heroku's accountsECS, EKS, App Runner or EC2 in your account
PostgresRDS, declared in codeHeroku Postgres add-onRDS or Aurora, configured by you
Background workPub/Sub topics on SNS and SQSWorker dynos plus a Redis or queue add-onSQS, SNS or EventBridge, wired by you
Scheduled jobsCron jobs, managed by the Encore platformHeroku Scheduler add-onEventBridge Scheduler and a task or function
Local developmentencore run starts Postgres and queuesheroku local plus your own databaseDocker Compose or a shared dev account
IAM and networkingA VPC created by Encore, and Encore provisions an IAM role for the serviceNo IAM roles in your accountIAM, VPC, subnets and security groups you write
RoadmapOpen source framework, active developmentSustaining engineering since February 2026Active

Compute: Dynos vs ECS

A Heroku dyno is a container that runs one process type from your Procfile, and scaling is a slider or heroku ps:scale web=3. The dyno manager restarts crashed dynos, cycles every dyno at least once a day and routes HTTP traffic through Heroku's router, so there is no load balancer, target group or health check to configure.

On AWS the closest equivalent is ECS on Fargate: a task definition describes the container, a service keeps a number of tasks running behind an Application Load Balancer, and autoscaling policies change that number. You choose CPU and memory per task in small steps, you can run long-lived workers without the daily restart, and each task gets its own IAM role for calling other AWS services. The price for that control is the configuration: a VPC, subnets, security groups, an ECR repository, a task role and an execution role, all usually written in Terraform or CDK.

Databases: Heroku Postgres vs RDS

Heroku Postgres is provisioned with heroku addons:create, attaches a DATABASE_URL to the app and handles backups, follower databases and maintenance windows. Plans are fixed tiers, so a database that needs more connections or storage moves to the next tier rather than to an instance size you pick.

Amazon RDS for PostgreSQL runs in your VPC, with instance classes, storage, read replicas, automated backups and point-in-time recovery that you configure. It can sit in private subnets that only your services reach, use IAM database authentication and be shared with analytics or data tooling in the same account, none of which is possible when the database lives in Heroku's account.

Background Jobs and Scheduled Work

On Heroku a background job is a worker dyno reading from a queue, usually Redis through Sidekiq, BullMQ or RQ, and the queue is another add-on. Scheduled work runs through Heroku Scheduler, which starts a one-off dyno every 10 minutes, every hour or once a day, and which Heroku describes as best effort, so an occasional run can be skipped.

AWS splits this into managed services: SQS queues with dead-letter queues for retries, SNS topics for fan-out, and EventBridge Scheduler for cron expressions with time zones and flexible windows. Each is more capable than its Heroku counterpart, and each needs its own IAM permissions, a consumer process and, typically, infrastructure code.

Networking, Security and Compliance

Heroku's Common Runtime gives each app a public HTTPS endpoint and no private network. Private Spaces add an isolated network, static outbound IPs and VPC peering, as a separate, more expensive product. Security reviews often stop here, because customer data in a database that runs in a vendor's AWS account is harder to reason about than data in your own.

With AWS, the database and services sit in your VPC, access is controlled with IAM and security groups, and CloudTrail records API calls in your account. That is usually why teams with security questionnaires or enterprise customers move off Heroku, more than the price.

Cost

Heroku bills per dyno and per add-on plan, with prices listed on its pricing page. It is predictable and includes the operations work, but each piece is priced as a fixed tier, and the platform margin is part of every tier.

On AWS you pay for Fargate vCPU and memory by the second, RDS by instance hour and storage, plus load balancers, NAT gateways and data transfer. The AWS bill grows more in line with use. The engineering hours spent building and maintaining the infrastructure usually decide the comparison, more than the raw bill.

How Does Encore Compare to Heroku and AWS?

Encore

Encore brings infrastructure from code to TypeScript and Go backends, which is how it keeps Heroku's push-to-deploy workflow while the app runs as ECS services, RDS and SQS in your own AWS account. The database, the queue that replaces a worker dyno and the scheduled job that replaces Heroku Scheduler are declared in the app, and Encore provisions them in your account when you deploy, as described in Connect your cloud account.

Set up the app

Install the Encore CLI with the command for your system, then create the app:

Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

~
$ encore app create orders --example=ts/hello-world$ cd orders && mkdir -p orders/migrations

The orders folder gets an encore.service.ts that exports new Service("orders") and a migration that creates an orders table with id, email, total_cents, created_at and a nullable receipt_sent_at column. The service below stores an order, hands the receipt to a subscriber the way a worker dyno would pick it from Redis, and runs an hourly cleanup that would have been a Heroku Scheduler entry:

// orders/orders.ts import { api, APIError } from "encore.dev/api"; import { SQLDatabase } from "encore.dev/storage/sqldb"; import { Topic, Subscription } from "encore.dev/pubsub"; import { CronJob } from "encore.dev/cron"; import log from "encore.dev/log"; // Heroku Postgres becomes RDS in your AWS account. const db = new SQLDatabase("orders", { migrations: "./migrations" }); interface OrderPlaced { orderId: number; } // The worker dyno and its Redis add-on become SNS and SQS. export const orderPlaced = new Topic<OrderPlaced>("order-placed", { deliveryGuarantee: "at-least-once", }); export const place = api( { expose: true, method: "POST", path: "/orders" }, async (p: { email: string; totalCents: number }): Promise<{ id: number }> => { if (!p.email.includes("@") || !Number.isInteger(p.totalCents) || p.totalCents <= 0) { throw APIError.invalidArgument("email and a positive integer totalCents are required"); } const row = await db.queryRow<{ id: number }>` INSERT INTO orders (email, total_cents) VALUES (${p.email.toLowerCase()}, ${p.totalCents}) RETURNING id`; await orderPlaced.publish({ orderId: row!.id }); return { id: row!.id }; }, ); const _ = new Subscription(orderPlaced, "send-receipt", { handler: async ({ orderId }) => { // Claim the row first, so a redelivered message does not send two receipts. const order = await db.queryRow<{ email: string; total_cents: number }>` UPDATE orders SET receipt_sent_at = now() WHERE id = ${orderId} AND receipt_sent_at IS NULL RETURNING email, total_cents`; if (!order) return; log.info("send receipt", { to: order.email, totalCents: order.total_cents }); }, }); // Heroku Scheduler becomes a cron job that calls this endpoint. export const purgeAbandoned = api({ expose: false }, async (): Promise<void> => { await db.exec` DELETE FROM orders WHERE receipt_sent_at IS NULL AND created_at < now() - interval '30 days'`; }); const purge = new CronJob("purge-abandoned-orders", { title: "Purge orders that never completed", every: "1h", endpoint: purgeAbandoned, });
~/orders
$ encore run$ curl -X POST localhost:4000/orders -d '{"email":"ada@acme.dev","totalCents":4900}'{"id": 1}

encore run starts Postgres locally, applies the migration and runs the topic and subscriber in the same process, so the web-plus-worker flow works on a laptop without heroku local, a Redis container or a shared staging database. Cron jobs are managed by the Encore platform and do not run locally or in preview environments, so you call purgeAbandoned by hand to test it.

When you push, Encore provisions the VPC, ECS services, the RDS database, the SNS topic with an SQS queue and dead-letter queue per subscription, and Encore provisions an IAM role for the service. The AWS infrastructure docs list each resource. A coding agent asked to add a queue or a scheduled job adds it in the same TypeScript change, and encore run shows whether it works before anything reaches your account.

The database, Pub/Sub and cron job docs cover each declaration used here in more detail.

Best fit: teams leaving Heroku who want the push-to-deploy workflow on infrastructure that sits in their own AWS account and shows up in their own AWS bill.

Staying on Heroku

Heroku remains a sensible home for a single app with a Postgres database and modest traffic, especially when nobody on the team wants to own a cloud account. The February 2026 update says existing customers keep their pricing, billing and service, and Heroku has since shipped maintenance features such as larger slug limits. What the sustaining engineering model does change is planning: features you are waiting for are unlikely to arrive, and new Enterprise contracts are no longer offered.

Best fit: small apps that fit the dyno and add-on model and have no requirement to run in their own cloud account.

AWS by Hand

Building it yourself means ECS on Fargate behind an Application Load Balancer, RDS in private subnets, SQS and SNS for background work, EventBridge Scheduler for cron, Secrets Manager for configuration, and the IAM roles and security groups that connect them, typically in Terraform. It gives a platform team full control over every setting and fits companies that already run other workloads in AWS with shared modules and pipelines.

Best fit: teams with platform engineers and existing Terraform or CDK modules who want to tune every resource.

How to Choose

Stay on Heroku when one app, a Postgres database and a few add-ons cover what you need and nobody asks where the data lives. Build on AWS by hand when you have a platform team and want full control of every resource. Pick Encore when you want to leave Heroku for your own AWS account and keep a workflow where the database, queues and scheduled jobs are part of the code you push.

Frequently asked questions

Is Heroku cheaper than AWS?

Yes. For one small app, Heroku often costs less in total, because nobody spends time on VPCs, IAM or load balancers. As an app grows to several dynos, a larger Heroku Postgres plan and add-ons, the same workload on ECS and RDS in your own AWS account usually costs less in cloud spend, and the difference has to be weighed against the engineering time AWS takes to set up and run.

Does Heroku run on AWS?

Yes. Heroku runs its dynos and Heroku Postgres on AWS infrastructure, but in accounts Heroku controls. Your app cannot attach an IAM role, join your VPC or use AWS services directly with the same networking and identity as resources in your own account, apart from what Private Spaces and peering provide.

Is Heroku being shut down?

No. In February 2026 Salesforce moved Heroku to a sustaining engineering model, focused on stability, security and support rather than new features, and stopped selling Enterprise Account contracts to new customers. Existing apps keep running, and credit card customers can still sign up.

How do I get a Heroku-style git push workflow on AWS?

With Encore, you declare the database, queues and scheduled jobs in TypeScript or Go next to your endpoints. encore run starts them locally, and a git push deploys the app to ECS on Fargate or EKS in your own AWS account, with RDS for Postgres and SNS and SQS for the queues.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders