Heroku Architecture Credential By Example

In preparing for the Heroku Architecture Credential, I found myself needing a concrete example to solidify my learnings; thought to share the making of this example through a series of videos.

Image for post
Image for post

Addendum 11/6/19: So, it took me two tries to pass the exam and thought to share some observations. The materials that I created here are more focused on the delivery of a single Heroku application, where-as the exam is focused more focused on architecting the Heroku infrastructure to support a complex mix of applications across multiple locations / technologies. The trick for my passing was to put a lot more time in understanding the Heroku Enterprise material; especially Private Spaces. Also, make sure you have a theoretical understanding of Apache Kafka and it usage.

Addendum 11/12/19: I have sprinkled some representative questions and direction on answers below; look for the large Q characters.

Part 1: Local “Hello World” Application

Setting up a local “Hello World” web application.

Agenda:

Addendum:

Part 2: Getting Started

Setting up a Heroku “Hello World” web application.

Agenda:

The final solution for this part is available in the started branch of the larkintuckerllc/hello-cert repository.

Answer: Running Apps Locally

Part 3: Core Concepts

Dissecting the “Hello World” application to introduce Heroku core concepts.

Agenda:

  • Regions
  • Buildpacks
  • Slugs
  • Releases
  • Stacks
  • Dynos
  • Dyno Managers

Answer: Using Multiple Buildpacks for an App

Part 4: More Core Concepts

Pretty much what the title is, more Heroku core concepts.

The final solution for this part is available in the more-core branch of the larkintuckerllc/hello-cert repository.

Agenda:

  • Environment
  • Logging
  • Resources
  • Releases Revisited
  • Metrics
  • Alerting

Addendum:

  • In the video, I mentioned that the Heroku router generated the 304 (Not Modified) response code. It turns out that it was Express itself determining that the API result was unmodified (using an Etag header) and returning this response code

Answer: Development and Configuration Principles: Configuration

Part 5: Networking

Exploring a number of networking related topics.

The final solution for this part is available in the networking branch of the larkintuckerllc/hello-cert repository.

Agenda:

  • Cache Control
  • Compression
  • X-Request-ID
  • Custom DNS
  • Heroku Router

Answer: Session Affinity

Part 6: Pipelines

Exploring a basic workflow using pipelines.

Agenda:

  • Pipelines
  • Basic Workflow
  • GitHub Integration

Answer: Pipelines: Design Considerations

Part 7: Review Apps and Continuous Integration

Using Heroku Review Apps and Heroku Continuous Integration to power a GIT Feature Branch workflow.

The final solution for this part is available in the review-apps branch of the larkintuckerllc/hello-cert repository.

Agenda:

  • Review Apps
  • GitHub Branch Protection: Reviews
  • Heroku Continuous Integration
  • GitHub Branch Protection: Require Status Checks

Addendum:

  • In the video, I referred to a GIT workflow; should have referred to it more specifically as a GIT Feature Branch workflow

Answer: Review Apps (New): Configuration

Part 8: Heroku Postgres Basics

We add a database query to our application; both local and Heroku.

The final solution for this part is available in the postgres-basics branch of the larkintuckerllc/hello-cert repository.

Agenda:

  • Prerequisites:
    Docker
    PostgreSQL client
  • Local PostgreSQL
  • Manual Database Migration and Seeding (Local)
  • DATABASE_URL
  • Hello Database (Local)
  • Heroku Postgres
  • Manual Database Migration and Seeding (Staging)
  • Hello Database (Staging)

Answer: Sharing Query Results with Dataclips

Answer: Heroku Postgres Follower Databases

Part 9: Release Phase

We improve on the database example, to support migrations, and learn about the Heroku Release Phase along the way.

The final solution for this part is available in the release-phase branch of the larkintuckerllc/hello-cert repository.

Agenda:

  • Motivation
  • Object Relational Mapping
  • TypeORM
  • Local Development
  • Staging Deployment (Release Phase)
  • Production Deployment (Release Phase)

Answer: Release Phase

Part 10: Postdeploy in Review Apps

Using database seeding as a use-case, we explore the postdeploy feature in Review Apps.

The final solution for this part is available in the postdeploy branch of the larkintuckerllc/hello-cert repository.

Addendum: In preparing for the next video, realized that I missed handling the situation where finding todos could fail. Fixed it in this branch after the fact.

Agenda:

  • Sidebar: Rotating Credentials
  • Seeding the Database
  • Postdeploy
  • One-Off Dynos

Answer: One-Off Dynos

Part 11: Heroku Redis Basics

We add an in-memory cache (write and read) to our application; both local and Heroku.

The final solution for this part is available in the redis branch of the larkintuckerllc/hello-cert repository.

Agenda:

  • What and Why In-Memory Cache
  • Redis
  • Local Redis
  • Heroku Redis
  • Simple Example

Answer: Heroku Redis

Part 12: Heroku Kafka Basics

We add a distributed streaming solution to our application; both local and Heroku.

The final solution for this part is available in the kafka branch of the larkintuckerllc/hello-cert repository.

Agenda:

  • What is Kafka?
  • Local Kafka
  • Heroku Kafka
  • Simple Example, also Worker Dyno

Answer: Apache Kafka on Heroku

Part 13: Salesforce Integration: REST APIs

We use Salesforce REST APIs to regularly synchronize Salesforce contacts to our Heroku application.

The final solution for this part is available in the sfdc-rest branch of the larkintuckerllc/hello-cert repository.

Agenda:

  • Rest APIs Limits
  • OAuth2 Theory
  • Connected Apps
  • Local HTTPS
  • Misc. Code Changes
  • OAuth2 Implementation
  • Using REST API to Synchronize Data
  • Running Code in Heroku
  • Heroku Scheduler

Due to technical difficulties, the there are two videos for this part.

Answer: Integrating Heroku and the Salesforce Platform: Calling the Salesforce REST API

Part 14: Salesforce Integration: Heroku Connect

We use Heroku Connect to regularly synchronize Salesforce contacts to our Heroku application.

The final solution for this part is available in the heroku-connect branch of the larkintuckerllc/hello-cert repository.

Answer: Heroku Connect and Heroku External Objects and Salesforce Connect

Part 15: Salesforce Integration: Heroku Connect (Writing)

We use Heroku Connect to bidirectionally update Salesforce contacts and our Heroku application.

The final solution for this part is available in the heroku-connect-writing branch of the larkintuckerllc/hello-cert repository.

Agenda:

  • Theory of External Ids
  • External Ids in Practice
  • Trigger Log
  • External Ids and Relationships
  • Accelerated Polling
  • Flip Flop Issue

Answer: Writing Data to Salesforce with Heroku Connect: Techniques to Mitigate Sync Issues

Part 16: The Twelve-Factor App

We draw examples from our example to explore the factors in a Twelve-Factor App.

Agenda:

  • Codebase
  • Dependencies
  • Config
  • Backing services
  • Build, release, run
  • Processes
  • Port binding
  • Concurrency
  • Disposability
  • Dev/prod parity
  • Logs
  • Admin processes

Answer: Twelve-Factor App: Admin Processes

Part 17: Security and Compliance

The materials on security and compliance does not translate well into our concrete example; never-the-less information is important to understand:

Part 18: Collaboration and Enterprise

The materials on collaboration and enterprise does not translate well into our concrete example; never-the-less information is important to understand:

Wrap Up

Ok, believe I touched upon all the key concepts required for the Heroku Architecture Credential.

Written by

Broad infrastructure, development, and soft-skill background

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store