---
title: "Heroku"
description: "Heroku is a cloud platform as a service where you can deploy projects and websites. It supports several programming languages, so it’s no surprise that Heroku’s really popular."
---

# Heroku
> Heroku is a cloud platform as a service where you can deploy projects and websites. It supports several programming languages, so it’s no surprise that Heroku’s really popular.

## Articles

### [Heroku CLI v9: Infrastructure Upgrades and oclif Transition](https://yomu.fyi/post/heroku-cli-v9-infrastructure-upgrades-and-oclif-transition.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Anush DSouza
- Published: Jul 25, 2024
- Type: Announcement

Heroku CLI 9.0.0 is an architectural upgrade centered on moving all core commands from a partly legacy structure to oclif. Core commands are consolidated into one package, while improved unit and integration coverage, telemetry, and a simpler automated release process support contribution, maintenance, and pre-release testing. The oclif migration provides a modular command architecture with plugin support and is intended to make command behavior more consistent, maintenance easier, and provide better scalability. Users should expect breaking changes including altered whitespace, newlines, table formatting, colors, argument ordering, flag removals, and a required separator for additional flags; deprecated commands including outbound-rules, pg:repoint, orgs:default, certs:chain, certs:key were removed. Changes apply to core commands, not separately installed plugins, and the release can be installed with heroku update.


### [How to Use pnpm on Heroku](https://yomu.fyi/post/how-to-use-pnpm-on-heroku.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Colin Casey
- Published: Jul 19, 2024
- Type: Tutorial

Heroku’s Node.js buildpack supports pnpm, a fast, disk-efficient alternative to npm, and early users reported 10–40% faster install times on Heroku deployments. pnpm uses a content-addressable store and symlinks to avoid duplicate packages, accelerates dependency installation by combining resolve, fetch, and linking, and enforces dependency boundaries. The tutorial uses Node.js v18 or higher and Corepack to initialize and pin pnpm 9, then creates an Express application whose pnpm-lock.yaml enables buildpack support and consistent package resolution. The demo server handles HTTP GET requests with “Hello pnpm!” and listens on process.env.PORT or defaults to 3000. It finishes by adding a Procfile, committing the project to Git, creating a Heroku app, and deploying with git push heroku main.


### [Optimizing Data Reliability: Heroku Connect & Drift Detection](https://yomu.fyi/post/optimizing-data-reliability-heroku-connect-drift-detection.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Siraj Ghaffar
- Published: Jun 26, 2024
- Type: Explainer

Heroku Connect syncs Salesforce data with Heroku Postgres, but primary polling can miss changes when long-running Salesforce automations commit after the polling window advances, creating drift. The service uses secondary polls over the same bounds as primary polls to find and repair missed changes, with Bulk API or SOAP API selected according to dataset size and retries for failed polls. Recent improvements change Bulk API drift handling by creating one secondary bulk job for each primary bulk job, then adding corresponding batches instead of creating many jobs. Secondary tasks are now scheduled and executed with limited concurrency, reducing simultaneous database connections consumed while Postgres is updated and preserving capacity for applications. The post says these changes reduce load on Salesforce and improve operational reliability during heavy synchronization, while noting that Heroku Connect remains asynchronous rather than truly real-time.


### [Evolving the Backend Storage for Platform Metrics](https://yomu.fyi/post/evolving-the-backend-storage-for-platform-metrics.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: David Murray
- Published: May 9, 2024
- Type: Problem & solution

Heroku migrated MetaaS, its internal Metrics as a Service platform metrics backend, from self-hosted Apache Cassandra to AWS’s DynamoDB. MetaaS collects application observations, aggregates them into per-application, per-minute statistics such as median, maximum, and 99th-percentile response time, and stores time-series data for dashboard metrics, alerting, and autoscaling. The migration first duplicated Kafka stream-processing writes into DynamoDB, then used “Science Mode” to compare Cassandra and DynamoDB read results in production without changing returned data. After edge cases were fixed and results matched, retention-period TTL expiry avoided a separate historical data transfer, while gradual query cutovers provided another safeguard. Since 100% of MetaaS queries moved to DynamoDB in May of last year, DynamoDB has remained reliable at scale and been faster and cheaper than the Cassandra clusters, with no noticeable effect on users.


