What is the Scaling Rails Series?
Get the Flash Player to see this player.
Learn everything you need to know about Scaling your Rails app through 13 informative Screencasts produced by Gregg Pollack with the support of New Relic.
Don't forget to subscribe to the RSS or iTunes feed over on the right.
Welcome to the Scaling Rails Screencast Series produced by Gregg Pollack and supported by New Relic.
In the next few weeks we’re going to bring you 13 educational videos, teaching you just about everything you need to know to create a Rails application that can scale
Play Video (10.4 MB, 2:13, MP4)
Before we can talk about Server-side performance, we need to go over Client-side performance. We’re talking about how fast your website comes up in a user’s browser.
Play Video (49.8 MB, 12:11, MP4)
View Code and Additional Resources
Ruby on Rails comes with several caching mechanisms out of the box, starting with Page Caching. In this episode we show how to implement Page Caching in a simple blog application.
Play Video (32.2 MB, 6:45, MP4)
View Code and Additional Resources
When you start caching html content which depends on data in your database, what happens when that data changes? You’re going to need to expire that cache, and in this episode, we show you how Rails makes this quite easy.
Play Video (20.9 MB, 5:51, MP4)
View Code and Additional Resources
Before you attempt to Scale your Rails application, you need to know where and how to scale it. This is where New Relic’s RPM service comes in. In this screencast we’ll show you how easy it is to setup, and how useful it can be to monitor your Rails app.
Play Video (65.1 MB, 13:05, MP4)
Page caching is pretty simple to do, but what happens when you need pagination or dynamic data on your pages? Can you still use page caching? In this screencast we’ll start out showing how to solve these problems and finish up with my first rant of the series "Login status is overrated."
Play Video (40.5 MB, 7:20, MP4)
View Code and Additional Resources
If you can’t fully page cache your Rails action, when your next best choice is using Action Caching. Action Caching allows you to run filters such as authorization on each request before they’re able to see the cached content of the page.
Play Video (32.8 MB, 8:05, MP4)
View Code and Additional Resources
If there’s no way to cache the entire content of a page, then odds are you can probably cache smaller pieces of it. This is where fragment caching comes in, allowing you to cache common parts of a webpage which are resource intensive and may be used accross mulitple pages.
Play Video (34.2 MB, 7:21, MP4)
View Code and Additional Resources
Most of the big Web 2.0 websites rely on memcached (pronounced "Memcache-Dee") to scale, even the ones not using Rails. In this screencast you’ll learn how easy it is to use memcached in your Rails application, and how to do low level query caching for websites where you have highly customized layouts.
Play Video (52 MB, 13:54, MP4)
View Code and Additional Resources
Taylor Weibley is the director of support at Engine Yard, where he’s seen plenty of poorly scaling Rails applications. In this first interview he lets us know about three things we can do today to help our application performance. After his interview I go through some common ways to Scale your Database layer.
Play Video (33.8 MB, 6:13, MP4)
View Code and Additional Resources
Once you’ve done all the server side caching you can possibly do, you might want to take a look back at the client side of things to do some advanced client-side caching. In this episode we’ll show how to effectively use the max-age, etag, and last_modified helpers to scale your application.
Play Video (22 MB, 7:48, MP4)
View Code and Additional Resources
Once you have a firm grasp of the 3 header tags we talked about in the previous episode (max-age, etags, and last_modified) you can start to take advantage of reverse proxy caches. In this episode we let you know exactly what a proxy cache is, and how you might use it to effectively scale a dynamic website to millions of users.
Play Video (44 MB, 14:20, MP4)
View Code and Additional Resources
Jesse Newland works at Rails Machine, where he’s helped scale many Rails applications. In this episode we ask him for 3 tips to help us Scale our applications. We’re then going to take a closer look at one of his recommendations: how to properly deploy a Rails app.
Play Video (28.7 MB, 5:11, MP4)
View Code and Additional Resources
Jim Gochee is the VP of Engineering at New Relic, where he’s helped shape RPM, their server monitoring tool. After asking him his recommendations for Scaling Rails, we take a closer look at some of the advanced features of New Relic’s RPM tool. If you haven’t seen some of the upper tier performance monitoring features of RPM, prepared to be impressed.
Play Video (63.5 MB, 12:50, MP4)
View Code and Additional Resources
Rails 2.3 shipped with Rack support and contains a set of middleware libraries which can be used to customize and optimize your Rails application. In this screencast we go over the basics of Rack & Rack Middleware, walk through the Rails Rack stack, and show how to optimize certain actions in your Rails application using Metal.
Play Video (47 MB, 18:55, MP4)
View Code and Additional Resources
One way to measure the scalability of your Rails application is to use Load Testing. This is the first of two screencasts where we attempt to give an introduction to load testing and show how to use two of the most basic Load Testing tools, Apache Bench and httperf.
Play Video (52 MB, 15:09, MP4)
View Code and Additional Resources
This is the second of two episodes where we learn the basics of Load Testing our web applications. In this episode we take a look at autobench, a tool that automates our httperf load tests, then we’ll figure out how to visualize our httperf results in a graph, and finally take a brief look at a few other Load Testing tools you might want to get familiar with.
Play Video (34 MB, 11:15, MP4)
View Code and Additional Resources
If the bottleneck of your application is your database even after caching as much as possible, what can you do? This is the first of two screencasts where we’re going to learn about techniques for increasing the power of your Database. In this first video we learn how to grow our database step by step using both vertical and horizontal scaling.
Play Video (26.3 MB, 11:20, MP4)
In this second screencast we start out by learning the differences between the myISAM and InnoDB database engines for MySQL. Next we learn how to scale a write heavy database by using Master Master replication, and how we might configure this to work with our Rails application. Lastly we’ll figure out how to shard our database by spliting our tables between multiple databases and show how both New Relic and eBay take advantage of this technique.
Play Video (31 MB, 14:20, MP4)
This is the first of three screencasts where we begin to look at a few new Rails libraries to help you scale your Rails applications. In this first episode we take a look at Bullet, which will help you optimize your SQL queries by giving you growl notifications when you’re not using eager loading properly or should be using a counter cache. Then there’s Rails Indexes which provides Rake tasks to find missing indexes in your database. Finally the last library we’ll learn about is Scrooge, a SQL query optimizer which can reduce the amount of data getting sent from your database to your Rails application.
All of these libraries I learned about from the Ruby5 Podcast, a twice weekly audio podcast covering the latest news in the Ruby and Rails Community.
Play Video (41.4 MB, 8:49, MP4)
In this screencast we discover what typically causes Ruby server memory bloat, namely instantiating too many ActiveRecord objects. Thankfully there are several plugins which can help you detect when your application needs some help, and where your application is hurting the most. We start by taking a look at Rack-Bug, a toolbar which places all sorts of statistics about each requests at your fingertips. Next, we look at two libraries to help specifically track memory bloat; Memory Logic and Oink.
Play Video (49.5 MB, 10:21, MP4)
This is the last of three screencasts where looking at a couple new libraries to help you scale your Rails applications. In this episode we start by learning about rubber, a capistrano/rails plugin that makes it easy to deploy/manage/scale on Amazon EC2. Then we look at a background job system with a killer user interface called Cloud Crowd. Lastly we look at a web service called Mad Mimi, which allows you to keep track of mailing lists and even move all of your mailer erb templates out of your web application. Utilizing Mad Mimi’s API can give your customer more control of their mailing lists, and alleviate some developer frustration surrounding email.
To keep up to date with additional libraries which may help with Scaling, be sure to listen to the Ruby5 Podcast.
Play Video (81.7 MB, 17:07, MP4)
Tell us what you think. We’d love to have your feedback.