O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Heroku: Up and Running

Book Description

Take full advantage of Heroku’s cloud-based hosting services. This guide takes you through the inner workings of this PaaS platform and delivers practical advice for architecting your application to work as efficiently as possible. You’ll learn best practices for improving speed and throughput, solving latency issues, locating and fixing problems if your application goes down, and ensuring your deployments go smoothly.

By covering everything from basic concepts and primary components to add-on services and advanced topics such as buildpacks, this book helps you effectively deploy and manage your application with Heroku.

  • Learn your way around Heroku with the command line interface
  • Discover several methods for scaling your application to increase throughput
  • Speed up response time through performance optimizations
  • Solve latency issues by deploying your Heroku instance in new regions
  • Choose the right plan for using Heroku’s PostgreSQL database-as-a-service
  • Get a checklist of items to consider when deploying your application
  • Find and fix problems during deployment, at runtime, and when your application goes down
  • Understand how Heroku buildpacks work, and learn how customize your own

Table of Contents

  1. Preface
    1. So, What Is Heroku?
    2. Who This Book Is For
    3. The History of Heroku
    4. The Heroku Culture
    5. Why Would I Want to Learn More About Heroku?
    6. Conventions Used in This Book
    7. Safari® Books Online
    8. How to Contact Us
    9. From the Authors: Neil Middleton
    10. From the Authors: Richard Schneeman
    11. Disclaimer
  2. 1. Getting Started with Heroku
    1. The Dawn of Virtual Servers
    2. Enter the Cloud
    3. You New Around Here?
    4. Quick Start
  3. 2. How Heroku Works
    1. What Is a Dyno?
    2. HTTP Routing
      1. Request Life Cycle
      2. Long-Running Requests
    3. The Dyno Manager and Dynos
      1. Configuration
      2. Releases
      3. Slug Compilation
      4. Scale Out, Not Up
      5. Erosion Resistance
      6. Workers and Background Processing
    4. Other Services
      1. The Logplex
      2. Databases and Other Add-Ons
      3. Deployment Systems
  4. 3. Understanding Performance and Scale
    1. Horizontal Scaling and You
      1. Stateless Architecture
        1. Distributed file stores
        2. Session state
      2. Dyno Manifold
      3. Autoscaling
      4. Estimating Resource Requirements
      5. Request Queuing
    2. Speeding Up Your App
      1. Expires Headers
      2. Faster Page Response with a CDN
      3. Postgres Database Performance
        1. N+1 queries
        2. Queries in need of an index
    3. Explaining Postgres Performance
    4. Caching Expensive Queries
    5. Back that Task Up
    6. Full-Text Search Apps
    7. Performance Testing
      1. In-App Performance Analysis
      2. External Performance Tools: Backend
      3. External Performance Tools: Frontend
      4. Being Fast
  5. 4. Heroku Regions
    1. Multiregion or Single?
    2. The Heroku Way
      1. How to Deploy in a New Region
      2. Forking an Application
    3. Constraints
      1. Latency
        1. Read/write architecture
      2. Add-Ons
  6. 5. Heroku PostgreSQL
    1. Why PostgreSQL?
      1. Transactional DDL
      2. Concurrent Indexes
      3. Extensibility
      4. Partial Indexing
      5. What Heroku Gives You
      6. Development versus Production
    2. Choosing the Right Plan
      1. Shared Features
      2. Starter Features
      3. Production Features
    3. Getting Started
    4. Importing and Exporting Data
      1. Importing Data
        1. Using pg_restore locally
      2. Exporting Data
      3. Snapshots
      4. CSV Exports
    5. PGBackups
    6. Data Clips
    7. Followers
      1. Fast Database Changeovers
    8. Forking
    9. Other Features
      1. Extension Support
      2. Improved Visibility
      3. JSON Support
      4. Range Type Support
  7. 6. Deployment
    1. Timeliness
    2. Backing Out
    3. Testing
    4. How to Deploy, and Deploy Well
      1. Backups
      2. Heroku Releases
        1. Release creation
        2. Rolling back
      3. Performance Testing
      4. Trimming the Fat (Slug Management)
      5. Source Code Management
        1. Branching for environments
        2. Feature branching
      6. Multienvironment Deployment
        1. Consistency
    5. Teams
    6. DNS
      1. Configuration
        1. Apex domains
  8. 7. When It Goes Wrong
    1. Dev Center
    2. Heroku Support
    3. Deploy Debugging
      1. Heroku Status Site
      2. Reproducing the Problem
      3. Check for a .slugignore File
      4. Fork and Use a Custom Buildpack
      5. Deploy Taking Too Long?
    4. Runtime Error Detection and Debugging
      1. Deploy Visibility
      2. Test Visibility
      3. Performance Visibility
      4. Exception Visibility
      5. Logging Add-Ons
        1. Admin error pages
      6. Exception Notification
      7. Uptime Visibility
      8. Twitter-Driven Development
      9. Code Reviews and a Branching Workflow
    5. Runtime Error Debugging
      1. Data State Debugging
      2. Asset Debugging
      3. Application State Debugging
  9. 8. Buildpacks
    1. Before Buildpacks
    2. Introducing the Buildpack
      1. Detect
      2. Compile
    3. Release
    4. Profile.d Scripts
    5. Leveraging Multiple Buildpacks
    6. Quick and Dirty Binaries in Your App
    7. The Buildpack Recap
  10. About the Authors
  11. Colophon
  12. Copyright