### [Build Well-Documented and Authenticated APIs in Node.js with Fastify](https://yomu.fyi/post/build-well-documented-and-authenticated-apis-in-node-js-with-fastify.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Julián Duque
- Published: Apr 29, 2024
- Type: Tutorial

This walkthrough builds and deploys a Node.js API with Fastify, covering a public directory endpoint and a JWT-protected profile endpoint backed by Heroku Postgres. It uses Fastify’s plugin architecture, including a custom database plugin that reads DATABASE\_URL, creates a PostgreSQL pool, and decorates the server with db.query; @fastify/autoload registers plugins from the plugins directory. Authentication uses a JWT signed with an RSA256 private key, while the public key validates requests, and Fastify Swagger plugins generate an OpenAPI specification and UI that Postman can import as an API client. After local testing, the project seeds 50 database records, configures the RSA public key, and deploys through Heroku CLI commands, where the /directory endpoint returns usernames and the deployed API is shown running.


### [Improved Browser Testing on Heroku with Chrome](https://yomu.fyi/post/improved-browser-testing-on-heroku-with-chrome.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Mars Hall
- Published: Apr 9, 2024
- Type: Announcement

Automated browser tests on Heroku can fail when installed Chrome and Chromedriver versions drift apart, producing a mismatch error that stops the suite. The post introduces the community Chrome for Testing Heroku Buildpack, created to address installation reliability as Chrome continuously receives updates rather than pinning a browser version that quickly becomes outdated. Apps should remove existing Chrome and Chromedriver buildpacks and add heroku-community/chrome-for-testing as the first buildpack. By default it downloads Google's latest Stable release, while GOOGLE\_CHROME\_CHANNEL can select Stable, Beta, Dev, or Canary. After deployment, chrome and chromedriver are placed on the dyno PATH for tools including Selenium WebDriver and Puppeteer, providing executables for browser automation.


### [Building a GPT Backed by a Heroku-Deployed API](https://yomu.fyi/post/building-a-gpt-backed-by-a-heroku-deployed-api.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Julián Duque
- Published: Mar 28, 2024
- Type: Tutorial

The walkthrough shows how to connect an OpenAI custom GPT to a Node.js backend that provides natural-language access to an employee directory. It builds an Express API with a POST /search endpoint, where OpenAI’s Chat Completions API converts a user’s question into a single SQL query, the database returns rows, and a second OpenAI call turns those rows into a natural-language response. The project uses Heroku Postgres, environment configuration, bearer-key authentication, Swagger UI, and an OpenAPI specification imported into the GPT action. The deployment flow covers seeding dummy records, deploying from a GitHub-connected repository, and configuring the action to call the hosted API, while noting that data leaves Heroku’s trust boundary for OpenAI services.


### [Working with ChatGPT Functions on Heroku](https://yomu.fyi/post/working-with-chatgpt-functions-on-heroku.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Julián Duque
- Published: Jan 30, 2024
- Type: Tutorial

Menu Maker is a Node.js web application that turns user-supplied ingredients into a dish name, fine-dining description, ingredient list, and recipe. Its React front end communicates with an Express back end, which adds prompt instructions and sends the request to OpenAI’s Chat Completions API. The application uses ChatGPT’s function calling feature to define an updateDish function with structured JSON fields for the title, description, ingredients, and recipe, so parsed arguments can update React state directly. The GitHub-hosted Node.js monorepo is deployed to Heroku, where an OPENAI\_API\_KEY config var authenticates requests, an optional CHATGPT\_MODEL selects the model, and Heroku runs yarn build and yarn start.


