Book Image

Heroku Cloud Application Development

By : Anubhav Hanjura
Book Image

Heroku Cloud Application Development

By: Anubhav Hanjura

Overview of this book

Table of Contents (17 chapters)
Heroku Cloud Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Cloud application development is "the new black". With the advent of server virtualization, hardware resources have become cheaper. You can buy hardware on demand and pay only for the time you use it. The next wave of virtualization is that of software virtualization, that is, having the ability to use available software on demand and build your own apps on top of it. Here too, you pay only for what you use and how long you use it. The Heroku Platform as a Service (PaaS) is a software platform that provides a combination of the underlying operation system resources, language runtime, and supporting software to help you build your own web apps on demand.

This book on Heroku cloud application development is intended to introduce you to the fundamentals of the Heroku Platform as a Service, and help you to understand the rich feature set of the Heroku platform that enables building powerful and scalable web apps. In addition, this book also showcases techniques to deploy and troubleshoot the web apps deployed on Heroku and helps you understand the nuances of the choices you have to make while building apps for the Heroku environment. And that isn't all. You will also be presented with the best practices of using Heroku for developing web apps as well as getting a feel for the advanced aspects of the platform. The book also educates the user on how to securely use the Heroku platform for developing production-ready and high-performance web apps.

In essence, Heroku cloud application development is all about rapid application development for the cloud, (re)using available software add-ons and underlying platform infrastructure to build, deploy, and manage really powerful and scalable web apps.

What this book covers

Chapter 1, Hello Heroku, introduces you to the world of Heroku. It also provides a historical background on how Heroku evolved to what it is today followed by a basic understanding of Heroku's architecture. Finally, it takes you on a test drive to get a firsthand experience with the Heroku cloud platform.

Chapter 2, Inside Heroku, covers the foundational aspects of the Heroku platform. It covers the details of various components of the Heroku architecture, including the Heroku platform stack, the request routing system, the Logplex logging framework, the add-ons, the dyno (process), and the platform API.

Chapter 3, Building Heroku Applications, covers the principles governing building web apps on the Heroku platform. It also illustrates the process of building and configuring web apps besides covering the steps involved in preparing a production-ready app from your code using language-specific buildpacks.

Chapter 4, Deploying Heroku Applications, describes the application deployment process on the Heroku platform. It covers the basics of the Git distributed version control system and illustrates the most common source management operations. It also covers the concept of forking and cloning apps besides ways to optimize your app deployment. It also showcases various aspects of Heroku app release management process through illustrative examples.

Chapter 5, Running Heroku Applications, illustrates the process of running a Heroku cloud app in detail. It covers the Heroku command-line interface (CLI) used to perform Heroku operations such as creating or updating apps. It also explains how to use the Foreman tool to troubleshoot the apps locally before deploying them to the Heroku cloud. Additionally, it describes the key features of the Heroku dashboard related to running Heroku apps.

Chapter 6, Putting It All Together, sums up the learning about the foundations of the Heroku platform and illustrates the whole process of building, deploying, and managing Heroku apps using Java on the Eclipse app development platform.

Chapter 7, Heroku Best Practices, covers the details of best practices that developers can use not only to deploy but also to write apps on the cloud using the Cloud 9 cloud-based integrated development environment. This chapter also provides detailed coverage of best practices such as setting up the Heroku PostgreSQL database, configuring DNS for your web app, and optimizing applications to use higher end services provided by the Heroku platform.

Chapter 8, Heroku Security, covers two parts of the Heroku security puzzle—the developer communication with the Heroku platform and securing the Heroku platform from malicious attacks from the external world.

Chapter 9, Troubleshooting Heroku Applications, describes the techniques developers can employ to fix problems encountered while developing apps for the Heroku platform. It covers how to troubleshoot application downtimes, isolates HTTP request issues, debugs database problems, and runs production checks to warn you about potential issues. It also shows how you can use the maintenance windows to gracefully handle app upgrades.

Chapter 10, Advanced Heroku Usage, introduces the advanced features of Heroku. It covers the Heroku Labs feature, including Websockets, illustrates the Heroku Platform API through practical examples, and shows how developers can do social coding using the collaborative features of the Heroku dashboard.

What you need for this book

The software needed for this book includes the Heroku toolbelt (client) (https://toolbelt.heroku.com), Eclipse IDE for EE, the Mozilla Firefox web browser, and the curl tool.

Who this book is for

This book is for application developers who are looking to learn cloud application development using the Heroku platform. Knowledge of Ruby and Java is desirable. Previous knowledge of the Ubuntu OS is helpful though not mandatory.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Use the ps:scale command to scale up the web processes."

A block of code is set as follows:

#!/bin/sh

cat << EOF
---
addons:
  - heroku-postgresql:dev
default_process_types:
  web: bin/node server.js
EOF

Any command-line input or output is written as follows:

$ heroku create myapp --buildpack https://github.com/heroku/heroku-buildpack-mylang

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "You can also restart a web application using the Restart button on the Processes tab of your web app."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.