Book Image

Heroku Cookbook

By : Mike Coutermarsh
Book Image

Heroku Cookbook

By: Mike Coutermarsh

Overview of this book

Heroku is a Platform as a Service that enables developers to rapidly deploy and scale their web applications. Heroku is designed for developer happiness, freeing developers from doing system administrative tasks such as configuring servers and setting up load balancers. Developers are able to focus on what they do best, building web applications, while leaving the details of deployment and scaling to the experts at Heroku. This practical guide is packed with step-by-step solutions to problems faced by every production-level web application hosted on Heroku. You'll quickly get comfortable with managing your Heroku applications from the command line and then learn everything you need to know to deploy and administer production-level web applications.
Table of Contents (17 chapters)
Heroku Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding memcached to a Rails application


Memcached is a high-performance, distributed, key-value store that allows us to quickly store and retrieve data from memory. It helps us scale our web applications by storing the result of any expensive operations in memory. A common use case is storing the result of a database query in memcached. Then, the query only has to be made once; the subsequent requests for that data are loaded from memcached. This reduces the load on our database and makes our application significantly faster. We can use memcached to cache database calls, API requests, and even the rendered views. In this recipe, you'll learn how to get a Rails application up and running with memcached on Heroku.

Note

If we are new to implementing caching, memcached should be our first choice. It's rock solid and easy to use. There are many other caching options available, but memcached is the standard.

Getting ready…

We'll run memcached on our local development machine to test it.

On OS X, we...