### [How to Use pgvector for Similarity Search on Heroku Postgres](https://yomu.fyi/post/how-to-use-pgvector-for-similarity-search-on-heroku-postgres.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Valerie Woolard
- Published: Nov 16, 2023
- Type: Tutorial

Heroku Postgres now supports pgvector on all Standard-tier or higher databases running Postgres 15, adding vector storage and functions for similarity search and machine-learning applications. Older Postgres versions require an upgrade to Postgres 15. The workflow generates embeddings, adds a VECTOR(100) column, and stores values using SQL or Python with psycopg, pgvector-python, and Wikipedia2Vec’s pretrained 100-dimensional model. Queries can rank vectors with Euclidean, cosine, or inner-product distance; the example uses <-> to return five animals nearest to shark, producing crocodile, dolphin, whale, turtle, and alligator. Results depend on the embedding model and corpus, while indexes introduce approximate nearest-neighbor search; pgvector supports IVFFlat and HNSW, with IVFFlat requiring table data for better recall.


### [Router 2.0 Common Runtime Router: The Road to Beta](https://yomu.fyi/post/router-2-0-common-runtime-router-the-road-to-beta.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Elizabeth Cox
- Published: Oct 30, 2023
- Type: Explainer

Heroku’s Router 2.0 is a beta replacement for the Common Runtime’s Erlang-based “Hermes” router, which is planned to be replaced in 2024. The project addresses the difficulty of safely delivering upgrades from a legacy custom HTTP server and aims to share routing code with the Go-based Private Spaces router; common functionality has been extracted into an internal HTTP library. Architecturally, Router 2.0 is an L7 router running in memory behind the existing L4 proxy, alongside Hermes, allowing app-level traffic to move from the old path without a big-bang cutover. The team added continuous load testing that exercises scaling policies and blocks deployments missing internal service-level objectives, and introduced Network Error Logging to measure browser-observed failures. Feature parity is still incomplete, with HTTP/2 planned next; apps can opt into the beta using a Heroku Labs command.


### [More Predictable Shared Dyno Performance](https://yomu.fyi/post/more-predictable-shared-dyno-performance.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Michael Friis
- Published: Apr 11, 2023
- Type: Announcement

Heroku describes a year-long effort to make CPU access more predictable for shared dynos in the Common Runtime. Previously, individual dynos could burst CPU use relatively freely when capacity was available, improving utilization but sometimes allowing misconfigured or malicious “noisy neighbors” to cause response-time spikes or H12 timeouts. The platform introduced improved resource isolation for eco, basic, standard-1X, and standard-2X Dynos, limiting bursts while preserving the ability to burst and aiming for fairer access to shared CPU resources. The change does not alter the number of dynos per instance, and Performance, Private, and Shield type Dynos are excluded because they run on dedicated instances.


### [The Adventures of Rendezvous in Heroku’s New Architecture](https://yomu.fyi/post/the-adventures-of-rendezvous-in-heroku-s-new-architecture.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Ethan Limchayseng
- Published: Jan 19, 2022
- Type: Incident / postmortem

Heroku’s migration of Rendezvous, the bidirectional proxy that connects Heroku Run sessions to one-off dynos, from EC2 Classic to AWS VPCs caused one customer’s app to hit H12 timeouts. The move replaced a single Elastic IP ingress and process-level TLS termination with a Network Load Balancer, whose larger TLS frames exposed a blocking flaw in Rendezvous’s single-threaded Ruby channel loop. That loop used IO.select on the TCP socket and dyno terminal, but OpenSSL::SSL::SSLSocket could retain unread buffered data after a partial read; IO.select saw no TCP bytes and blocked beyond the Heroku Router’s 30-second limit. Engineers reproduced the behavior across two languages, instrumented the instance agent, then fixed the channel with separate threads and corrected socket-reading and IO.select handling. After staging tests, the customer moved back to VPC Rendezvous and confirmed the issue was resolved.


