Black Friday/Cyber Monday Annual Sale. 40% off now!

NEW: Rails 5 Test Prescriptions; Agile Web Development with Rails 5.1 in print

NEW: Adopting Elixir; A Swift Kickstart, Second Edition

Announcing PCI Compliance for Heroku Shield

In June we announced Heroku Shield with new high compliance features for Heroku Private Spaces. Heroku Shield enables businesses like AlignTech to deploy apps that handle protected healthcare information (PHI) in accordance with government regulations.

Today, we are proud to announce that Heroku Shield Services have been validated as PCI Level 1 Service Provider compliant. This designation helps our customers understand how Heroku's systems and human processes work together to safeguard customer data. It helps security and audit teams in choosing Heroku as a platform for running a company's most critical apps.

Further Strengthening Trust with PCI

The Payment Card Industry Data Security Standard (PCI DSS) is one of the most widely known, industry-defined security standards. It mandates explicit security controls and requires certified organizations to be audited by a qualified security assessor. The combination of rigor and broad adoption makes PCI a valuable tool for building trust between Heroku

Continue reading “Announcing PCI Compliance for Heroku Shield”

Announcing Heroku Private Space Peering for AWS

Two years ago, we introduced Heroku Private Spaces as a new platform abstraction that combines powerful network isolation features with the seamless developer experience of Heroku.

Today we are announcing Heroku Private Space Peering, a new capability to connect the isolated Private Space network to apps and services in AWS VPCs controlled by you. Now you can build apps in Heroku that connect securely and privately to backend systems and workloads in AWS like a directory service, a search stack, a data warehouse, or a legacy SQL database.

How It Works

Private Space Peering is available to all Heroku Enterprise customers. Setting up a peering connection takes just a few simple actions. After you have initiated the peering connection on your AWS VPC, it will show up in the list of peerings for your Private Space in the Dashboard Network tab:

Pasted image at 2017_10_31 10_23 PM

Heroku will automatically route dyno network traffic

Continue reading “Announcing Heroku Private Space Peering for AWS”

Modern Vim now in beta; November PragPub Magazine now available

Heroku Connect Update: Fast Writes, Global Deployment, and a Guided Management Experience

Today we are pleased to announce a significant update to Heroku Connect, one that is a culmination of two years of work to improve every aspect of the service. We’ve focused on three primary areas: improving write speed, geographically expanding the service, and intelligently guiding design and troubleshooting workflows. To that end, we’ve enabled bulk writes resulting in a 5x average increase in sync performance to Salesforce, deployed Connect in six global regions to be closer to customers’ databases, and built three guided management experiences that significantly increase user productivity.

Collectively, these enhancements will enable Heroku Connect to continue to meet the ever increasing demands of enterprise customers.

Enterprise Scale Data Integration

We’ve been fortunate to see rapid adoption of Connect amongst our largest enterprise customers. Not surprisingly, these customers tend to have large amounts of data, complex data models, and very high expectations when it comes to performance.


Continue reading “Heroku Connect Update: Fast Writes, Global Deployment, and a Guided Management Experience”

PostgreSQL 10 Now Available in Beta on Heroku Postgres

Earlier this month, PostgreSQL 10.0 was released. Today, we are excited to announce PostgreSQL 10 is available in beta on Heroku, bringing a number of notable feature and performance improvements to our managed PostgreSQL database service.

The beta provides customers who want to try out the new release an easy way to do so, while customers who are happy with the current version can continue to stay on version 9.6 until we make version 10 generally available. Also, new databases will continue to default to version 9.6 until we release version 10 to GA.

While PostgreSQL 10 has many feature and performance benefits, we’d like to highlight several that we are most looking forward to:

Performance Improvements

Most Heroku Postgres users will notice a performance boost when using PostgreSQL 10 for certain types of queries. The introduction of improved parallel queries, which optimize common types

Continue reading “PostgreSQL 10 Now Available in Beta on Heroku Postgres”

Format Your Elixir Code Now

Elixir 1.6 will be shipping with an important new feature: autoformatting. Let's explore it today.

Autoformatting is a common practice in languages communities like Go.
Now, this practice is coming to Elixir as part of the language. Borrowing the
in favor of autoformatting
from the Go community, autoformatted code ought to be:

  • Easier to write: never worry about minor formatting concerns while hacking away.
  • Easier to read: when all code looks the same you need not mentally convert others' formatting style into something you can understand.
  • Easier to maintain: mechanical changes to the source don't cause unrelated changes to the file's formatting; diffs show only the real changes.
  • Uncontroversial: never have a debate about spacing or brace position ever again!

