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

Publisher resources

View/Submit Errata

Table of contents

  1. Heroku: Up and Running
  2. 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
  3. 1. Getting Started with Heroku
    1. The Dawn of Virtual Servers
    2. Enter the Cloud
    3. You New Around Here?
    4. Quick Start
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. About the Authors
  12. Colophon
  13. Copyright

Product information

  • Title: Heroku: Up and Running
  • Author(s): Neil Middleton, Richard Schneeman
  • Release date: November 2013
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781449341350