### [Building a Monorepo with Yarn 2](https://yomu.fyi/post/building-a-monorepo-with-yarn-2.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Danielle Adams
- Published: Dec 23, 2020
- Type: Tutorial

The post presents Yarn 2 workspaces as a way to manage dependencies for a JavaScript or Node.js monorepo containing separate server and UI applications. It configures the root package.json with workspace directories, imports the workspace-tools plugin, pins the project to a checked-in Yarn binary with yarn set version berry, and enables the dependency cache through .yarn/cache and Plug’n’Play. The walkthrough adds Express, TypeScript, and @types/express to a server workspace, creates a Next.js UI workspace, and uses workspace scripts to build both applications, while yarn dlx initializes TypeScript without a global install. It also shows the Git files to retain, generated JavaScript to ignore, and a Heroku start script that launches the server workspace; the stated benefit is faster installs through a committed cache and zero-install deployment.


### [Extend Flows with Heroku Compute: An Event-Driven Pattern](https://yomu.fyi/post/extend-flows-with-heroku-compute-an-event-driven-pattern.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Chris Marino
- Published: Dec 11, 2020
- Type: Tutorial

The post presents an event-driven pattern for extending Salesforce Flow with custom business logic deployed as a Heroku app and exposed as an external service. It uses an OpenAPI specification to define the interface, generates a Node.js application stub, adapts it for Heroku with a Procfile and port configuration, and registers the API in Salesforce. Flow accesses the service through a Named Credential using basic HTTP authentication, while the Heroku app authorizes Salesforce access with a JWT account token and API token. The example begins with product retrieval and then adds a Get Inventory method that can read inventory and update the Salesforce Product object. A Platform Event can trigger a flow that calls this method, while programmers and low-code builders iterate against the shared API contract before completing their work independently.


### [How I Broke \`git push heroku main\`](https://yomu.fyi/post/how-i-broke-git-push-heroku-main.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Damien Mathieu
- Published: Oct 1, 2020
- Type: Incident / postmortem

Incident #2105 began during a production deployment of a Go-based Git server after a configuration variable had been set but not transmitted to production instances. Staging deployment completed successfully before the same change was attempted in production. The deployment sent a new code version to one batch, whose unauthenticated calls to a private API produced HTTP 401 responses that were returned publicly; the author paused before deploying the remaining batches and resolved the issue by synchronizing configuration, killing affected processes, and allowing them to restart. The post argues that the failure was enabled by a process requiring separate, infrequent manual actions rather than being solely an individual omission. Its proposed remedy is to combine configuration synchronization with code deployment, or alternatively warn when deployment begins with unsynchronized variables, supported by a blameless retrospective.


### [The Life-Changing Magic of Tidying Ruby Object Allocations](https://yomu.fyi/post/the-life-changing-magic-of-tidying-ruby-object-allocations.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Richard Schneeman
- Published: Sep 16, 2020
- Type: Explainer

The post presents object-allocation profiling as a way to find Ruby performance hotspots, including code inside libraries such as Active Record. It uses memory\_profiler and derailed\_benchmarks to group allocations by gem, file, and source location, then examines whether each allocation can be removed or avoided. A benchmark compares a direct maximum comparison with an array-based version: the array allocation makes the latter 2.04x slower in the reported run. One optimization for cache\_version reuses a raw database timestamp string when it is safe, checking its type, format, timezone, and provenance before deleting separators and padding PostgreSQL-truncated values. This change reduces allocation from 743,842 bytes and 6,626 objects to 702,955 bytes and 6,063 objects, and the post reports up to 1.12x faster; combined optimizations reach 1.23x overall.


### [Let’s Debug a Node.js Application](https://yomu.fyi/post/let-s-debug-a-node-js-application.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Julián Duque
- Published: Aug 3, 2020
- Type: Tutorial