Whether you agree with all these points or not, the Elixir language (which is
largely written in Elixir) just underwent a massive community-powered
to conform with its

Continue reading “Format Your Elixir Code Now”

Create Quick JSON Data Dumps From PostgreSQL

There are lots of ways that we consume the data stored in our PostgreSQL
databases. We build apps that query against our database. We explore the data
manually from a PSQL session. Perhaps we even occasionally create a dump of the
databases' schema and data using pg_dump.

What if we want to export some subset of our data in a general purpose format
that we can easily pass along to others? A JSON dump would fit that bill. In
this post we'll explore how to quickly create a JSON dump of some of our data.

Why a JSON dump?

A customized JSON dump of our data is appealing for two reasons.

First, we can craft the shape of the data being dumped. We can be sure to
include specific, relevant fields. This includes computed values. Likewise, we
can exclude sensitive and irrelevant data. For instance, we may not want to

Continue reading “Create Quick JSON Data Dumps From PostgreSQL”

Container Registry & Runtime GA: Deploy Docker Images to Heroku

In the last few years Docker has emerged as a de facto standard for packaging apps for deployment. Today, Heroku Container Registry and Runtime is generally available, allowing you to deploy your Docker images directly to Heroku.

With Container Registry, you get all of the benefits of Docker — a great local development experience and flexibility to create your own stack — with the benefits of running on Heroku: maintained infrastructure, container orchestration, routing, the leading add-ons ecosystem, and a world-class security & operations team.

To deploy your Docker image to Heroku, simply run one command in the directory of your Dockerfile:

$ heroku container:push web

=== Building web
Step 1 : FROM alpine:latest
Successfully built 74bab4bf0df3

=== Pushing web
The push refers to a repository []
c8821d626157: Pushed

Heroku Container Registry allows you to easily build your Docker image locally and deploy to Heroku. Both Common Runtime

Continue reading “Container Registry & Runtime GA: Deploy Docker Images to Heroku”

Generate Dates in PostgreSQL

PostgreSQL has shipped with the generate_series() function for quite some
time. This function is often used to generate series of numeric data. For
instance, in my post, Understanding Common Table Expressions with
I used it to generate a series of integers from 1 to 100.

As of PostgreSQL 8.4, support for generating series of timestamp data was
added. I don't see this used often, so let's take a look at it.

We could take a peak at the online documentation to see the function
signature, or we could pull it up in psql using \df.

> \df generate_series()
                                                               List of functions
   Schema   |      Name       |         Result data type          |                        Argument data types                         |  Type
 pg_catalog | generate_series | SETOF bigint                      | bigint, bigint                                                     | normal
 pg_catalog | generate_series | SETOF bigint                      | bigint, bigint, bigint                                             | normal
 pg_catalog | generate_series | 
Continue reading "Generate Dates in PostgreSQL"

In the Cloud, No One Can Hear Your OutOfMemoryError

Pushing an app to the cloud can feel like launching a probe into space. Once your project is thousands of miles away you can't bang on it with a hammer or replace broken parts when there's a problem. Your debugging efforts must rely on the instrumentation, telemetry, and remote controls included with the app when it was deployed. On Heroku, we've gladly done some of that prep work for you.

Two new Heroku features, Heroku Exec and Language Runtime Metrics, improve your production monitoring, inspecting, and debugging experience on the platform. With Heroku Exec, you can create secure TCP and SSH tunnels into a dyno, which facilitate SSH sessions, port forwarding, remote debugging, and most popular diagnostic tools. Our Language Runtime Metrics feature supplements these tools by displaying detailed time series metrics in your Heroku dashboard.

You can try Heroku Exec right now by running the following command on any

Eclipse Mat

Continue reading “In the Cloud, No One Can Hear Your OutOfMemoryError”

Heroku Exec and Language Runtime Metrics GA: Runtime Debugging on Heroku

We’ve all been there — you push your code to production and a leak causes memory usage to grow out of control. To determine the root cause of the problem, you need to be able to monitor, inspect, and debug the production application, collecting detailed data at runtime.

Today we’re making it even easier to debug your applications on Heroku, with the general availability of Language Runtime Metrics, starting with JVM languages, and Heroku Exec. Language metrics surfaces key indicators of an issue, like garbage collection activity, and heap and non-heap memory usage, on a unified timeline in the Heroku Dashboard.