Node.js applications can be difficult to debug because asynchronous workflows complicate stack traces, while crashes may require core-dump analysis through complex command-line tools. The article presents a layered toolkit: production-oriented logging with Pino or Winston, interactive inspection through Node Inspect and Chrome DevTools, IDE integrations, and the standalone ndb debugger. Running node --inspect-brk launches an application for inspection at chrome://inspect, where breakpoints, stepping, call stacks, heap snapshots, and memory profiling are available; ndb additionally supports edit-in-place changes. For catastrophic crashes, llnode maps JavaScript frames and objects to C/C++ representations from a core dump generated with process.abort, while debug filters namespaced logs and trace and clarify improve asynchronous traces and remove Node.js internals, respectively, for local debugging.


### [Ground Control to Major TOML: What Is a TOML File and Why Do Buildpacks Use TOML?](https://yomu.fyi/post/ground-control-to-major-toml-what-is-a-toml-file-and-why-do-buildpacks.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Joe Kutner
- Published: Jul 22, 2020
- Type: Explainer

The Cloud Native Buildpacks project uses TOML for developer-facing configuration after weighing its readability, predictability, and fit for lightweight settings against YAML, JSON, and XML. TOML is a plain-text format with a .toml extension, built around key-value pairs, headers, sections, arrays, and nested tables; it permits comments, avoids indentation-based structure, and supports explicit types. Buildpack users generally do not write these files from scratch, but when configuration is needed, the format provides clarity without complex schemas or large declarative configuration. Buildpacks favor convention over configuration and detect behavior from application contents, so TOML suits the simple human-defined properties around their tooling, while JSON remains for machine-readable formats such as OCI image metadata. The trade-off is that TOML tooling for parsing and querying is less readily available, and the format may still feel unfamiliar, but prior use in containerd, Cargo, and Poetry supported the choice.


### [Making Time to Save You Time: How We Sped Up Time-Related Syscalls on Dynos](https://yomu.fyi/post/making-time-to-save-you-time-how-we-sped-up-time-related-syscalls-on-d.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Will Farrington
- Published: Jul 16, 2020
- Type: Problem & solution

A customer support ticket exposed poor performance in clock\_gettime(3) and gettimeofday(2) for an application making many timing calls through transaction tracing. Heroku's Runtime Infrastructure team found that Linux was selecting the Xen clocksource, whose Xen version did not support virtual dynamic shared object (vDSO) acceleration, forcing costly userspace-to-kernel context switches. The team evaluated available clocksources and selected tsc, which uses the Time Stamp Counter and supports vDSO; they assessed concerns about backwards clock drift, including older CPU inconsistencies and Xen VM freezing, against their newer Intel CPUs and EC2 environment. After vdsotest validation, the configuration was deployed across the Common Runtime and Private Spaces dyno fleet, and the initiating customer plus other customers observed performance improvements.


### [How We Added Client Rate Throttling to the Platform API Gem](https://yomu.fyi/post/how-we-added-client-rate-throttling-to-the-platform-api-gem.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Richard Schneeman
- Published: Jul 8, 2020
- Type: Explainer

The platform-api gem needed client-side rate throttling for Heroku’s API, which uses GCRA and allows a bucket of up to 4,500 request tokens, replenished at roughly 75 per minute. The goal was to avoid 429 responses without creating retry traffic, while operating within the client library and without coordination across machines. The work combined tests with a simulated server, processes and threads, charting, and metrics for average retry rate, maximum sleep, request-count variance, and workload-clearing time. The winning strategy adjusted sleep downward using the remaining request count relative to the 4,500-request maximum; in simulation it achieved a 3.07% retry rate, 17.32-second maximum sleep, 78.44 standard-deviation request count, and 84.23 seconds to clear 4,500 requests. The change shipped behind a null strategy before becoming the default in version 3.0.0+, with feedback reporting no significant breaks or severe application dysfunction.


[Newer posts](https://yomu.fyi/company/heroku/page/2.md) · [Older posts](https://yomu.fyi/company/heroku/page/4.md)