After you’ve identified an issue, you can use Exec to connect to a dyno at runtime, via SSH, for further inspection and remote debugging. When combined with Application Metrics, Language Runtime Metrics and Exec provide a robust set of tools for maintaining production application health.

Runtime Inspection with


Continue reading “Heroku Exec and Language Runtime Metrics GA: Runtime Debugging on Heroku”

Why Vim?

Hashrocket is known as a Vim shop; what does that mean?

When visitors learn Hashrocket is a "100% Vim shop", questions follow:

  1. Does everyone use Vim?
  2. Is Vim mandatory at Hashrocket?
  3. Why Vim?

These are fair, and I admit that from the outside, our company's
preference for Vim might seem unusual.

When we evangelize Vim to the development
world, via the Vim Chicago Meetup and
others, the questions become more acute. In a recent
I tried to sell Vim to
React.js developers. I feel obligated to have compelling, succinct
answers on hand.

I'll tackle this subject in three parts: why Hashrocket uses Vim, what
Vim is, and why we think every developer should try Vim. Few subjects
are as contentious in the development world as text editors. Whatever you use,
learn and make it your own. I hope to simply add Vim to the list of things

Continue reading “Why Vim?”

Announcing the Dublin, Ireland Region for Heroku Private Spaces

We are excited to announce the Dublin region for Heroku Private Spaces is now generally available for Heroku Enterprise customers. Dublin joins the growing list of regions that Private Spaces supports: Sydney, Virginia, Oregon, Frankfurt, and Tokyo. With the Private Spaces Dublin region, organizations can build and deploy Heroku-style apps closer to their UK customers, reducing network latency and providing a better user experience.

Heroku Private Spaces, available as part of Heroku Enterprise, is a network isolated group of apps and data services with a dedicated runtime environment, provisioned by Heroku in a geographic region you specify. With Spaces you can build modern apps with the powerful Heroku developer experience and get enterprise-grade secure network topologies. This enables your Heroku applications to securely connect to on-premise systems on your corporate network and other cloud services, including Salesforce.


To create a Private Space in Dublin, select the Spaces tab

Continue reading “Announcing the Dublin, Ireland Region for Heroku Private Spaces”

Swap Two Column Values in SQL: Part 2

In the first part of this post we looked at a technique for swapping two
column values for existing records in a single statement. It is a relatively
sound solution that takes advantage of subqueries and a case statement.
Unfortunately, it has a couple drawbacks which we will address in this post.

This post builds off of Part 1. If you haven't already, give it a

The first drawback can be demonstrated by building on our existing example,
the pages table which has the following data.

select * from pages order by ordering;
 id |  name  | ordering
  3 | Green  |        1
  1 | Red    |        2
  4 | Yellow |        3
  2 | Blue   |        4

In the interest of maintaining data integrity, it is reasonable to expect
that a table like this would have a uniqueness constraint on ordering.
Let's add that to ensure

Continue reading “Swap Two Column Values in SQL: Part 2”

Hashrocket and Code Platoon

Hashrocket's collaboration with Code Platoon continues this October!

For the past three cohorts, Hashrocket has taught an intensive all-day workshop at the Code Platoon bootcamp. Here's a
description of this unique developer training program, from their website:

Code Platoon is a Chicago-based non-profit program exclusively for veterans.
We’ll teach you full-stack development over the course of 20-weeks (6 weeks
remotely, 14 weeks in our Chicago classroom), and train you to be eligible
for paid internships and full-time employment as a web developer. No previous
programming experience is necessary.

In this post, I'd like to talk about this important program, and what we offer to it.

About Code Platoon

The world needs more
programmers; there's a mountain of work to be done. Code bootcamps rise
to this challenge by recognizing that a college degree isn't enough, or perhaps
even required, to do what we do, and that the fundamentals can be

Continue reading “Hashrocket and Code Platoon”

Swap Two Column Values in SQL: Part 1

I recently needed to write a PostgreSQL snippet that would massage some
data. More specifically, I needed to swap the ordering of two different
records in the pages table. These records are made up of an id, a
name, and an ordering.

Here is a snapshot of the data in pages.

select * from pages order by ordering;
 id |  name  | ordering
  3 | Green  |        1
  1 | Red    |        2
  4 | Yellow |        3
  2 | Blue   |        4

We've been informed that we need to swap the ordering of Red and Blue.
We can see here in this snapshot of the data that Red has an ordering of
2 and Blue has an ordering of 4.

Doing a swap based on the data that we have locally would be most easily
accomplished with a couple update statements.

update pages set ordering 
Continue reading "Swap Two Column Values in SQL: Part 1"