<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>New Relic blog &#187; Ruby</title>
	<atom:link href="http://blog.newrelic.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.newrelic.com</link>
	<description>Application Performance Management</description>
	<lastBuildDate>Fri, 17 May 2013 21:22:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>RailsConf 2013 Review</title>
		<link>http://blog.newrelic.com/2013/05/10/railsconf-2013-review/</link>
		<comments>http://blog.newrelic.com/2013/05/10/railsconf-2013-review/#comments</comments>
		<pubDate>Fri, 10 May 2013 23:22:58 +0000</pubDate>
		<dc:creator>Darin Swanson</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Top Post]]></category>

		<guid isPermaLink="false">http://blog.newrelic.com/?p=12853</guid>
		<description><![CDATA[<p>Can you believe it&#8217;s already been a whole week since RailsConf 2013 ended?! Another RailsConf has come and gone and everyone has gone back to their hometowns and offices. New Relic was lucky enough to have RailsConf in Portland, Oregon this year, which is our intergalactic engineering headquarters. We worked hard to make everyone who [...]</p><p>The post <a href="http://blog.newrelic.com/2013/05/10/railsconf-2013-review/">RailsConf 2013 Review</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Can you believe it&#8217;s already been a whole week since RailsConf 2013 ended?!</p>
<p>Another RailsConf has come and gone and everyone has gone back to their hometowns and offices. New Relic was lucky enough to have RailsConf in Portland, Oregon this year, which is our intergalactic engineering headquarters. We worked hard to make everyone who came to the conference feel welcome and get those extra opportunities to learn and interact with the Rails community.</p>
<p style="text-align: center;"><a title="New Relic Intergalactic Engineering HQ" href="http://blog.newrelic.com/wp-content/uploads/intergalactic-550px.png" target="_blank"><img class=" wp-image-12872 aligncenter" title="New Relic Intergalactic Engineering HQ" alt="New Relic Intergalactic Engineering HQ" src="http://blog.newrelic.com/wp-content/uploads/intergalactic-550px.png" width="440" height="153" /></a></p>
<p><span style="font-size: 1.25em;"><strong>All the Content!</strong></span><br />
Once again there was an abundance of great content at the conference, from entertaining keynotes to domain-challenging technical deep dives. We helped contribute with three separate presentations:</p>
<p style="padding-left: 30px;">* Sam Goldstein and Ben Weintraub presented on the New Relic Performance Code Kata. Their slides can be found <a title="The New Relic Performance Code Kata slides" href="http://bit.ly/newrelic-railsconf-kata" target="_blank">here</a>. The goal of this Kata is to get your mind wired into performance-driven development. We&#8217;ll explore, diagnose and fix a variety of performance problems to reinforce your skills as a user of New Relic.</p>
<p style="padding-left: 30px;">* Chris Kelly spoke on how many of the same principles that guide our software design can guide our software architecture. To review or learn more, see <a title="Chris Kelly's slides on software architecture principles" href="https://speakerdeck.com/amateurhuman/object-oriented-lessons-for-a-service-oriented-world" target="_blank">the slides</a>.</p>
<p style="padding-left: 30px;">* Andrew Bloomgarden and Julian Giuca gave a tour of our experience upgrading to Rails 3 (like changing the wheels of a bus going at 80 mph!). Slides are <a title="New Relic's slides - the experience of upgrading to Rails 3" href="http://www.slideshare.net/juliangiuca/upgrading-to-rails-3-20938621" target="_blank">here</a>.</p>
<p>We believe that videos of the presentations will be posted at ConFreaks, so keep an eye on <a title="Confreaks videos of RailsConf 2013 presentations" href="http://www.confreaks.com/events/railsconf2013" target="_blank">this site</a>.<a href="http://www.confreaks.com/events/railsconf2013"><br />
</a></p>
<p>With our new space in Portland, we were able to host the conference with live streaming for those who missed out on tickets for the sold-out show. Over four days, people gathered at New Relic to watch the videocast and learn and laugh together, depending on the speaker and content.</p>
<p><span style="font-size: 1.25em;"><strong>All the Parties!</strong></span><br />
No conference is complete without some great parties. And New Relic helped create some memorable events for RailsConf 2013!</p>
<p>The first event was on Sunday night to help the speakers of the conference prepare for the week. The second event, &#8216;A Night in the Ruby Sky,&#8217; was open to all attendees &#8212; and the food and conversation carried on for hours.</p>
<p style="text-align: center;"><a href="http://blog.newrelic.com/wp-content/uploads/railsconf2013.jpg"><img class="aligncenter  wp-image-12888" title="A Night in the Ruby Sky - RailsConf 2013" alt="A Night in the Ruby Sky - RailsConf 2013" src="http://blog.newrelic.com/wp-content/uploads/railsconf2013.jpg" width="564" height="318" /></a></p>
<p style="text-align: left;"><strong>Trivia Contest</strong></p>
<p style="text-align: left;">We had a fun trivia contest at the after party. Here&#8217;s the trivia information and results! <span style="font-size: 13px;">(Congrats to our winner, </span><a style="font-size: 13px;" title="Paul Simpsons' blog" href="http://prsimp.com/" target="_blank">Paul Simpson</a> from Harvest, who snagged an iPod mini.)</p>
<p style="padding-left: 30px;"><em> Q. In 2005, what did David Heinemeier Hansson create in 15 minutes, which helped kick start the popularity of Rails?</em><br />
A. A blog</p>
<p style="padding-left: 30px;"><em>Q: What major feature was recently pulled from Rails 4.0?</em><br />
A: The <a title="Read about Queue API on the Engine Yard blog" href=" https://blog.engineyard.com/2013/rails-4-queue-api" target="_blank">Queue API</a></p>
<p style="padding-left: 30px;"><em>Q. What version of Rails first included support for Rack?</em><br />
A. Version 2.2 (We also accepted Version 2.3)</p>
<p style="padding-left: 30px;"><em>Q. What Ruby web framework joined forces with Rails 2 to create Rails 3?</em><br />
A. Merb</p>
<p style="padding-left: 30px;"><em>Q. How many Ruby core classes were monkey-patched by Rails&#8217; first public commit?</em><br />
A. One: cattr_{reader,writer,accessor} are added to Class</p>
<p><span style="font-size: 1.25em;"><strong>All the New and Exciting!</strong></span><br />
Besides the parties, we also celebrated by publishing six blog posts that highlighted what’s new and exciting in the world of New Relic’s Ruby support. If you have not yet read the series, here&#8217;s the complete list:</p>
<p style="padding-left: 30px;">* <a title="Cross App Tracing: Time to Break Up that Huge Rails Application?" href="http://blog.newrelic.com/2013/04/22/cross-app-tracing-time-to-break-up-that-huge-rails-application/" target="_blank">Cross Application Tracing</a><br />
* <a title="Thread Profiling: See Exactly What Your App Is Doing" href="http://blog.newrelic.com/2013/04/23/thread-profiling-see-exactly-what-your-app-is-doing/" target="_blank">Thread Profiling</a><br />
* <a title="Living on the Edge with Rails 4 &amp; Ruby 2" href="http://blog.newrelic.com/2013/04/24/living-on-the-edge-with-rails-4-ruby-2/" target="_blank">Living on the Edge with Rails 4 &amp; Ruby 2</a><br />
* <a title="Thread Safe APIs and Sidekiq Support for Your Threading" href="http://blog.newrelic.com/2013/04/25/thread-safe-apis-and-sidekiq-support-for-your-threading/">Thread Safe APIs &amp; Sidekiq Support for Your Threading</a><br />
* <a title="Security Banners (For If You Forgot to Apply the Latest CVE Patch)" href="http://blog.newrelic.com/2013/04/26/security-banners-for-if-you-forgot-to-apply-the-latest-cve-patch/" target="_blank">Security Banners (For If You Forgot to Apply the Latest CVE Patch)</a><br />
* <a href="http://blog.newrelic.com/2013/04/29/debugging-stuck-ruby-processes-what-to-do-before-you-kill-9/">Debugging Stuck Ruby Processes &#8211; What to do before you kill-9</a></p>
<p>Since RailsConf, we&#8217;ve released <a title="New Relic support for Sequel" href="https://newrelic.com/docs/releases/ruby" target="_blank">support for Sequel</a>. The support includes capturing SQL calls and model operations in transaction traces, and recording slow SQL calls. See <a title="New Relic Docs: Ruby: Sequel Instrumentation" href="https://newrelic.com/docs/ruby/sequel-instrumentation" target="_blank">these docs</a> for full details.</p>
<p>You can still try New Relic Pro <em>free</em> for 30 days. For more information, see our <a title="Get New Relic Pro FREE for 30-days!" href="http://newrelic.com/railsconf" target="_blank">RailsConf</a> page. Here is to another great year ahead. See you in Chicago for RailsConf 2014!</p>
<p>The post <a href="http://blog.newrelic.com/2013/05/10/railsconf-2013-review/">RailsConf 2013 Review</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.newrelic.com/2013/05/10/railsconf-2013-review/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Test All the Combinations!</title>
		<link>http://blog.newrelic.com/2013/05/09/test-all-the-combinations/</link>
		<comments>http://blog.newrelic.com/2013/05/09/test-all-the-combinations/#comments</comments>
		<pubDate>Thu, 09 May 2013 16:43:19 +0000</pubDate>
		<dc:creator>Jason Clark</dc:creator>
				<category><![CDATA[Company News]]></category>
		<category><![CDATA[Performance Tech Tips]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Top Post]]></category>
		<category><![CDATA[New Relic]]></category>

		<guid isPermaLink="false">http://blog.newrelic.com/?p=12792</guid>
		<description><![CDATA[<p>Most applications test for their own correctness. But sometimes gems need to go further and test their interactions with other gems. newrelic_rpm – otherwise known as the New Relic Ruby agent – is definitely one of them. It needs to not only coexist with other gems, but to seamlessly instrument them. So, how do we [...]</p><p>The post <a href="http://blog.newrelic.com/2013/05/09/test-all-the-combinations/">Test All the Combinations!</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Most applications test for their own correctness. But sometimes gems need to go further and test their interactions with other gems. <i>newrelic_rpm</i> – otherwise known as the New Relic Ruby agent – is definitely one of them. It needs to not only coexist with other gems, but to seamlessly instrument them.</p>
<p>So, how do we test code that’s heavily dependent on other components? How do we validate different combinations of frameworks that can occur in the wild? Read on for the nitty gritty of testing the Ruby agent in multiple environments.</p>
<p><span style="font-size: 1.25em;"><b>The Uncertainties of Life (and Testing)</b></span><br />
Before coming to New Relic, I was an app developer. At that time I never realized how much simpler life was when you could choose 1) what dependencies to take, 2) how the production environment was configured and 3) the fundamentals, like language versions. Unfortunately, library authors don’t get these certainties.</p>
<p>The richness of the gem ecosystem keeps the Ruby agent team on our toes. We support at least six different Ruby versions (depending on exactly how you count), eight versions of Rails, and a pile of other frameworks. If you ever need to be sure your code runs against Rails 2.0 and Ruby 1.8.6, I’ve got the test suite for you!</p>
<p>At the highest level, we follow a standard unit / functions (or integration) test breakdown. Let’s take a look at the unit tests first.</p>
<p><span style="font-size: 1.1em;"><b>Unit Testing</b></span><br />
Unit tests are the front line of our testing. They run quickly (about 10 seconds locally for the full suite of &gt; 1000 tests), with the lightest dependencies. We execute them across the broadest number of combinations of Ruby and Rails versions.</p>
<p>Historically Rails has been a big focus for the agent, so the unit tests run in the context of a Rails application. While most of the agent’s unit tests could run without any external dependencies, we’ve encountered many subtle bugs from interesting intersections between Rails (I’m looking at you, ActiveSupport) and the various flavors of Ruby. Running the unit tests under Rails helps flush out these odd interactions. For example, we found one problem with subtly incompatible versions of the to_json method floating around during the 2.x versions of ActiveSupport.</p>
<p>Which version of Rails do we run against? Well, if you <a title="Get it from GitHub" href="http://github.com/newrelic/rpm" target="_blank">download the agent source</a> and run the unit tests, you’ll see this:</p>
<pre class="brush: ruby; title: ; notranslate">
♥♥♥~/source/newrelic/ruby_agent [1.9.3] [release]:rake test

/Users/jclark/.rbenv/versions/1.9.3-p374/bin/ruby -I&quot;lib:/Users/jclark/source/newrelic/ruby_agent/test:/Users/jclark/source/newrelic/ruby_agent/lib&quot; -I&quot;/Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib&quot; &quot;/Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_test_loader.rb&quot; &quot;/Users/jclark/source/newrelic/ruby_agent/test/new_relic/**/*_test.rb&quot;

Running tests in standalone mode.
Run options:

# Running tests:

...more dots...

Finished tests in 8.206038s, 129.6606 tests/s, 338.4094 assertions/s.

1064 tests, 2777 assertions, 0 failures, 0 errors, 0 skips
</pre>
<p>The line &#8216;Running tests in standalone mode&#8217; hints at what’s going on. In &#8216;standalone mode&#8217; we <a title="View the code" href="https://github.com/newrelic/rpm/blob/171fd110221a8cd0e456a13240381c5f15f4df31/test/test_helper.rb#L27-41" target="_blank">construct a tiny Rails app</a> in the agent that – by default – runs a Rails 3.2 app.</p>
<p>But what about all those other versions of Rails? That’s where <a title="Get the rpm_test app from GitHub" href="https://github.com/newrelic/rpm_test_app" target="_blank">rpm_test_app</a> comes in. It’s a full, separate application with branches for each flavor of Rails we support. These get stitched together with some Rake goodness to <a title="Check it out in GitHub" href="https://github.com/newrelic/rpm/blob/master/lib/tasks/tests.rake" target="_blank">run the unit tests for newrelic_rpm</a> in rpm_test_app&#8217;s context:</p>
<pre class="brush: ruby; title: ; notranslate">
Rake::TestTask.new(:newrelic) do |t|
  t.libs &lt;&lt; &quot;#{agent_home}/test&quot;
  t.libs &lt;&lt; &quot;#{agent_home}/lib&quot;
  t.pattern = &quot;#{agent_home}/test/new_relic/**/*_test.rb&quot;
  t.verbose = true
end
</pre>
<p>With `rake test:newrelic`, our CI system can run the gambit of Rails and Ruby versions. Jenkins configurations let us dictate which combinations make sense given that, for instance, you can&#8217;t run Rails 3.x and greater on Ruby 1.8.6.</p>
<p style="text-align: center;"><a href="http://blog.newrelic.com/wp-content/uploads/test_all_unittests.png" target="_blank"><img class="size-full wp-image-12842 aligncenter" style="border: 1px solid black; margin-top: 15px; margin-bottom: 15px;" title="Testing Ruby " alt="test_all_unittests" src="http://blog.newrelic.com/wp-content/uploads/test_all_unittests.png" width="550" height="367" /></a></p>
<p><span style="font-size: 1.25em;"><b>Not All About Rails</b></span><br />
That&#8217;s all good, but there&#8217;s much more to Ruby than just Rails. With the rich variety of frameworks to support, we needed an approach to mix and match dependencies.</p>
<p>This need led to our functional/integration testing layer, affectionately referred to as the &#8216;Pangalactic Multiverse&#8217; tests.</p>
<p>At heart, Multiverse is a series of suites, each representing a collection of dependencies. We have one for Sinatra, one for Resque and one for ActiveRecord outside of Rails. The exact versions are specified by an Envfile:</p>
<pre class="brush: ruby; title: ; notranslate">
suite_condition(&quot;Sinatra not compatible with 1.8.6&quot;) do
  RUBY_VERSION != '1.8.6'
end

gemfile &lt;&lt;-RB
  gem 'sinatra', '1.3.3'
  gem 'rack-test', :require =&gt; 'rack/test'
RB

gemfile &lt;&lt;-RB
  gem 'sinatra', '1.2.8'
  gem 'rack-test', :require =&gt; 'rack/test'
RB
</pre>
<p>Multiverse reads the Envfile and generates a Gemfile for each call to `gemfile`. It will <a title="About &quot;bundle install&quot;" href="http://gembundler.com/v1.3/man/bundle-install.1.html" target="_blank">bundle install</a> those dependencies and run the suite&#8217;s tests in a separate child process.</p>
<p>Unlike the unit tests that focus on individual classes, Multiverse tests run a full agent cycle – starting up, monitoring work, shutting down and transmitting data. They even run a fake service endpoint so data flows over HTTP, keeping as close to the runtime reality of the agent as possible.</p>
<p>With the additional environment spin-up and running our full stack, Multiverse tests are slower, but vital for coverage. We can easily write targeted automated tests against multiple different versions of individual frameworks, and validate that the agent works with new releases as they come out.</p>
<p>The Envfile lets each suite run multiple sets of dependent versions. And our CI system takes care of running Multiverse against various Ruby versions, too. So many combinations!</p>
<p style="text-align: center;"><a title="Ruby Multiverse test" href="http://blog.newrelic.com/wp-content/uploads/test_all_functionaltests.png" target="_blank"><img class="size-full wp-image-12844 aligncenter" style="border: 1px solid black; margin-top: 15px; margin-bottom: 15px;" title="Ruby Multiverse test" alt="test_all_functionaltests" src="http://blog.newrelic.com/wp-content/uploads/test_all_functionaltests.png" width="550" height="182" /></a></p>
<p><span style="font-size: 1.1em;"><b>The Hard Part</b></span><br />
Testing always presents unique challenges. And a library like the Ruby agent introduces its own set of fun twists.</p>
<p><span style="font-size: 1.1em;"><b>It’s About the Environment</b></span><br />
A lot of the work on our testing system has gone into getting environment setup scripted, both locally and in CI. We&#8217;re currently using a solution with Vagrant and Puppet that lets us spin up consistently formatted build boxes.</p>
<p><span style="font-size: 1.1em;"><b>Leaky Test State</b></span><br />
Testing needs to mimic reality to find some types of problems. This presents difficulties for the Ruby agent.</p>
<p>In production, the agent starts once per process. However, in a test run, the agent might restart hundreds of times. We&#8217;ve had to take care to avoid a leaking state between tests. Otherwise we could be faced with tests that work fine in isolation, but break when run in the suite. However, an upshot of this pain is the <a title="Jon's bisect test in GitHub" href="https://github.com/gnarg/test_bisect" target="_blank">test_bisect gem</a> my coworker <a href="https://github.com/gnarg">Jon</a> wrote. If you’ve ever suffered from leaky tests you should check it out.</p>
<p><span style="font-size: 1.1em;"><b>Timeliness Counts</b></span><br />
It’s also hard to write good tests for monitoring time and the underlying system. It’s much easier to write brittle timing tests that run fine locally, but break when deployed to the slower VM-based CI system under heavy load. Given how much of the Ruby agent&#8217;s functionality is about accurate timing, this is a continuing pain point we wrestle with in testing. In general, we’ve moved toward stubbing time values in unit tests and applying thresholds or percentage comparisons rather than strict timeframes whenever possible in functional tests.</p>
<p><span style="font-size: 1.25em;"><b>Need for Speed</b></span><br />
Running Multiverse is relatively slow. So, we’ve worked hard to prune that time. Two major approaches were: a) keeping suites coarse grained and b) applying local bundling. Both of these hinged off the setup being the slowest part of Multiverse.</p>
<p>In the first case, our early experience saw new Multiverse suites cropping up per feature. Often these would just copy an existing environment with minimal tweaks. Merging those suites along the lines of their gem dependencies gave a huge performance bump. Getting the right granularity for grouping tests was a big win.</p>
<p>Second, the Multiverse setup tries to bundle without contacting <a title="The RubyGems website" href="http://rubygems.org" target="_blank">RubyGems</a>, but re-runs a full bundle if that doesn&#8217;t work. Less network chatter = faster setup = faster tests.</p>
<p><span style="font-size: 1.25em;"><b>Conclusion</b></span><br />
That’s how we deal with testing multiple frameworks and Ruby environments on the Ruby agent team. It’s given us a nice balance of having our fast unit tests against the most common cases, with easy access to full-stack Multiverse tests to cover other configurations.</p>
<p>Are you a gem author who tests against different frameworks and Ruby implementations? Got a trick (or two) that’s helped you keep your dependency testing under control? Tell us about your experiences in the comments below.</p>
<p>The post <a href="http://blog.newrelic.com/2013/05/09/test-all-the-combinations/">Test All the Combinations!</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.newrelic.com/2013/05/09/test-all-the-combinations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Red Code, Green Code</title>
		<link>http://blog.newrelic.com/2013/05/02/red-code-green-code/</link>
		<comments>http://blog.newrelic.com/2013/05/02/red-code-green-code/#comments</comments>
		<pubDate>Thu, 02 May 2013 16:25:58 +0000</pubDate>
		<dc:creator>Merlyn Albery-Speyer</dc:creator>
				<category><![CDATA[Performance Tech Tips]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Top Post]]></category>

		<guid isPermaLink="false">http://blog.newrelic.com/?p=12815</guid>
		<description><![CDATA[<p>I’ve got an idea I want to share with you. It’s the concept of Red Code and Green Code. Now, this doesn’t have anything to do with the red / green / refactor cycle, code coverage or testing. You&#8217;ll know Green Code when you see it. It’s code that&#8217;s made elegant due to some cleverly written [...]</p><p>The post <a href="http://blog.newrelic.com/2013/05/02/red-code-green-code/">Red Code, Green Code</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>I’ve got an idea I want to share with you. It’s the concept of Red Code and Green Code. Now, this doesn’t have anything to do with the red / green / refactor cycle, code coverage or testing. You&#8217;ll know Green Code when you see it. It’s code that&#8217;s made elegant due to some cleverly written supporting Red Code.</p>
<p>Here’s an example of Green Code in Ruby:</p>
<p>
<pre>class Customer < ActiveRecord::Base
  has_many &#58;orders
end</pre>
</p>
<p>In this code snippet, <code>has_many</code> is ActiveRecord’s Red Code. There’s a lot of machinery backing the <code>has_many</code> code that the Green Code doesn’t need to concern itself with.</p>
<p>You’ll often find Red Code in frameworks, APIs and DSLs. There are numerous examples including Gradle, Geb, jQuery, Mocha, Rake, Rails, RSpec, and Spock. And depending on the language, Red Code typically makes heavy use of some of the more powerful language features (e.g. meta programming in Ruby, byte code manipulation in Java).</p>
<p>However, the <a title="Red Code, Green Code, My Code" href="http://tapestryjava.blogspot.com/2013/01/red-code-green-code-my-code-your-code.html" target="_blank">Red Code / Green Code concept</a> isn’t a new one. In his book On Lisp, Paul Graham referred to this as <a title="Bottom-Up Programming" href="http://paulgraham.com/progbot.html" target="_blank">Bottom-Up Programming</a>. Graham encouraged his readers to increase the expressiveness of the language (Red Code) in order to make their code shorter and more readable (Green Code).</p>
<p>Depending on the task you’re trying to solve, you’ll probably want to be careful about writing any Red Code as it is apt to violate the principle of least surprise. For example, in Java you may come up with a clever solution using reflection. But reflection is unusual enough that it will likely trip up unsuspecting navigators of the code. As a good rule of thumb, candidates for Red Code are areas of your code that would make good open source libraries. To be worthwhile, the benefit of the Red Code has to outweigh the cost of discovering the unusual behavior, learning its proper usage and maintaining the more complex solution.</p>
<p>To illustrate this, take a look at the code behind Backbone.js. It’s very much Green Code and there are no big surprises. Then compare it with Angular, where there’s clearly Red Code under the hood. When you use the frameworks,  you’ll notice the difference, too. Backbone.js is easier to get into, but you need to write a fair amount of boiler place code. On the other hand, Angular has ‘magic’ conventions that take time to get use to. But once you’ve adjusted to how it work, you’ll benefit from the reduced boiler plate code.</p>
<p>Do you have experiences working with or writing Red Code and Green Code? Tell us about your experiences in the comments below.</p>
<p>The post <a href="http://blog.newrelic.com/2013/05/02/red-code-green-code/">Red Code, Green Code</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.newrelic.com/2013/05/02/red-code-green-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debugging Stuck Ruby Processes – What to do Before You Kill -9</title>
		<link>http://blog.newrelic.com/2013/04/29/debugging-stuck-ruby-processes-what-to-do-before-you-kill-9/</link>
		<comments>http://blog.newrelic.com/2013/04/29/debugging-stuck-ruby-processes-what-to-do-before-you-kill-9/#comments</comments>
		<pubDate>Mon, 29 Apr 2013 19:34:27 +0000</pubDate>
		<dc:creator>Ben Weintraub</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Performance Tech Tips]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Top Post]]></category>

		<guid isPermaLink="false">http://blog.newrelic.com/?p=12807</guid>
		<description><![CDATA[<p>RailsConf 2013 has begun! To celebrate, we’re publishing a series of blog posts that highlight what’s new and exciting in the world of New Relic’s Ruby support. Don’t forget to check out the entire series so far: Cross Application Tracing, Thread Profiling, Living on the Edge with Rails 4 &#38; Ruby 2, Thread Safe APIs &#38; Sidekiq Support for [...]</p><p>The post <a href="http://blog.newrelic.com/2013/04/29/debugging-stuck-ruby-processes-what-to-do-before-you-kill-9/">Debugging Stuck Ruby Processes – What to do Before You Kill -9</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><em><a title="RailsConf 2013 logo" href="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png" target="_blank"><img class="alignleft" style="margin: 5px;" title="RailsConf 2013 logo" alt="RailsConf 2013 logo" src="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png" width="88" height="88" /></a>RailsConf 2013 has begun! To celebrate, we’re publishing a series of blog posts that highlight what’s new and exciting in the world of New Relic’s Ruby support. Don’t forget to check out the entire series so far: <a title="Cross App Tracing: Time to Break Up that Huge Rails Application?" href="http://blog.newrelic.com/2013/04/22/cross-app-tracing-time-to-break-up-that-huge-rails-application/" target="_blank">Cross Application Tracing</a>, <a title="Thread Profiling: See Exactly What Your App Is Doing" href="http://blog.newrelic.com/2013/04/23/thread-profiling-see-exactly-what-your-app-is-doing/" target="_blank">Thread Profiling</a>, <em><a title="Living on the Edge with Rails 4 &amp; Ruby 2" href="http://blog.newrelic.com/2013/04/24/living-on-the-edge-with-rails-4-ruby-2/" target="_blank">Living on the Edge with Rails 4 &amp; Ruby 2</a>, <a title="Thread Safe APIs and Sidekiq Support for Your Threading" href="http://blog.newrelic.com/2013/04/25/thread-safe-apis-and-sidekiq-support-for-your-threading/">Thread Safe APIs &amp; Sidekiq Support for Your Threading</a>, and <a title="Security Banners (For If You Forgot to Apply the Latest CVE Patch)" href="http://blog.newrelic.com/2013/04/26/security-banners-for-if-you-forgot-to-apply-the-latest-cve-patch/" target="_blank">Security Banners (For If You Forgot to Apply the Latest CVE Patch)</a>.<br />
</em></em></p>
<p>If you’ve spent enough time working with a production system (or even just a continuous integration server), you&#8217;ve surely encountered a Ruby process that was ‘stuck.’  You know the type – not crashing, but not making any real progress either. And giving you no obvious indication of what it was doing.</p>
<p>When finding a stuck process, your primary goal usually is to just get the wheels of progress turning again. And the quickest path to that goal is usually to `kill -9` the stuck process and restart it.</p>
<p>But I want to you to make your future self a promise. The next time this happens, don’t just kill that stuck process and move on. Dig in and figure out what&#8217;s really going on. You might just discover the root cause of your problem, hone your debugging techniques or discover a clue that helps you fix that tricky bug in your favorite open source project that no one has been able to pin down.</p>
<p>Since encountering a stuck process (especially in production) is often stressful, I find it helps to think about the debugging steps you plan to take ahead of time. Create a ‘checklist’ of things to run through so you don’t forget anything or skip any steps. Failing to capture enough information to reproduce a bug usually means you’ll hit it again. So make sure you seize the opportunity when it’s available.</p>
<p>Here are the steps I follow when debugging a stuck Ruby process:</p>
<p><span style="font-size: 1.25em;"><b>Who Said What?</b></span><br />
First, figure out exactly what process is stuck. This sounds trivial, but it’s especially important for systems like <a title="Unicorn" href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a>, <a title="Passenger" href="http://rubygems.org/gems/passenger" target="_blank">Passenger</a>, <a title="Resque" href="https://github.com/resque" target="_blank">Resque</a>, etc. where the system is composed of multiple processes that have different roles (often a single master process plus a number of workers).</p>
<p>Identifying exactly which process is stuck is important in order to get a full picture of the behavior of the system as a whole. The trusty ps utility is usually my first stop here &#8212; a quick `ps aux | grep &lt;process name&gt;`.</p>
<p>I like to keep a transcript of the exact commands I’ve run, along with their output. And the ps aux output is usually the first thing that goes into that transcript.</p>
<p>Tools like <a title="htop" href="http://htop.sourceforge.net/" target="_blank">htop</a> and <a title="pstree" href="http://www.thp.uni-duisburg.de/pstree/" target="_blank">pstree</a> can also be useful here. They give you a visual tree of the relationship between the stuck process, its sibling and its parent process (e.g. a Unicorn master and its workers).</p>
<p><span style="font-size: 1.25em;"><b>Grab Any Logs that are Available</b></span><br />
Again this may seem obvious, but the goal of the checklist is to remind you of everything you need to track. This will give you the best possible chance of debugging the problem offline. Before getting started, consider these questions:</p>
<p style="padding-left: 30px;">* Where is STDOUT of the stuck process being sent?</p>
<p style="padding-left: 30px;">* Where is STDERR of the stuck process being sent?</p>
<p style="padding-left: 30px;">* Are there any other log files created by the stuck process? Check the command line and config file used for the process. Did either specify a log path?</p>
<p style="padding-left: 30px;">* Are there any other log files created by processes related to the stuck process?</p>
<p><span style="font-size: 1.25em;"><b>Other Non-Invasive Basics</b></span><br />
Try gathering the following before you move into the more invasive actions:</p>
<p style="padding-left: 30px;">* Grab the list of open files and sockets from the process using lsof -p &lt;PID&gt;</p>
<p style="padding-left: 30px;">* If you&#8217;re on Linux, poke around in /proc/&lt;PID&gt; and consider gathering:</p>
<p style="padding-left: 60px;">* cmdline contains the command line that was used to launch the process</p>
<p style="padding-left: 60px;">* cwd is a link to the current working directory of the process</p>
<p style="padding-left: 60px;">* environ is a list of environment variables set for the process</p>
<p><span style="font-size: 1.25em;"><b>Check the CPU Usage of the Stuck Process</b></span><a title="Locks" href="http://blog.newrelic.com/wp-content/uploads/locks.jpg" target="_blank"><img class="alignright size-full wp-image-12809" style="margin: 5px;" title="Locks" alt="Locks" src="http://blog.newrelic.com/wp-content/uploads/locks.jpg" width="200" height="133" /></a><br />
There are two basic flavors of hangs: static and dynamic. (Note: This is my own terminology, but I think it’s a useful taxonomy.) In a static hang, the threads of the stuck process are stuck in the same exact state for an extended period of time. Examples include traditional deadlocks and processes blocked for extended periods in system calls (often things like `read`, `select`, etc.). In a dynamic hang, the threads of the stuck process are changing state, but are caught in some kind of loop that prevents them from making progress (this is sometimes called a &#8216;livelock&#8217;).</p>
<p>The techniques used to debug the two types of hangs are different. So it’s useful to be able to differentiate between them in the wild. A quick heuristic for doing this is to check the CPU usage of the stuck process. Static hangs will generally result in processes with no CPU usage, whereas dynamic hangs will result in processes with non-zero CPU usage (often very high, if the process is stuck in a tight loop).</p>
<p>There are a variety of tools you can use to do this, but a quick look at `top` or `ps -o cpu &lt;pid&gt;` is often enough.</p>
<p><span style="font-size: 1.05em;"><b>Static Hangs</b></span><br />
For static hangs where the stuck process demonstrates no CPU usage, gather information on the backtraces of all threads in the stuck process. This is often the most important data. Since the threads aren&#8217;t changing state, a single snapshot of thread backtraces is usually sufficient.</p>
<p>There are a variety of different tools for accomplishing this goal, depending on the platform you&#8217;re running on and the Ruby implementation you&#8217;re using, but I&#8217;m going to focus on what is perhaps the most common case: MRI on a Linux host.</p>
<p>`gdb` is a time-tested and widely available tool that can be used to interrogate a running process on a variety of UNIX-ish platforms. You can attach to a running process with gdb by using the -p option, like this:</p>
<pre class="brush: ruby; title: ; notranslate">
```
gdb -p
```
</pre>
<p>Once gdb has successfully attached to the target process, it will drop you at a prompt. The very first thing you should do here is to gather C-level backtraces for all threads of the stuck process, like this:</p>
<pre class="brush: ruby; title: ; notranslate">
```
(gdb) t a a bt
```
</pre>
<p>This is short for `thread apply all backtrace`. Copy this output and save it to your transcript file, even if it&#8217;s not immediately informative.</p>
<p>Sometimes C-level backtraces are all you need in order to debug a hang. In other cases though, you really need a Ruby-level backtrace to see what&#8217;s going on. Luckily, gdb can help you generate those, too.</p>
<p><span style="font-size: 1em;"><b>Getting a Ruby Backtrace with gdb</b></span><br />
Getting a Ruby backtrace out of gdb involves interacting with the Ruby interpreter in the running process that you&#8217;ve attached to. And to get that, the interpreter needs to be in a semi-working state.  If the root cause of the issue is a Ruby bug, the process may be stuck in such a way that it isn’t possible to get the backtrace at all.</p>
<p>That said, it’s always worth trying. Here’s the technique I use:</p>
<p>Most mechanisms for dumping Ruby backtraces will output them to stdout or stderr. It’s fine if you know where the stdout and stderr for your process is going, and you have access to it. If not, first you’ll need to redirect the output streams to an accessible location.</p>
<p>To do this, we rely on POSIX conventions and some trickery. stdout and stderr are file descriptors 1 and 2 on POSIX-compliant systems. We want to close these file descriptors, and reopen them attached to files that we can actually read from. Closing is easy:</p>
<pre class="brush: ruby; title: ; notranslate">
```
(gdb) call (void) close(1)
(gdb) call (void) close(2)
```
</pre>
<p>The call command tells gdb to invoke close from within the target process. Next, we need to re-associate file descriptors 1 and 2 with a file we can actually read from. We could use a file on the filesystem, but it&#8217;s even more convenient to see the output directly in gdb. To do that, we want to figure out the device file corresponding to our current TTY and open it twice. Since file descriptors are assigned sequentially, descriptors 1 and 2 will end up being re-associated with our TTY device. Here&#8217;s how this looks:</p>
<pre class="brush: ruby; title: ; notranslate">
```
(gdb) shell tty
/dev/pts/0
(gdb) call (int) open(&quot;/dev/pts/0&quot;, 2, 0)
$1 = 1
(gdb) call (int) open(&quot;/dev/pts/0&quot;, 2, 0)
$2 = 2
```
</pre>
<p>Now, any output generated by the target process will be echoed directly to our console so we can see it in our gdb session.</p>
<p>Finally, we need to get the Ruby interpreter in the target process to spit out a backtrace. There are many ways to do this. But the easiest way is just to use gdb to call the rb_backtrace() function from the Ruby interpreter directly:</p>
<pre class="brush: ruby; title: ; notranslate">
```
(gdb) call (void)rb_backtrace()
```
</pre>
<p>With luck, you&#8217;ll see a Ruby backtrace dumped to your console.</p>
<p><span style="font-size: 1em;"><b>Digging Deeper with gdb</b></span><br />
If you know what you’re looking for in the stuck process, there’s a lot more you can do with gdb. <a title="Jon Yurek on Twitter" href="https://twitter.com/jyurek" target="_blank">Jon Yurek</a> at <a title="thoughtbot" href="http://www.thoughtbot.com/" target="_blank">thoughtbot</a> has a <a title="Using GDB to inspect a running Ruby process" href="http://robots.thoughtbot.com/post/47202759358/using-gdb-to-inspect-a-running-ruby-process" target="_blank">great post</a> on this topic that explains how you can get gdb to evaluate arbitrary Ruby code in the target process to inspect the values of Ruby variables, get backtraces for all threads and any number of other things</p>
<p><span style="font-size: 1.05em;"><b>Dynamic Hangs</b></span><br />
A stuck process that shows high CPU usage is likely stuck in a tight loop. This means that the exact backtraces you get out of it may vary from one sample to the next, but backtraces can still be very helpful to point you in the right direction.</p>
<p>If you find a stuck process with high CPU usage, it may be worth gathering backtraces 2 or 3 times to get a more representative sample. (You can use gdb&#8217;s continue command to resume the process after you&#8217;ve attached).</p>
<p>You can also use other tracing tools to examine the behavior of the looping process. On Linux, strace -p &lt;pid&gt; allows you to view the system calls being made by the process. If you&#8217;re on an OS that has dtrace available, you can use dtruss -p &lt;PID&gt; instead to get a similar output.</p>
<p><span style="font-size: 1.25em;"><b>Thanks, from your Future Self</b></span><br />
You might not always have the luxury of being able to spend time debugging a stuck process. But when you do dive in, you’ll probably be glad you did. I’ve only scratched the surface of the tools available for analyzing problems like this, but hopefully I’ve given you enough information that you’ll be comfortable doing more than just sighing, SIGKILL-ing, and waiting for your problem to reappear.</p>
<p><span style="font-size: 1.15em;"><b>Bonus: Mac OS X</b></span><br />
If you happen to be debugging a stuck process on Mac OS X, check out this <a title="Mac OS X Sample Utility" href="https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/sample.1.html" target="_blank">sample utility</a> (a handy tool that ships with OS X). It will automate the collection of multiple C-level backtraces, aggregate them together and print out a nicely formatted call tree report showing where the stuck process is spending most of its time.</p>
<p><i>At RailsConf 2013? Stop by our booth to see the New Relic Ruby Agent in action, pick up your free Data Nerd t-shirt and more. You can </i><i>even try New Relic Pro free for 30 days. For more information, go to <a title="Attn. RailsConf attendees: Get New Relic Pro free for 30 days!" href="http://newrelic.com/railsconf" target="_blank">newrelic.com/railsconf</a>.</i></p>
<p>The post <a href="http://blog.newrelic.com/2013/04/29/debugging-stuck-ruby-processes-what-to-do-before-you-kill-9/">Debugging Stuck Ruby Processes – What to do Before You Kill -9</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.newrelic.com/2013/04/29/debugging-stuck-ruby-processes-what-to-do-before-you-kill-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security Banners (For If You Forgot to Apply the Latest CVE Patch)</title>
		<link>http://blog.newrelic.com/2013/04/26/security-banners-for-if-you-forgot-to-apply-the-latest-cve-patch/</link>
		<comments>http://blog.newrelic.com/2013/04/26/security-banners-for-if-you-forgot-to-apply-the-latest-cve-patch/#comments</comments>
		<pubDate>Fri, 26 Apr 2013 17:32:38 +0000</pubDate>
		<dc:creator>Jason Clark</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Product Updates]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Top Post]]></category>

		<guid isPermaLink="false">http://blog.newrelic.com/?p=12795</guid>
		<description><![CDATA[<p>RailsConf 2013 is right around the corner! And to celebrate, we’re publishing a series of blog post that highlight what’s new and exciting in the world of New Relic’s Ruby support. Don’t forget to check out the entire series so far: Cross Application Tracing, Thread Profiling, Living on the Edge with Rails 4 &#38; Ruby 2, and Thread Safe [...]</p><p>The post <a href="http://blog.newrelic.com/2013/04/26/security-banners-for-if-you-forgot-to-apply-the-latest-cve-patch/">Security Banners (For If You Forgot to Apply the Latest CVE Patch)</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><em><a title="RailsConf 2013 logo" href="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png" target="_blank"><img class="alignleft  wp-image-12756" style="margin: 5px;" title="RailsConf 2013 logo" alt="RailsConf 2013 logo" src="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png" width="88" height="88" /></a>RailsConf 2013 is right around the corner! And to celebrate, we’re publishing a series of blog post that highlight what’s new and exciting in the world of New Relic’s Ruby support. Don’t forget to check out the entire series so far: <a title="Cross App Tracing: Time to Break Up that Huge Rails Application?" href="http://blog.newrelic.com/2013/04/22/cross-app-tracing-time-to-break-up-that-huge-rails-application/" target="_blank">Cross Application Tracing</a>, <a title="Thread Profiling: See Exactly What Your App Is Doing" href="http://blog.newrelic.com/2013/04/23/thread-profiling-see-exactly-what-your-app-is-doing/" target="_blank">Thread Profiling</a>, <em><a title="Living on the Edge with Rails 4 &amp; Ruby 2" href="http://blog.newrelic.com/2013/04/24/living-on-the-edge-with-rails-4-ruby-2/" target="_blank">Living on the Edge with Rails 4 &amp; Ruby 2</a>, and <a title="Thread Safe APIs and Sidekiq Support for Your Threading" href="http://blog.newrelic.com/2013/04/25/thread-safe-apis-and-sidekiq-support-for-your-threading/">Thread Safe APIs &amp; Sidekiq Support for Your Threading</a>.</em><br />
</em></p>
<p>Over the last few months there&#8217;s been a lot of traffic on the <a title="rubyonrails-security list" href="https://groups.google.com/forum/?fromgroups#%21forum/rubyonrails-security" target="_blank">rubyonrails-security</a> list. High profile remote code execution exploits were found in both <a title="Rails" href="http://weblog.rubyonrails.org/2013/2/11/SEC-ANN-Rails-3-2-12-3-1-11-and-2-3-17-have-been-released/" target="_blank">Rails</a> and <a title="Rack" href="http://rack.github.io/" target="_blank">Rack</a>, which heightened the focus on security in the community. It&#8217;s also brought increased scrutiny from security researchers probing for more vulnerabilities. Overall this will lead to more secure versions of Rails and other frameworks. The discussions also help more people consider their own applications&#8217; security.</p>
<p><a title="Security" href="http://blog.newrelic.com/wp-content/uploads/lock_keyboard.jpg" target="_blank"><img class="alignright  wp-image-12797" style="margin: 5px;" title="Security" alt="Security" src="http://blog.newrelic.com/wp-content/uploads/lock_keyboard.jpg" width="210" height="140" /></a>However, there&#8217;s the lurking issue of unpatched applications. Lots of people have Rails apps deployed they may not realize are vulnerable. It could be that small app a consultant installed two years ago that&#8217;s been chugging away untouched since. Or maybe it&#8217;s an experiment that got uploaded to a cloud service last year before being forgotten. It&#8217;s easier than ever to lose track of applications, and depending on your configurations and infrastructure, one insecure app can impact far more than just that app&#8217;s functionality.</p>
<p>New Relic&#8217;s Ruby agent has always reported the gems active in the application&#8217;s environment. That information has been useful for debugging and guiding us toward other libraries to instrument.</p>
<p>Brand new in time for RailsConf 2013 we&#8217;re taking advantage of that information to notify you of vulnerable versions of Rails and Rack. For Rails we check against versions 2.3.x and 3.x. Rack gets checked across versions 1.1.X through 1.5.X.</p>
<p>When we find a vulnerable version of these gems, you&#8217;ll see a banner in the New Relic UI pointing to the application and problematic gems. Additional links to the relevant development groups online will also let you dig further into the issues and learn more about the vulnerabilities.</p>
<p class="wp-image-12799 aligncenter" style="text-align: center;" title="Security Banner"><a title="Security Banner" href="http://blog.newrelic.com/wp-content/uploads/securityBanner.png" target="_blank"><img class="wp-image-12799 aligncenter" style="border: 1px solid black;" title="Security Banner" alt="Security Banner" src="http://blog.newrelic.com/wp-content/uploads/securityBanner.png" width="570" height="123" /></a></p>
<p class="wp-image-12799 aligncenter" style="text-align: left;" title="Security Banner">Here&#8217;s to a more secure future!</p>
<p><i>Headed to RailsConf 2013? Stop by our booth to see the New Relic Ruby Agent in action, pick up your free Data Nerd t-shirt and more. You can </i><i>even try New Relic Pro free for 30 days. For more information, go to <a title="Attn. RubyConf attendees: Get New Relic Pro free for 30 days!" href="http://newrelic.com/railsconf" target="_blank">newrelic.com/railsconf</a>.</i></p>
<p>The post <a href="http://blog.newrelic.com/2013/04/26/security-banners-for-if-you-forgot-to-apply-the-latest-cve-patch/">Security Banners (For If You Forgot to Apply the Latest CVE Patch)</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.newrelic.com/2013/04/26/security-banners-for-if-you-forgot-to-apply-the-latest-cve-patch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thread Safe APIs and Sidekiq Support for Your Threading</title>
		<link>http://blog.newrelic.com/2013/04/25/thread-safe-apis-and-sidekiq-support-for-your-threading/</link>
		<comments>http://blog.newrelic.com/2013/04/25/thread-safe-apis-and-sidekiq-support-for-your-threading/#comments</comments>
		<pubDate>Thu, 25 Apr 2013 17:07:35 +0000</pubDate>
		<dc:creator>Jason Clark</dc:creator>
				<category><![CDATA[Company News]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Top Post]]></category>

		<guid isPermaLink="false">http://blog.newrelic.com/?p=12787</guid>
		<description><![CDATA[<p>RailsConf 2013 is right around the corner! And to celebrate, we’re publishing a series of blog post that highlight what’s new and exciting in the world of New Relic’s Ruby support. Don’t forget to check out the entire series so far: Living on the Edge with Rails 4 and Ruby 2, Cross Application Tracing and Thread Profiling. A [...]</p><p>The post <a href="http://blog.newrelic.com/2013/04/25/thread-safe-apis-and-sidekiq-support-for-your-threading/">Thread Safe APIs and Sidekiq Support for Your Threading</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><em><a title="RailsConf 2013 logo" href="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png" target="_blank"><img class="wp-image-12756 alignleft" style="margin: 5px;" title="RailsConf 2013 logo" alt="RailsConf 2013 logo" src="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png" width="93" height="93" /></a>RailsConf 2013 is right around the corner! And to celebrate, we’re publishing a series of blog post that highlight what’s new and exciting in the world of New Relic’s Ruby support. Don’t forget to check out the entire series so far: <a title="Living on the Edge with Rails 4 &amp; Ruby 2" href="http://blog.newrelic.com/2013/04/24/living-on-the-edge-with-rails-4-ruby-2/" target="_blank">Living on the Edge with Rails 4 and Ruby 2</a>, <a title="Cross App Tracing: Time to Break Up that Huge Rails Application?" href="http://blog.newrelic.com/2013/04/22/cross-app-tracing-time-to-break-up-that-huge-rails-application/" target="_blank">Cross Application Tracing</a> and <a title="Thread Profiling: See Exactly What Your App Is Doing" href="http://blog.newrelic.com/2013/04/23/thread-profiling-see-exactly-what-your-app-is-doing/" target="_blank">Thread Profiling</a>.</em></p>
<p>A few years ago multi-threading support in Ruby was flaky or nonexistent. The Ruby agent came of age in that world, where the only real option for concurrency was running multiple processes. Recent versions of JRuby and MRI have changed that landscape. With Rubies providing OS-backed support for concurrency primitives, libraries and servers are taking advantage of threads like never before.</p>
<p>In light of this, we&#8217;ve done a significant rewrite &#8211; focused on thread safety &#8211; to how the Ruby agent accesses its metric data structures. All the agent internals now work through a set of methods which ensure concurrent reading and writing of metrics is safe. In the past highly threaded applications could encounter inaccurate monitoring or contention issues, but those should no longer be a problem for the Ruby agent.</p>
<p><a title="Sidekiq logo" href="http://blog.newrelic.com/wp-content/uploads/sidekiq_logo.png" target="_blank"><img class="wp-image-12788 alignright" style="margin: 40px 10px;" title="Sidekiq logo" alt="Sidekiq logo" src="http://blog.newrelic.com/wp-content/uploads/sidekiq_logo.png" width="78" height="85" /></a>As an added bonus, revising the APIs also let us update them for consistency and usability. Users doing <a title="New Relic Docs: Ruby Custom Metric Collection" href="https://newrelic.com/docs/ruby/ruby-custom-metric-collection#example_nonmethod" target="_blank">more sophisticated custom instrumentation</a> will benefit from the cleaner API, along with the thread safety it provides. Taking advantage of the agent&#8217;s thread safe internals, we&#8217;ve responded to a common customer request by adding support for <a title="Sidekiq" href="http://sidekiq.org/" target="_blank">Sidekiq</a>. Sidekiq is a background task framework similar to <a title="Resque" href="https://github.com/resque" target="_blank">Resque</a>. Where Resque uses a forking model, Sidekiq approaches this problem by executing jobs concurrently on multiple threads per worker process. Keeping fewer worker processes means less startup time, less memory consumption, and more sharing of resources between jobs. While it requires a keen eye toward concurrency issues in your code, for certain types of jobs Sidekiq&#8217;s multi-threaded approach can be a big performance win.</p>
<p>Sidekiq monitoring is enabled automatically by the <a title="New Relic Ruby Agent Releases" href="https://newrelic.com/docs/releases/ruby" target="_blank">New Relic Ruby agent</a> starting with version 3.6.0.</p>
<p><i>Headed to RailsConf 2013? Stop by our booth to see the New Relic Ruby Agent in action, pick up your free Data Nerd t-shirt and more. You can </i><i>even try New Relic Pro free for 30 days. For more information, go to <a title="Attn. RailsConf attendees: Get New Relic Pro free for 30 days!" href="http://newrelic.com/railsconf" target="_blank">newrelic.com/railsconf</a>.</i></p>
<p>The post <a href="http://blog.newrelic.com/2013/04/25/thread-safe-apis-and-sidekiq-support-for-your-threading/">Thread Safe APIs and Sidekiq Support for Your Threading</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.newrelic.com/2013/04/25/thread-safe-apis-and-sidekiq-support-for-your-threading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Living on the Edge with Rails 4 &amp; Ruby 2</title>
		<link>http://blog.newrelic.com/2013/04/24/living-on-the-edge-with-rails-4-ruby-2/</link>
		<comments>http://blog.newrelic.com/2013/04/24/living-on-the-edge-with-rails-4-ruby-2/#comments</comments>
		<pubDate>Wed, 24 Apr 2013 18:27:31 +0000</pubDate>
		<dc:creator>Sam Goldstein</dc:creator>
				<category><![CDATA[Company News]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Top Post]]></category>

		<guid isPermaLink="false">http://blog.newrelic.com/?p=12775</guid>
		<description><![CDATA[<p>RailsConf 2013 is right around the corner! And to celebrate, we’re publishing a series of blog post that highlight what’s new and exciting in the world of New Relic’s Ruby support. Don’t forget to check out the entire series so far: Cross Application Tracing and Thread Profiling. We want New Relic’s Ruby agent to work [...]</p><p>The post <a href="http://blog.newrelic.com/2013/04/24/living-on-the-edge-with-rails-4-ruby-2/">Living on the Edge with Rails 4 &#038; Ruby 2</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><i><a title="RailsConf 2013 logo" href="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png" target="_blank"><img class="alignright  wp-image-12756" title="RailsConf 2013 logo" alt="RailsConf 2013 logo" src="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png" width="126" height="126" /></a></i><em>RailsConf 2013 is right around the corner! And to celebrate, we’re publishing a series of blog post that highlight what’s new and exciting in the world of New Relic’s Ruby support. Don’t forget to check out the entire series so far: <a title="Cross App Tracing: Time to Break Up that Huge Rails Application?" href="http://blog.newrelic.com/2013/04/22/cross-app-tracing-time-to-break-up-that-huge-rails-application/" target="_blank">Cross Application Tracing</a> and <a title="Thread Profiling: See Exactly What Your App Is Doing" href="http://blog.newrelic.com/2013/04/23/thread-profiling-see-exactly-what-your-app-is-doing/" target="_blank">Thread Profiling</a>.</em></p>
<p>We want New Relic’s Ruby agent to work best with the latest Ruby libraries and implementation. Sure, we still support Ruby 1.8.6 and Rails 2.0, but most people have moved on. And that’s what we focus on.</p>
<p><a title="Ruby!" href="http://blog.newrelic.com/wp-content/uploads/cincyrb_logo.jpg" target="_blank"><img class="alignleft size-full wp-image-11543" title="Ruby!" alt="Ruby!" src="http://blog.newrelic.com/wp-content/uploads/cincyrb_logo.jpg" width="72" height="72" /></a>We were proud to provide Ruby 2.0.0 compatibility from the day it was released, thanks to a <a title="https://github.com/newrelic/rpm/pull/104" href="https://github.com/newrelic/rpm/pull/104" target="_blank">pull request</a> from <a title="github: charliesome" href="https://github.com/charliesome" target="_blank">charliesome</a> in Melbourne, Australia. &#8221;<a title="Ruby 2.0.0-p0 is released" href="http://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/" target="_blank">Ruby 2.0.0 is the first stable release of the Ruby 2.0 series, with many new features and improvements in response to the increasingly diverse and expanding demands for Ruby.</a>&#8221;</p>
<p>We’ve also kept the agent compatible with Rails 4 development, including <a title="rails 4.0.0.beta1" href="https://rubygems.org/gems/rails/versions/4.0.0.beta1" target="_blank">rails 4.0.0.beta1</a>. Rails 4 provides updated versions of the ActiveSupport::Notifications <a title="Rails 4" href="http://blog.newrelic.com/wp-content/uploads/rails.png" target="_blank"><img class="alignright  wp-image-2386" style="margin: 5px;" title="Rails 4" alt="Rails 4" src="http://blog.newrelic.com/wp-content/uploads/rails.png" width="87" height="111" /></a>libraries, which generate a queue of events containing performance timing information. The latest versions of the Ruby agent subscribe to these event streams, allowing us to integrate more seamlessly into the framework and avoid excessive monkey-patching. The highlights for Rails 4 include strong parameters, turbolinks, and Russion doll caching. See the <a title="Rails 4 release notes" href="http://edgeguides.rubyonrails.org/4_0_release_notes.html" target="_blank">Rails 4 release notes</a> for all the coolness.</p>
<p>Not too long ago, our own Jon Guymon released <a title="metriks-reporter-newrelic_rpm" href="https://github.com/newrelic/metriks-reporter-new_relic/blob/master/README.md" target="_blank">metriks-reporter-newrelic_rpm</a> for feeding data from <a title="Metrik's API" href="https://github.com/eric/metriks" target="_blank">Metrik&#8217;s API </a>into New Relic. Metriks is a well thought out open source API for measuring aspects of your Ruby app.</p>
<p>We’ve also been investigating the best way to measure the performance of Rails 4 Ajax features like Turbolinks. Ben Weintraub recently pull requested an additional JavaScript event into the <a href="https://github.com/rails/turbolinks/pull/193#issuecomment-14853695">Turbolinks gem</a>, and we&#8217;ve been experimenting with approaches for monitoring JavaScript and Ajax performance.</p>
<p>See the following for more information on New Relics support for Rails 4 and Ruby 2:</p>
<p style="padding-left: 30px;">* <a title="Come &amp; Get the Latest New Relic Ruby Agent" href="http://blog.newrelic.com/2013/01/17/new-relic-ruby-agent-3-5-5-38-come-and-get-it/" target="_blank">Come &amp; Get the Latest New Relic Ruby Agent</a><br />
* <a title="Ruby Agent Installation Documentation" href="https://newrelic.com/docs/ruby/ruby-agent-installation" target="_blank">Ruby Agent Installation Documentation</a><br />
* <a title="https://github.com/newrelic/rpm/pull/104" href="https://github.com/newrelic/rpm/pull/104" target="_blank">https://github.com/newrelic/rpm/pull/104</a><br />
* <a title="Metrik's API" href="https://github.com/eric/metriks" target="_blank">Metrik&#8217;s API</a></p>
<p>Tune in tomorrow for the next blog post in our RailsConf series!</p>
<p><i>Headed to RailsConf 2013? Stop by our booth to see the New Relic Ruby Agent in action, pick up your free Data Nerd t-shirt and more. You can </i><i>even try New Relic Pro free for 30 days. For more information, go to <a title="Attn. RailsConf attendees: Get New Relic Pro free for 30 days!" href="http://newrelic.com/railsconf" target="_blank">newrelic.com/railsconf</a>.</i></p>
<p>The post <a href="http://blog.newrelic.com/2013/04/24/living-on-the-edge-with-rails-4-ruby-2/">Living on the Edge with Rails 4 &#038; Ruby 2</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.newrelic.com/2013/04/24/living-on-the-edge-with-rails-4-ruby-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thread Profiling: See Exactly What Your App Is Doing</title>
		<link>http://blog.newrelic.com/2013/04/23/thread-profiling-see-exactly-what-your-app-is-doing/</link>
		<comments>http://blog.newrelic.com/2013/04/23/thread-profiling-see-exactly-what-your-app-is-doing/#comments</comments>
		<pubDate>Tue, 23 Apr 2013 17:35:57 +0000</pubDate>
		<dc:creator>Sam Goldstein</dc:creator>
				<category><![CDATA[Company News]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Top Post]]></category>

		<guid isPermaLink="false">http://blog.newrelic.com/?p=12761</guid>
		<description><![CDATA[<p>RailsConf 2013 is right around the corner! And to celebrate, we’re publishing a series of blog post that highlight what’s new and exciting in the world of New Relic’s Ruby support. Don&#8217;t forget to check out yesterday&#8217;s post on Cross Application Tracing. New Relic tries to bubble up the most significant performance data from your [...]</p><p>The post <a href="http://blog.newrelic.com/2013/04/23/thread-profiling-see-exactly-what-your-app-is-doing/">Thread Profiling: See Exactly What Your App Is Doing</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><i><a href="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png"><img class="alignright  wp-image-12756" title="RailsConf 2013 logo" alt="RailsConf 2013 logo" src="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png" width="108" height="108" /></a>RailsConf 2013 is right around the corner! And to celebrate, we’re publishing a series of blog post that highlight what’s new and exciting in the world of New Relic’s Ruby support. Don&#8217;t forget to check out yesterday&#8217;s post on <a title="Cross App Tracing: Time to Break Up that Huge Rails Application?" href="http://blog.newrelic.com/2013/04/22/cross-app-tracing-time-to-break-up-that-huge-rails-application/" target="_blank">Cross Application Tracing</a>.</i></p>
<p>New Relic tries to bubble up the most significant performance data from your apps like database queries and response times. But sometimes you need to deep dive into how your code is executing to solve a problem.</p>
<p>For times like this, the New Relic Ruby agent provides a low overhead sampling profiler that collects call graphs for running production apps. These can be triggered on demand from the New Relic UI.</p>
<p>The Thread Profiler works by spawning a background thread that takes snapshots of other threads’ backtraces at regular intervals. Over time, the profiles builds up a good representation of where your application is spending most of its time down to the method call level. New Relic’s web UI visualizes <a title="Thread Profiles" href="https://newrelic.com/docs/features/thread-profiler" target="_blank">Thread Profiles</a> in an interactive hierarchical tree format, highlighting the ‘hot’ methods where the app is spending the most time.</p>
<p style="text-align: center;"><a title="New Relic Ruby Thread Profile" href="http://blog.newrelic.com/wp-content/uploads/Screen-Shot-2013-04-23-at-9.56.48-AM.png" target="_blank"><img class="aligncenter  wp-image-12766" style="border: 1px solid black;" title="New Relic Ruby Thread Profile" alt="New Relic Ruby Thread Profile" src="http://blog.newrelic.com/wp-content/uploads/Screen-Shot-2013-04-23-at-9.56.48-AM.png" width="525" height="332" /></a></p>
<p>Our own Jason Clark gave a talk on this subject recently at Mountain West RubyConf. His session, <a title="DIY::Thread.profile -- Light-Weight Profiling in Pure Ruby" href="http://lanyrd.com/2013/mwrc/scfxgd/" target="_blank">DIY::Thread.profile &#8212; Light-Weight Profiling in Pure Ruby</a>, described the techniques he used to write this pure Ruby profiler.</p>
<p>For more information on our Thread Profiling feature, see our <a style="font-size: 13px;" title="Thread Profiler" href="https://newrelic.com/docs/features/thread-profiler" target="_blank">Thread Profiler</a> documentation.</p>
<p>Next up: Living on the Edge &#8212; Rails 4 &amp; Ruby 2</p>
<p><i>Headed to RailsConf 2013? Stop by our booth to see the New Relic Ruby Agent in action, pick up your free Data Nerd t-shirt and more. You can even try New Relic Pro free for 30 days. For more information, go to <a href="http://newrelic.com/railsconf">newrelic.com/railsconf</a>.</i></p>
<p>The post <a href="http://blog.newrelic.com/2013/04/23/thread-profiling-see-exactly-what-your-app-is-doing/">Thread Profiling: See Exactly What Your App Is Doing</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.newrelic.com/2013/04/23/thread-profiling-see-exactly-what-your-app-is-doing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross App Tracing: Time to Break Up that Huge Rails Application?</title>
		<link>http://blog.newrelic.com/2013/04/22/cross-app-tracing-time-to-break-up-that-huge-rails-application/</link>
		<comments>http://blog.newrelic.com/2013/04/22/cross-app-tracing-time-to-break-up-that-huge-rails-application/#comments</comments>
		<pubDate>Mon, 22 Apr 2013 21:29:26 +0000</pubDate>
		<dc:creator>Sam Goldstein</dc:creator>
				<category><![CDATA[Company News]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Top Post]]></category>

		<guid isPermaLink="false">http://blog.newrelic.com/?p=12755</guid>
		<description><![CDATA[<p>RailsConf 2013 is right around the corner! And to celebrate, we’re publishing a series of blog post that highlight what’s new and exciting in the world of New Relic’s Ruby support. If you’re a Rails developer, you know that developing a great web app is a straightforward process. While that offers many advantages, some apps [...]</p><p>The post <a href="http://blog.newrelic.com/2013/04/22/cross-app-tracing-time-to-break-up-that-huge-rails-application/">Cross App Tracing: Time to Break Up that Huge Rails Application?</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><i><a href="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png"><img class="alignright  wp-image-12756" title="RailsConf 2013 logo" alt="RailsConf 2013 logo" src="http://blog.newrelic.com/wp-content/uploads/railsconf_logo.png" width="108" height="108" /></a>RailsConf 2013 is right around the corner! And to celebrate, we’re publishing a series of blog post that highlight what’s new and exciting in the world of New Relic’s Ruby support.</i></p>
<p>If you’re a Rails developer, you know that developing a great web app is a straightforward process. While that offers many advantages, some apps grow too large and become hard to manage.</p>
<p>This means you’ve mostly likely had at least one encounter with a <i>huge</i> monolithic Rails application. And breaking up these apps has become a common topic at Ruby conferences this year. At Ruby on Ales, Software Developer Brian Morton explained <a title="Video from Ruby on Ales:  Schedule Keynotes Talks Speakers Automation in Deployment on Hybrid Hosting and Private Cloud Environments -- Where Do We Go From Here? Fletcher Nichol In a world of public and private clouds, API-driven load balancers, and bare metal servers there has never been more choice when building your next scalable killer application. As the complexity of your application's deployment environment increases, the economics of automation start to pay off. In this session we'll discuss the challenges facing complex application deployments, strategies to make development environments mirror production, and how you can manage architectural changes with your application over time. Automate all the things? Let's find out! Building Extractable Libraries in Rails Patrick Robertson The Ruby on Rails developer faces an interesting duality. Their inner Rubyist is driven by a sense of beauty and explores a wide range of ways to solve a problem. The inner Railser is driven by a strong set of conventions and is guided by the Rails Way™. The /lib directory is where these developers meet and end result is a junk drawer of awkward code. In this talk, I go over a few ways to keep this junk drawer problem from happening by adding some conventions I've created from building Rails in anger:  * Treat /lib as a temple (keep /lib in a state to extract to a gem in minutes)  * Avoid autoloading everything in /lib  * Use configuration to hide credentials from your library code  * Isolate your Domain Objects from library concerns through DCI Cache = Cash! Stefan Wintermeyer Snappiness is an important key for any successful webpage. Most companies try to achieve responsive webshops by scaling their hardware big time. But Rails in combination with Nginx, Memcached and Redis is the key to deliver webpages very fast with a minimal amount of hardware. This talk will start with the basics of DHH's russian doll idea but will raise the bar than quite a bit. How can we combine fragment caching, page caching and HTTP caching to deliver personalized webshop pages for logged in users? How much brain can be delegated to Redis or the Webbrowser? Harddrive space is cheap. So use it! You'll get to know how to plan your data structure and where to use Memcached vs. Redis. Include the cache in the beginning of your development and not in the end. To make things a bit more interesting everything is replayed on a Raspberry Pi to show how much difference intelligent caching can make on any hardware. Save big time and get more clients with a faster web application! Changing the wheels on the bus at 80 mph: upgrading to Rails 3 on an active master branch Andrew Bloomgarden and Julian Giuca Long-running branches are painful, but upgrading to Rails 3 requires one if you can't stop development, right? Wrong! At New Relic, we worked on upgrading to Rails 3 on master while letting development continue in Rails 2. We patched Bundler, built a backwards-compatible boot sequence, and punched ActiveScaffold in the face. Other developers, meanwhile, released 1400 commits worth of work without noticing any changes. We’ll talk about what we did, why we did it, and why we think this approach can help developers get over the hurdle into the Rails 3 promised land. Configuration Management Patterns Beau Harrington As your simple Rails app grows into a larger system or set of systems, using simple constants and Yaml files for configuration may no longer suffice. The meaning of 'configuration' expands to include business logic alongside the customary hostnames and timeout intervals; the rate at which configuration changes are required increases; non-engineers begin to require the ability to make configuration changes themselves; different environments require different configurations. This presentation will examine several patterns that can be applied to handle these issues, keeping iteration team high and reducing the burden on your engineering team. We'll create and iterate on a simple game as a case study to illustrate the value of these principles in practice, and also look at a few open source projects that integrate some of these concepts. Topics:  * moving configuration values out of source  * sharing configuration across multiple applications/services  * working with sensitive configuration data (eg API keys)  * dynamically updating configuration without deployments or restarts  * cascading/overlaying configuration values based on environment and context  * running experiments and A/B tests  * change control  * testing and multi-stage deployment of configuration changesets  * allowing non-developers to change configuration values The Constellation Architecture — All the Little Apps Shane Becker My team and I were brought into The Company™ to help them take their One Big Monolithic Rails App™ and turn it into a a handful of smaller Rails apps that all work together… mumble mumble SOA mumble mumble. When I started looking at it, I realized that 4 or 5 apps was only just scratching the surface. Instead of 5 apps, 1 for each product with a multi-tenant database, we've decided on 1 app per client, with NO multi-tenant database. We have a few internal admin apps, then a whole slew of client apps. Each client has an admin app, a deployer app (to deploy the client admin), and n apps per client that are end-user facing. - company admin apps:  - client admin deployer:  - client admin:  - end user site  - end user site  - end user site  - … It's the classic Rails app story. Built in 2007 and piled onto for 6 years. Lotsa of version bumps and upgrades, but never any serious refactor. It's grown and grown. Clients have grown and grown. The technical requirements and cost of operating has grown and grown. By doing this re-architecting we've reduced:  - the technical complexity of each app (each piece of the previous one big app)  - the resource requirements of each app  - the cost of operation …considerably. Oh, and we're doing all PULL (no push) and HTML with microformats as &quot;API output&quot; (no JSON). Those three things (lots of little apps, pull, html) are changing everything for us. Crafting Gems Pat Allan You understand Ruby and Rails, and you've gotten the hang of using other peoples' gems - but what about writing your own? Gems underpin almost every piece of Ruby code we write - and so, being able to craft your own gems is not only incredibly useful, it provides an avenue for code reuse and open source sharing. During this session, Pat will first discuss the ecosystem around gems and the knowledge required to write your own, plus a few tools available to assist with this, and some approaches for how to structure gems that integrate with Rails itself. The workshop will then put this knowledge into practice by building our own gems from scratch. Creating Mountable Engines Patrick Peak With Rails 4.0 killing off the humble plugin, there is never a better time to learn how to create reusable code using Engines. Creating an engine can be as simple as adding a model, or a complex as an entire content management system. Using the Asset Pipeline, even javascript and css files can be packaged and shared, making projects cleaner and more maintainable than ever before. This talk will cover how developers can create their own engines, to add new controllers/models/views, rake tasks and/or generators. It will cover how engines can interact with Rails having their own initializers and middleware. Finally, based on our experiences converting BrowserCMS and its entire module ecosystem to work as mountable engines, this talk will cover how to make engines that are designed to work together, extend each other engine’s behavior and make it easy for developers to upgrade when you release new versions. Data Builds in WhitePages Matt Woodward In this presentation, Matt Woodward will provide an overview of how WhitePages, the leading provider of contact information for people and businesses in the U.S., leverages its massive dataset of more than 200 million US adults and 300 million landline and mobile phone numbers to connect “people” with such personal identifiers as phone numbers (landline &amp; mobile), addresses, and birth dates. Matt will discuss how Ruby and Rails helps WhitePages build and expose its dataset, enabling a better experience for its core constituencies - consumers and businesses. This presentation will also showcase how Ruby has helped WhitePages transform its business model from a company that simply &quot;publishes&quot; data to a company that &quot;builds&quot; data. Finally, Matt will discuss how the improved dataset that Ruby has helped facilitate has strengthened the value proposition behind WhitePages' API, which is the vehicle that the company’s internal developers depend on to power existing products and which external developers can also tap into to support a wide range of interesting use-cases. Ultimately, you’ll learn how you can take advantage of quick and easy access to North America’s most comprehensive set of consumer contact data to build your next big product! Data Storage: NoSQL Toasters and a Cloud of Kitchen Sinks Casey Rosenthal What is the best data storage option for your application? We have an abundance of conventional wisdom when it comes to building applications on top of a relational database in the Ruby world. Building an application on top of a NoSQL database is a different story. I will present a conceptual framework for understanding Access Patterns that jives with properties of databases, then review common NoSQL databases and propose considerations for choosing one over another. I will also review some uncommon NoSQL databases that address common use cases, and suggest that perhaps some of these should be used more often. Most importantly, I will describe the different state of mind that you should have when building applications on top of these NoSQL options, and provide visualization of non-relational concerns like: fault tolerance, availability, consistency, capacity planning, and horizontal vs vertical scaling. Whether or not you choose a NoSQL option for a future project, you won’t look at data storage options in the same way after this presentation. ;-) Datomic, from Ruby, from Rails Yoko Harada Datomic is a new database categorized as NewSQL and was created by Rich Hickey. Everybody knows this big name and thinks of Clojure. It is true Datomic fits well to Clojure programming. However, it is not only for Clojure people.  Absolutely, Rubyists can use it. We have Diametric gem (https://github.com/relevance/diametric). Using Diametric, we can dive into Datomic from Ruby, from Rails. On Diametric, Datomic's entity is an ActiveModel compliant. Diametric supports Rails' scaffolding. Its usage might look like Datamapper or MongoDB. Eventually, Diametric’s API design settled in a bit far from Ruby, Rails style. In another word, it is not ORM-like. Even though the API design may puzzle Rubyists, Diametric chose the one to expose Datomic's intrinsic properties. It is to leverage a good side of Datomic for us. I believe the more Rubyists use Diametric, the more they like it. In my talk, I’ll introduce Diametric gem and how to use it as well as why its API design is good for us. Also, I will cover how Ruby helped to integrate Datomic API in Diametric gem. Delicious Controversy: Docs &amp; Tests Thomas Meeks Self-documenting code is a pipe dream. TDD (or BDD) is not the panacea of testing. In the pursuit of test coverage we've forgotten what really matters: getting things done. Lets talk about putting documentation and testing into their proper place. Tools that ease maintenance, help other developers join a project, and reduce bugs. I'm going to go over lessons learned in writing, maintaining, and introducing new developers to 20,000 lines of code. Specifically, how we are testing, documenting, and refactoring our code to stay sane, make the team happier, and get more done. Describing Your World with Seahorse Trevor Rowe So you've just added a suite of RESTful APIs to your web service. Now you need to generate documentation and build Ruby, Python, and JavaScript clients to consume those new APIs. With so many moving parts, how do you keep your service, documentation and clients in sync? We all know how to describe data using ActiveRecord models. Have you considered using a model to describe your service? A service model provides a number of benefits including: easy to generate API documentation, consistent server side parameter validation, versioned APIs, easy to build clients, and more. It also represents a unified view of your API which helps to keep your code and documentation DRY. But what does a service model look like? For instance, did you know that your APIs can be described using just four parameter types? What if your could express your APIs using a Rails DSL? This talk will introduce Seahorse, a DSL for describing API operations for just about any web service. It provides all of the above functionality, allowing you to describe your service model in a single place with Ruby code. We will demonstrate how to use Seahorse to generate clients, model existing real-world APIs, and even build one of our own. Designing great APIs: Learning from Jony Ive, Orwell, and the Kano Model Jon Dahl APIs are interfaces, just like UIs. But while a website or a mobile app is designed to be used by a consumer, an API has two very specific audiences in mind: other systems, and the programmers who build them. A well-designed API can make or break an application. So how do developers build great APIs? What design principles should be followed? We will discuss these questions based on the work of thinkers in the areas of industrial design, writing, and product design theory. DevOps for the Rubyist Soul John Downey Ruby developers have many great options for simply hosting their web applications. But what happens when your product outgrows Heroku? Managing your own servers can be an intimidating task for the average developer. This session will cover the lessons we've learned at Braintree from building and maintaining our infrastructure. It will cover how we leverage Ruby to automate and control all of our environments. Some specific topics we'll cover: * Orchestrating servers with capistrano  * Using puppet for configuration management  * Our cap and puppet workflow using git  * How vagrant can provide a sane test environment  * Some pitfalls you should avoid Developing Rails Apps in Technical Isolation Jesus Jackson Are you a developer who's stuck behind a firewalled environment? How about a corporate environment with a lot red tape and access issues to get through? Some of us Rails developers don't have the luxury to work in a truly open environment where one can 'gem install rspec' and viola! we have testing. So what do we do about that? How do we use RVM to manage our gemsets and Ruby versions behind these restrictions? What about deployments? Is Capistrano even a viable option? I've been on a successful Rails project for two years that's had to tackle these kinds of questions. In this talk, I'll discuss my solutions to these problems so your project can be effective and efficient without any sacrifices. I'll discuss how to install and manage RVM in firewalled environments, use Capistrano for remote deployments, how to test your email notifications when your SMTP server is locked down, how to use Git when no Git hosting is available, and plenty of other topics. Dissecting Ruby with Ruby Richard Schneeman Underneath the beautiful veneer of our Ruby libraries lies a twisted tangle of writhing guts. Maybe you're curious how the pieces fit together or maybe you're tracking down a bug, either way it's easy to get lost in the blood and bile that ties our code together. In this talk you'll learn how to use simple and sharp Ruby tools to slice into large libraries with surgical precision. We'll do some live hacking on Rails on the stage and cover useful code probing techniques. Turn your impossible bugs into pull requests, and level up your programming skills by Dissecting Ruby with Ruby. Engine Yard Cloud Edward Chiu New developments, interesting use cases and future plans. Edward will walk attendees through the dashboard and demonstrate the uses of new features such as Engine Yard Local. Whether you're a long-time Engine Yard user or just curious, this session will show you how to optimize your deployment experience. Firefighting on Rails Ethan Vizitei It's always inspiring to me to hear about how the technology stack I'm familiar with has been used to solve interesting problems; this is one of the extreme versions of that experience. Over the last few years, Rails has been used to solve several of the logistical pain points of the third largest fire service organization in the state of Missouri, and in this talk we're going to look at how it happened. Along the way we'll look at some of the challenges of working with such an out-of-the-ordinary organization and how Rails fit into addressing some fairly unique requirements and constraints. This is one Rails-in-the-wild case study that you won't want to pass up. Flattening The Cloud Learning Curve Using Rails Michael Murphy We've all heard how great the cloud is - but no one likes learning a new proprietary API if they don't need to. In this session, I'll demonstrate how you can develop, test and deploy ROR apps faster to HP's public cloud based on OpenStack technology. If you are new to the cloud or if you're just a CLI commando, I'll run through HP's Ruby CLI, spin up cloud servers and attach block storage faster than you thought possible. And, for Ruby Fog fans, I'll show you the HP Ruby Fog extensions that let you easily provision and manage cloud servers and storage using your favorite environment. Forget Scaling: Focus on Performance Terence Lee Your customers care about how fast your application works, you should too.... At Heroku we see millions of apps deploy and we know what it takes to get serious performance out of your code and Rails. In this talk we'll cover backend tips and frontend tricks that will help your Rails app go faster than ever before. From Rails to the Web Server to the Browser David Padilla Most of us know how to build beautiful web applications with Rails. With the help of templating tools like ERB and HAML our web apps create HTML documents, but, do you know exactly how those HTML documents end up in a browser? During this talk I will show you the bits that make it all happen. We will dissect the relevant code within Rails, Rack and the thin web server to discover exactly how the web server starts and listens to a TCP port, communicates with Rails and returns the HTML document that your browser parses. Why? Because we're curious about it, that's why. Front-end Testing for Skeptics Luke Francl Paul Graham once quipped that &quot;Web 2.0&quot; really meant &quot;JavaScript now works&quot;. Nearly ten years later, more and more functionality of our web applications is written in JavaScript. But for those of us who came of age when JavaScript was unreliable, it's been preferable to test the server-side, while leaving the UI a thin-as-possible shell. Testing the front-end was error prone and brittle. However, when you're delivering a JavaScript widget hundreds of thousands of times a day on diverse third party websites, it needs to work. So: we need to test it, and those tests need to be as painless as possible to write and maintain. This is a session for front-end testing skeptics (like me): It is possible to create tests that drive your web UI (JavaScript and all) that are automated, fast, reliable, headless -- no browser required -- and written in pure Ruby instead of some obtuse syntax. We'll explore the challenges and gotchas of testing the front-end and walk through an example that meets the above goals. Hacking the academic experience Emily Stolfo Coming from a hacker background, I’ve continually been surprised by how frequently new grads lacked the skills needed, particularly in community learning. When I was asked to teach Ruby on Rails at Columbia University I observed that a significant number of the skills required to become successful professionals in the industry are acquired on the job and aren’t being taught in school. This presentation will review:  - Lessons learned from the experience teaching in my alma mater’s CS program.  - How I developed a hacker-centric curriculum teaching not only the algorithms, but the keys to being a successful developer in the modern open source driven Rails community.  - How we as hackers can fix this. How Shopify Scales Rails John Duff Tobias Lutke wrote the first line of code for Shopify nearly 10 years ago to power his own Snowboard shop. Two years later Shopify launched to the public on a single webserver using Rails 0.13.1. Today Shopify powers over 40k online stores and processes up to half a million product sales per day across the platform. Over 30 people actively work on Shopify which makes it the longest developed and likely largest Rails code base out there. This is the story of how Shopify has evolved to handle its immense growth over the years. This is what getting big is all about: evolving to meet the needs of your customers. You don't start out with a system and infrastructure that can handle a billion dollar in GMV. You evolve to it. You evolve by adding caching layers, hardware, queuing systems and splitting your application to services. This is the story of how we have tackled the various scaling pain points that Shopify has hit and what we have done to surpass them, what we are doing to go even further. How a Request Becomes a Response Christopher Green &amp; Aimee Simone Ever wondered what Rails is doing behind the scenes? What happens to an HTTP request after it leaves your browser? How does Rails process the response? In this beginner talk, Aimee Simone and Christopher Green break down the request/response cycle of a web application, navigating through the magestic internals of Rails. We'll outline the responsibilities of each Rails component, including its MVC framework and RESTful routing concepts. By following the flow from a client HTTP request to a completed server response, you'll gain a better understanding of the anatomy of a Rails application. How to Talk to Developers Ben Orenstein Nearly every developer will be asked to present to his or her peers at some point. Those that do it well will tend to have an outsized influence on their team, company, and community. This talk will demonstrate (mostly by example) the straightforward techniques for giving excellent presentations, from a veteran conference speaker and teacher. Topics to cover include:  * Phrases that turn your audience against you.  * Basic body language tips that affect perception.  * How to be more interesting than the internet.  * The power of live coding and demos.  * Being funny without resorting to reddit memes.  * How to get plenty of questions during Q&amp;A.  * How to get an unfair amount of talk acceptances (aka 'Bribing conference organizers'). How to Write Documentation for People That Don't Read Kevin Burke Usability researchers have known for years that people browsing the Internet  don't read things word by word - they scan pages for the content they want. Yet  many API's and documentation resources are written as though users are reading  every word. If busy users can't find what they are looking for, you'll have  more support tickets (an expense), or more frustration (lost revenue). Writing effective documentation requires knowing who your users are and how  they are finding answers to their questions. In this presentation, we'll  examine practical techniques to make your documentation work for busy users.  Looking at examples and user testing from our experience at Twilio, attendees will learn: - how users find (or fail to find) your documentation  - how users view and get started (or fail to get started) with your product  - how to take advantage of underused documentation tools like your error messages, your API, and SEO. Humanity On Rails Daniel Azuma We hear the stories every so often. A study concludes that internet usage is making us &quot;dumber&quot;, while another connects online activity to anxiety or depression. A respected journalist questions whether our advanced technology is really improving our lives. A mass movement of people deleting their Facebook or Twitter accounts sweeps through the community. As developers, we hear these stories, and we shrug. Luddites and fearmongers, we call them. But don't they have a point? Do we truly understand what technology is, and how it impacts our society, the way we think and what we value? An important conversation is taking place. As Rails developers, as professionals working on the cutting edge of consumer technology, we should be involved. This talk is a brief introduction to the philosophy of technology. We'll examine a few of the major views-- the writings of the philosophers, academics, and engineers who are asking questions regarding technology and society. We'll also explore what these questions mean for us as developers, what they can tell us about our profession, and what we can uniquely contribute to the conversation. We may not find a lot of solid answers, but we'll plow a rich field for discussion, and maybe gain a new perspective into just what it is that we spend our time doing. Incremental Design - A conversation with a designer and a developer. Rebecca Miller-Webster and Savannah Wolf Developers: how many times have you had to completely rip out your hard earned code for a totally new site design?  Designers: how many times has a re-design taken 4 times as long as the developer said it would and not looked good in the end? Change all that by using an incremental approach to design. Set up your code to change all the buttons at once or prioritize design changes to make each small change good enough for production. A designer and developer will talk about the challenges and joys of making this process work in two production sites. Topics covered:  * What is incremental design?  * How to design with incremental changes in mind  * How to develop for incremental design, including utilizing SASS, structuring your mark-up and CSS, and structuring your Rails views and partials An Intervention for ActiveRecord Ernie Miller Let's be honest: ActiveRecord's got issues, and it's not going to deal with them on its own. It needs our help. Don't think so? Let's take a closer look together. We'll examine the myriad of perils and pitfalls that await newbie and veteran alike, ranging from intentionally inconsistent behavior to subtle oddities arising from implementation details. Of course, as with any intervention, we're only doing this because we care. At the very least, you'll learn something you didn't know about ActiveRecord, that helps you avoid these gotchas in your applications. But I hope that you'll leave inspired to contribute to ActiveRecord, engage in discussion about its direction with the core team, and therefore improve the lives of your fellow Rails developers. WARNING: We will be reading the ActiveRecord code in this talk. Not for the faint of heart. Introducing Brainstem, your companion for rich Rails APIs Andrew Cantino This talk will introduce Brainstem, a new Rails library for easily presenting and versioning complex ActiveRecord model relationships through your JSON API. Allow your internal or external API consumers to eager-load model associations, request custom scopes and sorts, load multiple objects by ID simultaneously, and generate JSON that uses references instead of repeating data. While your Brainstem API can be consumed by any JSON client, it will truly shine when using the included Backbone integration, adding relationship-aware models, centralized data loading, and a smart caching identity map to your Backbone applications. All of this is designed to reduce network requests and simplify development of HTML5 applications, especially mobile ones. With Backbone + Brainstem, loading a hierarchy of objects from your server can be reduced to one line of code and one network request. This talk will survey Brainstem usage in Rails, then dive into how it can enable rich mobile HTML5 applications. Keeping the lights on: Application monitoring with Sensu and BatsD Aaron Pfeifer The good news: you're quickly signing up new customers, you've scaled your Rails app to a growing cluster of 10+ servers, and the business is really starting to take off. Great! The bad news: Just 30m of failures is starting to be measured in hundreds or even thousands of dollars. Who's going to make sure the lights stay on when your app is starting to fall over? Or worse, what if your app is up, but sign-ups, payments, or some other critical function is broken?   Learn how you can build a robust monitoring infrastructure using the Sensu platform: track business metrics in all of your applications, any system metric on your servers, and do so all with the help of BatsD - a time series data store for real-time needs. We'll also talk about how to look at trending data and how you can integrate Sensu against PagerDuty, RabbitMQ, or any other third-party service. Oh, and of course - everything's written in Ruby, so you can even use your favorite gems! The Long Ball - Upgrading long lived Rails apps from 1.x-4.0 Jesse Wolgamott Explore tips to upgrade from each major version to the other, and how to efficiently tackle a 1.2 -&gt; 4.0 upgrade through two different case studies. The velocity of change for Rails versions has a side effect -- businesses hesitate to update to the latest version until their productivity drops and they're forced to update. What happens then? Let's explore a case study of a Rails app that followed this pattern. The Magic Tricks of Testing Sandi Metz Tests are supposed to save us money. How is it, then, that many times they become millstones around our necks, gradually morphing into fragile, breakable things that raise the cost of change? We write too many tests and we test the wrong kinds of things. This talk strips away the veil and offers simple, practical guidelines for choosing what to test and how to test it. Finding the right testing balance isn't magic, it's a magic trick; come and learn the secret of writing stable tests that protect your application at the lowest possible cost. Maintainable Templates Brendan Loudermilk Unwieldy templates (a.k.a. views) are all too common in Rails apps, even among teams that otherwise craft high-quality code. Being brought into or having to maintain a project with poorly-crafted templates leads to extreme frustration and less than-adequite-velocity. At philosophie, we have started to use a few simple patterns that result in templates that are easier to maintain. By investing a small amount of time up-front learning and applying these patterns we have saved countless hours in the long run. Topics include:  * The Decorator Pattern  * Using View objects  * Sanely building forms  * And more! Make Your Application Snappier With Asynchronous Workers Dave Kapp Sometimes, your application has to do something that is slow. Maybe you need to do some serious data crunching, maybe you need to call a slow third-party API, maybe you need to run a bunch of external processes. Trying to do these from within Rails is just asking for performance problems, as you'll be dragging your response times down significantly. But by using asynchronous workers, you can offload the work and let Rails stay nice and responsive. There are a lot of choices and architectural concerns that come in whenever you're adding another piece to your application, and we'll address those decisions along with the actual code you'll need. We'll start with an overview of what exactly an asynchronous worker is (and how it's different from some similar things), what some of the different worker queues available are, and how you can maximize code reuse within your workers. Of course, we'll also take a look at code samples that will illustrate how simple things can be once you have all the pieces talking to each other correctly. Examples will be given using Resque, an open-source asynchronous worker queue that uses Redis as the storage backend, but the ideas and patterns discussed will be applicable to other worker queues. Monitoring the Health of Your App Carl Lerche and Yehuda Katz Your app is your business, so keeping it healthy is important. Unfortunately, most of the tools available today are more like your doctor verifying the fact that you've had a heart attack—after it's happened. You can do better. In this session, you'll learn how to use metrics to be more proactive about monitoring your applications health, and to suss out the subtle but important warning signs that can help you prioritize developer time and improve the developer experience. We'll talk about how to instrument your code, what to measure, how to interpret the data, as well as how you can use the data to streamline your development process. Natural Language Processing with Ruby Brandon Black The field of natural language processing and the many topics encompassed within it (summarization, full-text search, sentiment analysis, content categorization, etc.) is one of fastest growing, most complex and most highly demanded knowledge sets in the software industry today. From spell checking in your SMS client to programmatically evaluating what your Twitter followers think of you, there is no shortage of real-world text processing and linguistic analysis problems all around us waiting to be solved. As Rubyists and software engineers, its important for us to know what tools related to NLP are available to us and how we can make use of them most effectively.   While there are a number of really great open-source libraries for natural language processing in Ruby and many great strides have been made in recent years, there’s still often a need to leverage tools and libraries externally from the Ruby ecosystem. Some of the best open-source NLP frameworks available rely very heavily on contributions from the academic world where Ruby as a language doesn’t have the same presence as other languages like Python or Java. In this talk, I’ll provide a beginner friendly introduction to NLP in general and I’ll give a quick overview of the tools and related projects that are currently available in the Ruby community. In addition, using real-world examples I’ll demonstrate how to painlessly leverage high performance, mature and well-established NLP libraries directly from your Ruby application using JRuby and JDK 7. New Relic Performance Code Kata Sam Goldstein and Ben Weintraub Code Kata is a term coined by Dave Thomas, co-author of the book The Pragmatic Programmer, in a nod to the Japanese concept of kata in the martial arts. A code kata is an exercise in programming which helps a programmer hone their skills through practice and repetition. The goal of this Kata is to get your mind wired into performance driven development. We'll explore, diagnose, and fix a variety of performance problems to reinforce your skills as a user of New Relic. No Traffic, No Users, No Problem! - Usability Testing for New Apps Jim Jones Building a web app consists of stressful choices. Should the signup button be red or blue? Does my site's sales pitch sound awkward? What will the user think about my site the first five seconds they visit? Using Rails and Amazon's Mechanical Turk service, I will show you how you can perform usability tests, A/B testing and gain valuable feedback on your site BEFORE launching your app to a single real user. I'll walk you through : 1) Sample code for quickly integrating your Rails site with Mechanical Turk 2) How to structure your HITs (Human Intelligence Tasks) so that you solicit detailed feedback from the workers. 3) Integrating A/B testing so that you can quickly decide which design component is better 4) Tactics for stopping automated bots from ruining your usability tests Nobody will Train You but You Zach Briggs Why do we all know a developer who has been pounding out unmaintainable code for a decade or more? Why do people &quot;believe in TDD but I don't have time to write tests during crunch?&quot; How is it that we have an entire industry based around rescuing teams from acutely awful Rails apps? It's because on the job experience is a poor teacher; plateauing as soon as the developer is able to ship code that meets requirements. Schools teach Computer Science which is only tangentially related to being a developer and most kata's are approached incorrectly, giving no value at best, and reinforcing poor practices at worst. On top of all this, our pairs (for the lucky ones who pair program) probably have not shown us anything new in months. This presentation will give specific, concrete steps on how to slowly and steadily improve our game through practice and hard work. I'll identify what skill Rails developers should be focusing on and walk the audience through how to target and eliminate these weaknesses so that nothing but white hot joy streams out of our fingers and into our apps. There's no magic here, no secrets, and no hacks; just you and me working our butts off until we suck a little less. Object-Oriented Lessons for a Service-Oriented World Chris Kelly The dreams of developers working on monolithic Rails applications are frequently filled with sugar plums and service-oriented architectures--but like any kind of software design, SOA can easily become a tangled mess. Many of the same principles that guide our software design can guide our architecture design. We apply SOLID principles to applications to keep them loosely coupled, we design interfaces so we can send logical messages to our domain objects. We hide our databases behind abstractions because how we access our data shouldn't matter to how we consume it. Rarely, though, do we see the same practices applied to our services and APIs, leaving us with tightly coupled and difficult to extend service-oriented architectures. If you are facing the monorail to SOA challenge, consider looking at your services as objects and your APIs as messages. Service-oriented applications are complex, and the best way to fend off complexity is though object-oriented design. Of Buyers And Renters and keeping a roof over our heads Sebastian Delmont What do home ownership and leveraged buyouts can teach us about how to use technical debt to our advantage? How can we sleep soundly at night when we have accumulated mountains and mountains of technical debt? When is good enough good enough and when are we just deceiving ourselves? Postgres, the Best Tool You're Already Using Adam Sanderson Your fledgling social network for hedgehogs is starting to gain traction, but now new feature requests are pouring in. How you can you meet the demands of an ambitious product team within your existing stack? There’s no time to waste, so we will look at how to leverage the venerable Postgres workhorse. We will look at some of Postgres' unique features that lend themselves to solving the problems Rails developers face when moving from v1 products to v2 and beyond. We will focus on SQL and ActiveRecord, and talk about pragmatic solutions to hairy problems. Get practical, hands-on advice about using Postgres with ActiveRecord to support tagging, model hierarchical data, store arbitrary metadata, and add full text search to your application. By the end of this talk, you’ll be able to go to your next meeting armed with confidence in your ability to build the ultimate hedgehog destination online. Properly Factored MVC in Rails Applications Katrina Owen &amp; Jeff Casimir Starting Rails applications is one thing, but how you apply the priciples of MVC as an application grows determine whether your application is modular and maintainable or a convoluted mess. In this session, we'll use an existing application to explore and practice some of the common mistakes, correct techniques, and concepts behind the techniques to improve your development patterns. Pry — The Good Parts! Conrad Irwin Pry is the featureful development console for Ruby. From its humble roots as an irb replacement, Pry has grown into an indispensable tool for any Ruby or Rails programmer. Using some real-life examples, I'll explain how to use Pry effectively. We'll start from the beginning, with simple features for exploring libraries and source-code in glorious technicolor. Then we'll move up a level and discuss how to inspect, debug and even modify a program while it is still running. Finally we'll touch on some of Pry's more advanced plugins that can really help you get a feel for what your code is doing. Rails Vs. The Client Side Noel Rappin Two completely different ways have emerged for using Rails as the back end to a rich client-side JavaScript application. * The 37Signals &quot;Russian Doll&quot; approach, where the server generally returns HTML to the client. This approach uses aggressive caching and a little bit of JavaScript glue to keep the application fast.  * The &quot;Rails API&quot; approach, where the server generally returns JSON to the client, and a JavaScript MVC framework handles the actual display. Which of these will work for you? We will look at code to see the structural difference between these two approaches and see what the speed, extensibility, and maintainability trade-offs are. At the end of the talk, you will be better equipped to chose a structure for your next rich-client application. Rails is Just Ruby Jesse Wolgamott Rails: the result of magical incantations, voodoo, and wizardry? Or: a collection of patterns from the most awesomest language in the world (Ruby)? We'll show three different areas of Rails that seem to be the most magical: before_filters and callbacks, Procs, and inheritance. In the workshop, participants will create their own Ruby object implementing these magical powers. Rails' Insecure Defaults Bryan Helmkamp Out of the box, Rails provides facilities for preventing attacks like SQL injection, cross-site scripting (XSS), cross-site request forgery (CSRF), and more. As a result, it's considered one of the most secure web application frameworks available. Digging deeper, however, you can find a number of places where Rails' default behavior is not as secure as it could be. This talk will focus on longstanding, known weak spots that create risks for your application and business if you are not aware of them. Real-Time Rails Brian Cardarella The future is real time! With the Rails 4.0 Live Streaming API we finally have the ability to easily add real time functionality to our apps. Learn all about the live streaming API, how best to take advantage of this in the browser, and how to deploy a real-time ready Rails app. Get ready to open your apps to a whole new world of interaction and functionality. Topics we will cover: * Live Streaming API  * EventMachine vs Rails 4.0  * Node.js vs Rails 4.0  * Polling vs Live Streaming  * Websockets &amp; Rails 4.0  * Puma Ruby Libraries Important for Rails Michael Hartl This talk+workshop highlights some Ruby libraries that are particularly useful when developing Rails applications. In the talk portion, we'll give an overview of some specific classes and modules, and then in the workshop we'll break into groups to dive deeper into libraries of each participant's choice, with a focus on developing the skills needed to read and understand the Ruby documentation. Time and interest permitting, we'll incorporate test-driven development into our investigations. Ruby on RESS Marty Resnick In the Mobile Web space, there has been a lot of discussion about Responsive Web Design. However, RWD has its limitations and may requires server-side intervention. This is where RESS comes in. With a Responsive Web + Server-Side solution, issues of performance, page weight and responsive images could all be addressed. Ruby on Rails has proven to be a perfect server-side solution in a RESS solution, and this discussion will review a hands-on approach to implementing RESS along with some real-world case studies. Schemas for the Real World Carina C. Zona Social app development challenges us to code for users’ personal world. Users are giving push-back to ill-fitted assumptions about their own identity — name, gender, sexual orientation, important relationships, and many other attributes that are individually meaningful. How can we balance users’ realities with an app’s business requirements? Facebook, Google+, and others are struggling with these questions. Resilient approaches arise from an app’s own foundation. Discover how our earliest choices influence codebase, UX, and development itself. Learn how we can use that knowledge to both inspire the people who use our apps, and to generate the data that need as developers. Security is hard, but we can’t go shopping André Arko The last few months have been pretty brutal for anyone who depends on Ruby libraries in production. Ruby is really popular now, and that’s exciting! But it also means that we are now square in the crosshairs of security researchers, whether whitehat, blackhat, or some other hat. Only the Ruby and Rails core teams have meaningful experience with vulnerabilites so far. It won’t last. Vulnerabilities are everywhere, and handling security issues responsibly is critical if we want Ruby (and Rubyists) to stay in high demand. Using Bundler’s first CVE as a case study, I’ll discuss responsible disclosure, as well as repsonsible ownership of your own code. How do you know if a bug is a security issue, and how do you report it without tipping off someone malicious? As a Rubyist, you probably have at least one library of your own. How do you handle security issues, and fix them without compromising apps running on the old code? Don’t let your site get hacked, or worse yet, let your project allow someone else’s site to get hacked! Learn from the hard-won wisdom of the security community so that we won’t repeat the mistakes of others. Services and Rails: The Sh*t They Don't Tell You" href="http://www.confreaks.com/videos/2299-bigruby2013-services-and-rails-the-shit-they-don-t-tell-you" target="_blank">how Yammer breaks applications into services</a>. (He’ll be <a title=" Schedule Keynotes Talks Speakers Automation in Deployment on Hybrid Hosting and Private Cloud Environments -- Where Do We Go From Here? Fletcher Nichol In a world of public and private clouds, API-driven load balancers, and bare metal servers there has never been more choice when building your next scalable killer application. As the complexity of your application's deployment environment increases, the economics of automation start to pay off. In this session we'll discuss the challenges facing complex application deployments, strategies to make development environments mirror production, and how you can manage architectural changes with your application over time. Automate all the things? Let's find out! Building Extractable Libraries in Rails Patrick Robertson The Ruby on Rails developer faces an interesting duality. Their inner Rubyist is driven by a sense of beauty and explores a wide range of ways to solve a problem. The inner Railser is driven by a strong set of conventions and is guided by the Rails Way™. The /lib directory is where these developers meet and end result is a junk drawer of awkward code. In this talk, I go over a few ways to keep this junk drawer problem from happening by adding some conventions I've created from building Rails in anger:  * Treat /lib as a temple (keep /lib in a state to extract to a gem in minutes)  * Avoid autoloading everything in /lib  * Use configuration to hide credentials from your library code  * Isolate your Domain Objects from library concerns through DCI Cache = Cash! Stefan Wintermeyer Snappiness is an important key for any successful webpage. Most companies try to achieve responsive webshops by scaling their hardware big time. But Rails in combination with Nginx, Memcached and Redis is the key to deliver webpages very fast with a minimal amount of hardware. This talk will start with the basics of DHH's russian doll idea but will raise the bar than quite a bit. How can we combine fragment caching, page caching and HTTP caching to deliver personalized webshop pages for logged in users? How much brain can be delegated to Redis or the Webbrowser? Harddrive space is cheap. So use it! You'll get to know how to plan your data structure and where to use Memcached vs. Redis. Include the cache in the beginning of your development and not in the end. To make things a bit more interesting everything is replayed on a Raspberry Pi to show how much difference intelligent caching can make on any hardware. Save big time and get more clients with a faster web application! Changing the wheels on the bus at 80 mph: upgrading to Rails 3 on an active master branch Andrew Bloomgarden and Julian Giuca Long-running branches are painful, but upgrading to Rails 3 requires one if you can't stop development, right? Wrong! At New Relic, we worked on upgrading to Rails 3 on master while letting development continue in Rails 2. We patched Bundler, built a backwards-compatible boot sequence, and punched ActiveScaffold in the face. Other developers, meanwhile, released 1400 commits worth of work without noticing any changes. We’ll talk about what we did, why we did it, and why we think this approach can help developers get over the hurdle into the Rails 3 promised land. Configuration Management Patterns Beau Harrington As your simple Rails app grows into a larger system or set of systems, using simple constants and Yaml files for configuration may no longer suffice. The meaning of 'configuration' expands to include business logic alongside the customary hostnames and timeout intervals; the rate at which configuration changes are required increases; non-engineers begin to require the ability to make configuration changes themselves; different environments require different configurations. This presentation will examine several patterns that can be applied to handle these issues, keeping iteration team high and reducing the burden on your engineering team. We'll create and iterate on a simple game as a case study to illustrate the value of these principles in practice, and also look at a few open source projects that integrate some of these concepts. Topics:  * moving configuration values out of source  * sharing configuration across multiple applications/services  * working with sensitive configuration data (eg API keys)  * dynamically updating configuration without deployments or restarts  * cascading/overlaying configuration values based on environment and context  * running experiments and A/B tests  * change control  * testing and multi-stage deployment of configuration changesets  * allowing non-developers to change configuration values The Constellation Architecture — All the Little Apps Shane Becker My team and I were brought into The Company™ to help them take their One Big Monolithic Rails App™ and turn it into a a handful of smaller Rails apps that all work together… mumble mumble SOA mumble mumble. When I started looking at it, I realized that 4 or 5 apps was only just scratching the surface. Instead of 5 apps, 1 for each product with a multi-tenant database, we've decided on 1 app per client, with NO multi-tenant database. We have a few internal admin apps, then a whole slew of client apps. Each client has an admin app, a deployer app (to deploy the client admin), and n apps per client that are end-user facing. - company admin apps:  - client admin deployer:  - client admin:  - end user site  - end user site  - end user site  - … It's the classic Rails app story. Built in 2007 and piled onto for 6 years. Lotsa of version bumps and upgrades, but never any serious refactor. It's grown and grown. Clients have grown and grown. The technical requirements and cost of operating has grown and grown. By doing this re-architecting we've reduced:  - the technical complexity of each app (each piece of the previous one big app)  - the resource requirements of each app  - the cost of operation …considerably. Oh, and we're doing all PULL (no push) and HTML with microformats as &quot;API output&quot; (no JSON). Those three things (lots of little apps, pull, html) are changing everything for us. Crafting Gems Pat Allan You understand Ruby and Rails, and you've gotten the hang of using other peoples' gems - but what about writing your own? Gems underpin almost every piece of Ruby code we write - and so, being able to craft your own gems is not only incredibly useful, it provides an avenue for code reuse and open source sharing. During this session, Pat will first discuss the ecosystem around gems and the knowledge required to write your own, plus a few tools available to assist with this, and some approaches for how to structure gems that integrate with Rails itself. The workshop will then put this knowledge into practice by building our own gems from scratch. Creating Mountable Engines Patrick Peak With Rails 4.0 killing off the humble plugin, there is never a better time to learn how to create reusable code using Engines. Creating an engine can be as simple as adding a model, or a complex as an entire content management system. Using the Asset Pipeline, even javascript and css files can be packaged and shared, making projects cleaner and more maintainable than ever before. This talk will cover how developers can create their own engines, to add new controllers/models/views, rake tasks and/or generators. It will cover how engines can interact with Rails having their own initializers and middleware. Finally, based on our experiences converting BrowserCMS and its entire module ecosystem to work as mountable engines, this talk will cover how to make engines that are designed to work together, extend each other engine’s behavior and make it easy for developers to upgrade when you release new versions. Data Builds in WhitePages Matt Woodward In this presentation, Matt Woodward will provide an overview of how WhitePages, the leading provider of contact information for people and businesses in the U.S., leverages its massive dataset of more than 200 million US adults and 300 million landline and mobile phone numbers to connect “people” with such personal identifiers as phone numbers (landline &amp; mobile), addresses, and birth dates. Matt will discuss how Ruby and Rails helps WhitePages build and expose its dataset, enabling a better experience for its core constituencies - consumers and businesses. This presentation will also showcase how Ruby has helped WhitePages transform its business model from a company that simply &quot;publishes&quot; data to a company that &quot;builds&quot; data. Finally, Matt will discuss how the improved dataset that Ruby has helped facilitate has strengthened the value proposition behind WhitePages' API, which is the vehicle that the company’s internal developers depend on to power existing products and which external developers can also tap into to support a wide range of interesting use-cases. Ultimately, you’ll learn how you can take advantage of quick and easy access to North America’s most comprehensive set of consumer contact data to build your next big product! Data Storage: NoSQL Toasters and a Cloud of Kitchen Sinks Casey Rosenthal What is the best data storage option for your application? We have an abundance of conventional wisdom when it comes to building applications on top of a relational database in the Ruby world. Building an application on top of a NoSQL database is a different story. I will present a conceptual framework for understanding Access Patterns that jives with properties of databases, then review common NoSQL databases and propose considerations for choosing one over another. I will also review some uncommon NoSQL databases that address common use cases, and suggest that perhaps some of these should be used more often. Most importantly, I will describe the different state of mind that you should have when building applications on top of these NoSQL options, and provide visualization of non-relational concerns like: fault tolerance, availability, consistency, capacity planning, and horizontal vs vertical scaling. Whether or not you choose a NoSQL option for a future project, you won’t look at data storage options in the same way after this presentation. ;-) Datomic, from Ruby, from Rails Yoko Harada Datomic is a new database categorized as NewSQL and was created by Rich Hickey. Everybody knows this big name and thinks of Clojure. It is true Datomic fits well to Clojure programming. However, it is not only for Clojure people.  Absolutely, Rubyists can use it. We have Diametric gem (https://github.com/relevance/diametric). Using Diametric, we can dive into Datomic from Ruby, from Rails. On Diametric, Datomic's entity is an ActiveModel compliant. Diametric supports Rails' scaffolding. Its usage might look like Datamapper or MongoDB. Eventually, Diametric’s API design settled in a bit far from Ruby, Rails style. In another word, it is not ORM-like. Even though the API design may puzzle Rubyists, Diametric chose the one to expose Datomic's intrinsic properties. It is to leverage a good side of Datomic for us. I believe the more Rubyists use Diametric, the more they like it. In my talk, I’ll introduce Diametric gem and how to use it as well as why its API design is good for us. Also, I will cover how Ruby helped to integrate Datomic API in Diametric gem. Delicious Controversy: Docs &amp; Tests Thomas Meeks Self-documenting code is a pipe dream. TDD (or BDD) is not the panacea of testing. In the pursuit of test coverage we've forgotten what really matters: getting things done. Lets talk about putting documentation and testing into their proper place. Tools that ease maintenance, help other developers join a project, and reduce bugs. I'm going to go over lessons learned in writing, maintaining, and introducing new developers to 20,000 lines of code. Specifically, how we are testing, documenting, and refactoring our code to stay sane, make the team happier, and get more done. Describing Your World with Seahorse Trevor Rowe So you've just added a suite of RESTful APIs to your web service. Now you need to generate documentation and build Ruby, Python, and JavaScript clients to consume those new APIs. With so many moving parts, how do you keep your service, documentation and clients in sync? We all know how to describe data using ActiveRecord models. Have you considered using a model to describe your service? A service model provides a number of benefits including: easy to generate API documentation, consistent server side parameter validation, versioned APIs, easy to build clients, and more. It also represents a unified view of your API which helps to keep your code and documentation DRY. But what does a service model look like? For instance, did you know that your APIs can be described using just four parameter types? What if your could express your APIs using a Rails DSL? This talk will introduce Seahorse, a DSL for describing API operations for just about any web service. It provides all of the above functionality, allowing you to describe your service model in a single place with Ruby code. We will demonstrate how to use Seahorse to generate clients, model existing real-world APIs, and even build one of our own. Designing great APIs: Learning from Jony Ive, Orwell, and the Kano Model Jon Dahl APIs are interfaces, just like UIs. But while a website or a mobile app is designed to be used by a consumer, an API has two very specific audiences in mind: other systems, and the programmers who build them. A well-designed API can make or break an application. So how do developers build great APIs? What design principles should be followed? We will discuss these questions based on the work of thinkers in the areas of industrial design, writing, and product design theory. DevOps for the Rubyist Soul John Downey Ruby developers have many great options for simply hosting their web applications. But what happens when your product outgrows Heroku? Managing your own servers can be an intimidating task for the average developer. This session will cover the lessons we've learned at Braintree from building and maintaining our infrastructure. It will cover how we leverage Ruby to automate and control all of our environments. Some specific topics we'll cover: * Orchestrating servers with capistrano  * Using puppet for configuration management  * Our cap and puppet workflow using git  * How vagrant can provide a sane test environment  * Some pitfalls you should avoid Developing Rails Apps in Technical Isolation Jesus Jackson Are you a developer who's stuck behind a firewalled environment? How about a corporate environment with a lot red tape and access issues to get through? Some of us Rails developers don't have the luxury to work in a truly open environment where one can 'gem install rspec' and viola! we have testing. So what do we do about that? How do we use RVM to manage our gemsets and Ruby versions behind these restrictions? What about deployments? Is Capistrano even a viable option? I've been on a successful Rails project for two years that's had to tackle these kinds of questions. In this talk, I'll discuss my solutions to these problems so your project can be effective and efficient without any sacrifices. I'll discuss how to install and manage RVM in firewalled environments, use Capistrano for remote deployments, how to test your email notifications when your SMTP server is locked down, how to use Git when no Git hosting is available, and plenty of other topics. Dissecting Ruby with Ruby Richard Schneeman Underneath the beautiful veneer of our Ruby libraries lies a twisted tangle of writhing guts. Maybe you're curious how the pieces fit together or maybe you're tracking down a bug, either way it's easy to get lost in the blood and bile that ties our code together. In this talk you'll learn how to use simple and sharp Ruby tools to slice into large libraries with surgical precision. We'll do some live hacking on Rails on the stage and cover useful code probing techniques. Turn your impossible bugs into pull requests, and level up your programming skills by Dissecting Ruby with Ruby. Engine Yard Cloud Edward Chiu New developments, interesting use cases and future plans. Edward will walk attendees through the dashboard and demonstrate the uses of new features such as Engine Yard Local. Whether you're a long-time Engine Yard user or just curious, this session will show you how to optimize your deployment experience. Firefighting on Rails Ethan Vizitei It's always inspiring to me to hear about how the technology stack I'm familiar with has been used to solve interesting problems; this is one of the extreme versions of that experience. Over the last few years, Rails has been used to solve several of the logistical pain points of the third largest fire service organization in the state of Missouri, and in this talk we're going to look at how it happened. Along the way we'll look at some of the challenges of working with such an out-of-the-ordinary organization and how Rails fit into addressing some fairly unique requirements and constraints. This is one Rails-in-the-wild case study that you won't want to pass up. Flattening The Cloud Learning Curve Using Rails Michael Murphy We've all heard how great the cloud is - but no one likes learning a new proprietary API if they don't need to. In this session, I'll demonstrate how you can develop, test and deploy ROR apps faster to HP's public cloud based on OpenStack technology. If you are new to the cloud or if you're just a CLI commando, I'll run through HP's Ruby CLI, spin up cloud servers and attach block storage faster than you thought possible. And, for Ruby Fog fans, I'll show you the HP Ruby Fog extensions that let you easily provision and manage cloud servers and storage using your favorite environment. Forget Scaling: Focus on Performance Terence Lee Your customers care about how fast your application works, you should too.... At Heroku we see millions of apps deploy and we know what it takes to get serious performance out of your code and Rails. In this talk we'll cover backend tips and frontend tricks that will help your Rails app go faster than ever before. From Rails to the Web Server to the Browser David Padilla Most of us know how to build beautiful web applications with Rails. With the help of templating tools like ERB and HAML our web apps create HTML documents, but, do you know exactly how those HTML documents end up in a browser? During this talk I will show you the bits that make it all happen. We will dissect the relevant code within Rails, Rack and the thin web server to discover exactly how the web server starts and listens to a TCP port, communicates with Rails and returns the HTML document that your browser parses. Why? Because we're curious about it, that's why. Front-end Testing for Skeptics Luke Francl Paul Graham once quipped that &quot;Web 2.0&quot; really meant &quot;JavaScript now works&quot;. Nearly ten years later, more and more functionality of our web applications is written in JavaScript. But for those of us who came of age when JavaScript was unreliable, it's been preferable to test the server-side, while leaving the UI a thin-as-possible shell. Testing the front-end was error prone and brittle. However, when you're delivering a JavaScript widget hundreds of thousands of times a day on diverse third party websites, it needs to work. So: we need to test it, and those tests need to be as painless as possible to write and maintain. This is a session for front-end testing skeptics (like me): It is possible to create tests that drive your web UI (JavaScript and all) that are automated, fast, reliable, headless -- no browser required -- and written in pure Ruby instead of some obtuse syntax. We'll explore the challenges and gotchas of testing the front-end and walk through an example that meets the above goals. Hacking the academic experience Emily Stolfo Coming from a hacker background, I’ve continually been surprised by how frequently new grads lacked the skills needed, particularly in community learning. When I was asked to teach Ruby on Rails at Columbia University I observed that a significant number of the skills required to become successful professionals in the industry are acquired on the job and aren’t being taught in school. This presentation will review:  - Lessons learned from the experience teaching in my alma mater’s CS program.  - How I developed a hacker-centric curriculum teaching not only the algorithms, but the keys to being a successful developer in the modern open source driven Rails community.  - How we as hackers can fix this. How Shopify Scales Rails John Duff Tobias Lutke wrote the first line of code for Shopify nearly 10 years ago to power his own Snowboard shop. Two years later Shopify launched to the public on a single webserver using Rails 0.13.1. Today Shopify powers over 40k online stores and processes up to half a million product sales per day across the platform. Over 30 people actively work on Shopify which makes it the longest developed and likely largest Rails code base out there. This is the story of how Shopify has evolved to handle its immense growth over the years. This is what getting big is all about: evolving to meet the needs of your customers. You don't start out with a system and infrastructure that can handle a billion dollar in GMV. You evolve to it. You evolve by adding caching layers, hardware, queuing systems and splitting your application to services. This is the story of how we have tackled the various scaling pain points that Shopify has hit and what we have done to surpass them, what we are doing to go even further. How a Request Becomes a Response Christopher Green &amp; Aimee Simone Ever wondered what Rails is doing behind the scenes? What happens to an HTTP request after it leaves your browser? How does Rails process the response? In this beginner talk, Aimee Simone and Christopher Green break down the request/response cycle of a web application, navigating through the magestic internals of Rails. We'll outline the responsibilities of each Rails component, including its MVC framework and RESTful routing concepts. By following the flow from a client HTTP request to a completed server response, you'll gain a better understanding of the anatomy of a Rails application. How to Talk to Developers Ben Orenstein Nearly every developer will be asked to present to his or her peers at some point. Those that do it well will tend to have an outsized influence on their team, company, and community. This talk will demonstrate (mostly by example) the straightforward techniques for giving excellent presentations, from a veteran conference speaker and teacher. Topics to cover include:  * Phrases that turn your audience against you.  * Basic body language tips that affect perception.  * How to be more interesting than the internet.  * The power of live coding and demos.  * Being funny without resorting to reddit memes.  * How to get plenty of questions during Q&amp;A.  * How to get an unfair amount of talk acceptances (aka 'Bribing conference organizers'). How to Write Documentation for People That Don't Read Kevin Burke Usability researchers have known for years that people browsing the Internet  don't read things word by word - they scan pages for the content they want. Yet  many API's and documentation resources are written as though users are reading  every word. If busy users can't find what they are looking for, you'll have  more support tickets (an expense), or more frustration (lost revenue). Writing effective documentation requires knowing who your users are and how  they are finding answers to their questions. In this presentation, we'll  examine practical techniques to make your documentation work for busy users.  Looking at examples and user testing from our experience at Twilio, attendees will learn: - how users find (or fail to find) your documentation  - how users view and get started (or fail to get started) with your product  - how to take advantage of underused documentation tools like your error messages, your API, and SEO. Humanity On Rails Daniel Azuma We hear the stories every so often. A study concludes that internet usage is making us &quot;dumber&quot;, while another connects online activity to anxiety or depression. A respected journalist questions whether our advanced technology is really improving our lives. A mass movement of people deleting their Facebook or Twitter accounts sweeps through the community. As developers, we hear these stories, and we shrug. Luddites and fearmongers, we call them. But don't they have a point? Do we truly understand what technology is, and how it impacts our society, the way we think and what we value? An important conversation is taking place. As Rails developers, as professionals working on the cutting edge of consumer technology, we should be involved. This talk is a brief introduction to the philosophy of technology. We'll examine a few of the major views-- the writings of the philosophers, academics, and engineers who are asking questions regarding technology and society. We'll also explore what these questions mean for us as developers, what they can tell us about our profession, and what we can uniquely contribute to the conversation. We may not find a lot of solid answers, but we'll plow a rich field for discussion, and maybe gain a new perspective into just what it is that we spend our time doing. Incremental Design - A conversation with a designer and a developer. Rebecca Miller-Webster and Savannah Wolf Developers: how many times have you had to completely rip out your hard earned code for a totally new site design?  Designers: how many times has a re-design taken 4 times as long as the developer said it would and not looked good in the end? Change all that by using an incremental approach to design. Set up your code to change all the buttons at once or prioritize design changes to make each small change good enough for production. A designer and developer will talk about the challenges and joys of making this process work in two production sites. Topics covered:  * What is incremental design?  * How to design with incremental changes in mind  * How to develop for incremental design, including utilizing SASS, structuring your mark-up and CSS, and structuring your Rails views and partials An Intervention for ActiveRecord Ernie Miller Let's be honest: ActiveRecord's got issues, and it's not going to deal with them on its own. It needs our help. Don't think so? Let's take a closer look together. We'll examine the myriad of perils and pitfalls that await newbie and veteran alike, ranging from intentionally inconsistent behavior to subtle oddities arising from implementation details. Of course, as with any intervention, we're only doing this because we care. At the very least, you'll learn something you didn't know about ActiveRecord, that helps you avoid these gotchas in your applications. But I hope that you'll leave inspired to contribute to ActiveRecord, engage in discussion about its direction with the core team, and therefore improve the lives of your fellow Rails developers. WARNING: We will be reading the ActiveRecord code in this talk. Not for the faint of heart. Introducing Brainstem, your companion for rich Rails APIs Andrew Cantino This talk will introduce Brainstem, a new Rails library for easily presenting and versioning complex ActiveRecord model relationships through your JSON API. Allow your internal or external API consumers to eager-load model associations, request custom scopes and sorts, load multiple objects by ID simultaneously, and generate JSON that uses references instead of repeating data. While your Brainstem API can be consumed by any JSON client, it will truly shine when using the included Backbone integration, adding relationship-aware models, centralized data loading, and a smart caching identity map to your Backbone applications. All of this is designed to reduce network requests and simplify development of HTML5 applications, especially mobile ones. With Backbone + Brainstem, loading a hierarchy of objects from your server can be reduced to one line of code and one network request. This talk will survey Brainstem usage in Rails, then dive into how it can enable rich mobile HTML5 applications. Keeping the lights on: Application monitoring with Sensu and BatsD Aaron Pfeifer The good news: you're quickly signing up new customers, you've scaled your Rails app to a growing cluster of 10+ servers, and the business is really starting to take off. Great! The bad news: Just 30m of failures is starting to be measured in hundreds or even thousands of dollars. Who's going to make sure the lights stay on when your app is starting to fall over? Or worse, what if your app is up, but sign-ups, payments, or some other critical function is broken?   Learn how you can build a robust monitoring infrastructure using the Sensu platform: track business metrics in all of your applications, any system metric on your servers, and do so all with the help of BatsD - a time series data store for real-time needs. We'll also talk about how to look at trending data and how you can integrate Sensu against PagerDuty, RabbitMQ, or any other third-party service. Oh, and of course - everything's written in Ruby, so you can even use your favorite gems! The Long Ball - Upgrading long lived Rails apps from 1.x-4.0 Jesse Wolgamott Explore tips to upgrade from each major version to the other, and how to efficiently tackle a 1.2 -&gt; 4.0 upgrade through two different case studies. The velocity of change for Rails versions has a side effect -- businesses hesitate to update to the latest version until their productivity drops and they're forced to update. What happens then? Let's explore a case study of a Rails app that followed this pattern. The Magic Tricks of Testing Sandi Metz Tests are supposed to save us money. How is it, then, that many times they become millstones around our necks, gradually morphing into fragile, breakable things that raise the cost of change? We write too many tests and we test the wrong kinds of things. This talk strips away the veil and offers simple, practical guidelines for choosing what to test and how to test it. Finding the right testing balance isn't magic, it's a magic trick; come and learn the secret of writing stable tests that protect your application at the lowest possible cost. Maintainable Templates Brendan Loudermilk Unwieldy templates (a.k.a. views) are all too common in Rails apps, even among teams that otherwise craft high-quality code. Being brought into or having to maintain a project with poorly-crafted templates leads to extreme frustration and less than-adequite-velocity. At philosophie, we have started to use a few simple patterns that result in templates that are easier to maintain. By investing a small amount of time up-front learning and applying these patterns we have saved countless hours in the long run. Topics include:  * The Decorator Pattern  * Using View objects  * Sanely building forms  * And more! Make Your Application Snappier With Asynchronous Workers Dave Kapp Sometimes, your application has to do something that is slow. Maybe you need to do some serious data crunching, maybe you need to call a slow third-party API, maybe you need to run a bunch of external processes. Trying to do these from within Rails is just asking for performance problems, as you'll be dragging your response times down significantly. But by using asynchronous workers, you can offload the work and let Rails stay nice and responsive. There are a lot of choices and architectural concerns that come in whenever you're adding another piece to your application, and we'll address those decisions along with the actual code you'll need. We'll start with an overview of what exactly an asynchronous worker is (and how it's different from some similar things), what some of the different worker queues available are, and how you can maximize code reuse within your workers. Of course, we'll also take a look at code samples that will illustrate how simple things can be once you have all the pieces talking to each other correctly. Examples will be given using Resque, an open-source asynchronous worker queue that uses Redis as the storage backend, but the ideas and patterns discussed will be applicable to other worker queues. Monitoring the Health of Your App Carl Lerche and Yehuda Katz Your app is your business, so keeping it healthy is important. Unfortunately, most of the tools available today are more like your doctor verifying the fact that you've had a heart attack—after it's happened. You can do better. In this session, you'll learn how to use metrics to be more proactive about monitoring your applications health, and to suss out the subtle but important warning signs that can help you prioritize developer time and improve the developer experience. We'll talk about how to instrument your code, what to measure, how to interpret the data, as well as how you can use the data to streamline your development process. Natural Language Processing with Ruby Brandon Black The field of natural language processing and the many topics encompassed within it (summarization, full-text search, sentiment analysis, content categorization, etc.) is one of fastest growing, most complex and most highly demanded knowledge sets in the software industry today. From spell checking in your SMS client to programmatically evaluating what your Twitter followers think of you, there is no shortage of real-world text processing and linguistic analysis problems all around us waiting to be solved. As Rubyists and software engineers, its important for us to know what tools related to NLP are available to us and how we can make use of them most effectively.   While there are a number of really great open-source libraries for natural language processing in Ruby and many great strides have been made in recent years, there’s still often a need to leverage tools and libraries externally from the Ruby ecosystem. Some of the best open-source NLP frameworks available rely very heavily on contributions from the academic world where Ruby as a language doesn’t have the same presence as other languages like Python or Java. In this talk, I’ll provide a beginner friendly introduction to NLP in general and I’ll give a quick overview of the tools and related projects that are currently available in the Ruby community. In addition, using real-world examples I’ll demonstrate how to painlessly leverage high performance, mature and well-established NLP libraries directly from your Ruby application using JRuby and JDK 7. New Relic Performance Code Kata Sam Goldstein and Ben Weintraub Code Kata is a term coined by Dave Thomas, co-author of the book The Pragmatic Programmer, in a nod to the Japanese concept of kata in the martial arts. A code kata is an exercise in programming which helps a programmer hone their skills through practice and repetition. The goal of this Kata is to get your mind wired into performance driven development. We'll explore, diagnose, and fix a variety of performance problems to reinforce your skills as a user of New Relic. No Traffic, No Users, No Problem! - Usability Testing for New Apps Jim Jones Building a web app consists of stressful choices. Should the signup button be red or blue? Does my site's sales pitch sound awkward? What will the user think about my site the first five seconds they visit? Using Rails and Amazon's Mechanical Turk service, I will show you how you can perform usability tests, A/B testing and gain valuable feedback on your site BEFORE launching your app to a single real user. I'll walk you through : 1) Sample code for quickly integrating your Rails site with Mechanical Turk 2) How to structure your HITs (Human Intelligence Tasks) so that you solicit detailed feedback from the workers. 3) Integrating A/B testing so that you can quickly decide which design component is better 4) Tactics for stopping automated bots from ruining your usability tests Nobody will Train You but You Zach Briggs Why do we all know a developer who has been pounding out unmaintainable code for a decade or more? Why do people &quot;believe in TDD but I don't have time to write tests during crunch?&quot; How is it that we have an entire industry based around rescuing teams from acutely awful Rails apps? It's because on the job experience is a poor teacher; plateauing as soon as the developer is able to ship code that meets requirements. Schools teach Computer Science which is only tangentially related to being a developer and most kata's are approached incorrectly, giving no value at best, and reinforcing poor practices at worst. On top of all this, our pairs (for the lucky ones who pair program) probably have not shown us anything new in months. This presentation will give specific, concrete steps on how to slowly and steadily improve our game through practice and hard work. I'll identify what skill Rails developers should be focusing on and walk the audience through how to target and eliminate these weaknesses so that nothing but white hot joy streams out of our fingers and into our apps. There's no magic here, no secrets, and no hacks; just you and me working our butts off until we suck a little less. Object-Oriented Lessons for a Service-Oriented World Chris Kelly The dreams of developers working on monolithic Rails applications are frequently filled with sugar plums and service-oriented architectures--but like any kind of software design, SOA can easily become a tangled mess. Many of the same principles that guide our software design can guide our architecture design. We apply SOLID principles to applications to keep them loosely coupled, we design interfaces so we can send logical messages to our domain objects. We hide our databases behind abstractions because how we access our data shouldn't matter to how we consume it. Rarely, though, do we see the same practices applied to our services and APIs, leaving us with tightly coupled and difficult to extend service-oriented architectures. If you are facing the monorail to SOA challenge, consider looking at your services as objects and your APIs as messages. Service-oriented applications are complex, and the best way to fend off complexity is though object-oriented design. Of Buyers And Renters and keeping a roof over our heads Sebastian Delmont What do home ownership and leveraged buyouts can teach us about how to use technical debt to our advantage? How can we sleep soundly at night when we have accumulated mountains and mountains of technical debt? When is good enough good enough and when are we just deceiving ourselves? Postgres, the Best Tool You're Already Using Adam Sanderson Your fledgling social network for hedgehogs is starting to gain traction, but now new feature requests are pouring in. How you can you meet the demands of an ambitious product team within your existing stack? There’s no time to waste, so we will look at how to leverage the venerable Postgres workhorse. We will look at some of Postgres' unique features that lend themselves to solving the problems Rails developers face when moving from v1 products to v2 and beyond. We will focus on SQL and ActiveRecord, and talk about pragmatic solutions to hairy problems. Get practical, hands-on advice about using Postgres with ActiveRecord to support tagging, model hierarchical data, store arbitrary metadata, and add full text search to your application. By the end of this talk, you’ll be able to go to your next meeting armed with confidence in your ability to build the ultimate hedgehog destination online. Properly Factored MVC in Rails Applications Katrina Owen &amp; Jeff Casimir Starting Rails applications is one thing, but how you apply the priciples of MVC as an application grows determine whether your application is modular and maintainable or a convoluted mess. In this session, we'll use an existing application to explore and practice some of the common mistakes, correct techniques, and concepts behind the techniques to improve your development patterns. Pry — The Good Parts! Conrad Irwin Pry is the featureful development console for Ruby. From its humble roots as an irb replacement, Pry has grown into an indispensable tool for any Ruby or Rails programmer. Using some real-life examples, I'll explain how to use Pry effectively. We'll start from the beginning, with simple features for exploring libraries and source-code in glorious technicolor. Then we'll move up a level and discuss how to inspect, debug and even modify a program while it is still running. Finally we'll touch on some of Pry's more advanced plugins that can really help you get a feel for what your code is doing. Rails Vs. The Client Side Noel Rappin Two completely different ways have emerged for using Rails as the back end to a rich client-side JavaScript application. * The 37Signals &quot;Russian Doll&quot; approach, where the server generally returns HTML to the client. This approach uses aggressive caching and a little bit of JavaScript glue to keep the application fast.  * The &quot;Rails API&quot; approach, where the server generally returns JSON to the client, and a JavaScript MVC framework handles the actual display. Which of these will work for you? We will look at code to see the structural difference between these two approaches and see what the speed, extensibility, and maintainability trade-offs are. At the end of the talk, you will be better equipped to chose a structure for your next rich-client application. Rails is Just Ruby Jesse Wolgamott Rails: the result of magical incantations, voodoo, and wizardry? Or: a collection of patterns from the most awesomest language in the world (Ruby)? We'll show three different areas of Rails that seem to be the most magical: before_filters and callbacks, Procs, and inheritance. In the workshop, participants will create their own Ruby object implementing these magical powers. Rails' Insecure Defaults Bryan Helmkamp Out of the box, Rails provides facilities for preventing attacks like SQL injection, cross-site scripting (XSS), cross-site request forgery (CSRF), and more. As a result, it's considered one of the most secure web application frameworks available. Digging deeper, however, you can find a number of places where Rails' default behavior is not as secure as it could be. This talk will focus on longstanding, known weak spots that create risks for your application and business if you are not aware of them. Real-Time Rails Brian Cardarella The future is real time! With the Rails 4.0 Live Streaming API we finally have the ability to easily add real time functionality to our apps. Learn all about the live streaming API, how best to take advantage of this in the browser, and how to deploy a real-time ready Rails app. Get ready to open your apps to a whole new world of interaction and functionality. Topics we will cover: * Live Streaming API  * EventMachine vs Rails 4.0  * Node.js vs Rails 4.0  * Polling vs Live Streaming  * Websockets &amp; Rails 4.0  * Puma Ruby Libraries Important for Rails Michael Hartl This talk+workshop highlights some Ruby libraries that are particularly useful when developing Rails applications. In the talk portion, we'll give an overview of some specific classes and modules, and then in the workshop we'll break into groups to dive deeper into libraries of each participant's choice, with a focus on developing the skills needed to read and understand the Ruby documentation. Time and interest permitting, we'll incorporate test-driven development into our investigations. Ruby on RESS Marty Resnick In the Mobile Web space, there has been a lot of discussion about Responsive Web Design. However, RWD has its limitations and may requires server-side intervention. This is where RESS comes in. With a Responsive Web + Server-Side solution, issues of performance, page weight and responsive images could all be addressed. Ruby on Rails has proven to be a perfect server-side solution in a RESS solution, and this discussion will review a hands-on approach to implementing RESS along with some real-world case studies. Schemas for the Real World Carina C. Zona Social app development challenges us to code for users’ personal world. Users are giving push-back to ill-fitted assumptions about their own identity — name, gender, sexual orientation, important relationships, and many other attributes that are individually meaningful. How can we balance users’ realities with an app’s business requirements? Facebook, Google+, and others are struggling with these questions. Resilient approaches arise from an app’s own foundation. Discover how our earliest choices influence codebase, UX, and development itself. Learn how we can use that knowledge to both inspire the people who use our apps, and to generate the data that need as developers. Security is hard, but we can’t go shopping André Arko The last few months have been pretty brutal for anyone who depends on Ruby libraries in production. Ruby is really popular now, and that’s exciting! But it also means that we are now square in the crosshairs of security researchers, whether whitehat, blackhat, or some other hat. Only the Ruby and Rails core teams have meaningful experience with vulnerabilites so far. It won’t last. Vulnerabilities are everywhere, and handling security issues responsibly is critical if we want Ruby (and Rubyists) to stay in high demand. Using Bundler’s first CVE as a case study, I’ll discuss responsible disclosure, as well as repsonsible ownership of your own code. How do you know if a bug is a security issue, and how do you report it without tipping off someone malicious? As a Rubyist, you probably have at least one library of your own. How do you handle security issues, and fix them without compromising apps running on the old code? Don’t let your site get hacked, or worse yet, let your project allow someone else’s site to get hacked! Learn from the hard-won wisdom of the security community so that we won’t repeat the mistakes of others. Services and Rails: The Sh*t They Don't Tell You" href="http://www.railsconf.com/2013/talks#talk-21" target="_blank">giving the same talk</a> next week at RailsConf.)</p>
<p>To help you stay in control of your applications, New Relic’s Ruby Agent now provides <a title="Cross Application Tracing" href="https://newrelic.com/docs/features/cross-application-traces" target="_blank">Cross Application Tracing</a> (CAT) which tracks and visualizes how different services in your infrastructure communicate. In addition to tracking across Ruby apps, we can trace API calls made to Java, Python, PHP, or .NET apps. For example, you can use CAT to see related Transaction Traces between a Rails application and a high performance Java service.</p>
<p><a href="http://blog.newrelic.com/2013/03/04/cross-applications-tracing/"><img title="CAT Transaction Traces" alt="CAT Transaction Traces" src="http://blog.newrelic.com/wp-content/uploads/CAT_TransactionTraces.png" width="536" height="304" /></a></p>
<p>Use CAT to get some good insight into how data is flowing between your applications. It’s been helpful to us for breaking apart our own gigantic Rails app.</p>
<p>For more information on New Relic’s Ruby agent, check out:</p>
<p style="padding-left: 30px;">* <a title="rubygems.org" href="https://rubygems.org/gems/newrelic_rpm" target="_blank">rubygems.org</a><br />
* <a title="github.com" href="https://github.com/newrelic/rpm/" target="_blank">github.com</a><br />
* <a title="newrelic.com" href="http://newrelic.com/ruby" target="_blank">newrelic.com</a></p>
<p>Next up: Thread Profiling: See Exactly What Your App Is Doing</p>
<p><i>Headed to RailsConf 2013? Stop by our booth to see the New Relic Ruby Agent in action, pick up your free Data Nerd tshirt and more. You can even try New Relic Pro free for 30 days. For more information, go to <a title="Going to RailsConf? Get New Relic Pro FREE for 30 days!" href="http://newrelic.com/railsconf" target="_blank">newrelic.com/rubyconf</a>.<br />
</i></p>
<p>The post <a href="http://blog.newrelic.com/2013/04/22/cross-app-tracing-time-to-break-up-that-huge-rails-application/">Cross App Tracing: Time to Break Up that Huge Rails Application?</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.newrelic.com/2013/04/22/cross-app-tracing-time-to-break-up-that-huge-rails-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Community News:  An Overview of WebP, Matz Talks About the Release of Ruby 2.0 &amp; More</title>
		<link>http://blog.newrelic.com/2013/03/22/community-news-an-overview-of-webp-matz-talks-about-the-release-of-ruby-2-0-more/</link>
		<comments>http://blog.newrelic.com/2013/03/22/community-news-an-overview-of-webp-matz-talks-about-the-release-of-ruby-2-0-more/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 17:34:48 +0000</pubDate>
		<dc:creator>Leigh Shevchik</dc:creator>
				<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Performance Tech Tips]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Top Post]]></category>

		<guid isPermaLink="false">http://blog.newrelic.com/?p=12571</guid>
		<description><![CDATA[<p>In this week’s community news, we get an overview of WebP, Matz talks about Ruby 2.0 and more. * Spotify shares its manifesto to create alignment and direction for its improvement work. * Ilya Grigorik has an overview of WebP. * Kris Gale, VP of Engineering at Yammer, argues the key to building fast lies [...]</p><p>The post <a href="http://blog.newrelic.com/2013/03/22/community-news-an-overview-of-webp-matz-talks-about-the-release-of-ruby-2-0-more/">Community News:  An Overview of WebP, Matz Talks About the Release of Ruby 2.0 &#038; More</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>In this week’s community news, we get an overview of WebP, Matz talks about Ruby 2.0 and more.</p>
<p style="padding-left: 30px;">* Spotify shares <a title="Agile à la Spotify" href="http://labs.spotify.com/2013/03/20/agile-a-la-spotify/" target="_blank">its manifesto</a> to create alignment and direction for its improvement work.</p>
<p style="padding-left: 30px;">* Ilya Grigorik has <a title="Faster, smaller and more beautiful web with WebP" href="http://www.igvita.com/2013/03/07/faster-smaller-and-more-beautiful-web-with-webp/" target="_blank">an overview of WebP</a>.</p>
<p style="padding-left: 30px;">* Kris Gale, VP of Engineering at Yammer, argues the <a title="Why Yammer believes the traditional engineering organizational structure is dead" href="http://firstround.com/article/Why-Yammer-believes-the-traditional-engineering-organizational-structure-is-dead?utm_source=feedburner&amp;utm_medium=twitter&amp;utm_campaign=Feed%3A+hnycombinator+%28HN+-+hnycombinator%29" target="_blank">key to building fast</a> lies in small teams.</p>
<p style="padding-left: 30px;">* In this video from Waza, Matz talks about the recent <a title="Matz on Ruby 2.0 at Heroku's Waza" href="https://blog.heroku.com/archives/2013/3/6/matz_highlights_ruby_2_0_at_waza" target="_blank">release of Ruby 2.0</a>.</p>
<p style="padding-left: 30px;">* Guy Podjarny takes a look at real world <a title="Real World RWD Performance – Take 2" href="http://www.guypo.com/uncategorized/real-world-rwd-performance-take-2/" target="_blank">Responsive Web Design performance</a>.</p>
<p style="padding-left: 30px;">* Joshua Bixby asks when it comes to big data, <a title="Big Data vs. Big Enough Data" href="http://www.webperformancetoday.com/2013/03/06/big-data-vs-big-enough-data/" target="_blank">how big is big enough</a>.</p>
<p style="padding-left: 30px;">* Rich Pareta explains <a title="Building Great Teams - Hiring in a post-DevOps world" href="http://rparet.github.com/devops-hiring-collaborative-teams/" target="_blank">how to get hired</a> into a collaborative engineering team.</p>
<p style="padding-left: 30px;">* Colin Ihrig discusses the challenges in <a title="Scaling Node.js Applications" href="http://cjihrig.com/blog/scaling-node-js-applications" target="_blank">scaling Node.js</a> applications.</p>
<p style="padding-left: 30px;">* Etsy&#8217;s Lara Swanson explains why <a title="http://alistapart.com/article/improving-ux-through-front-end-performance" href="http://alistapart.com/article/improving-ux-through-front-end-performance" target="_blank">website performance begins with design</a>.</p>
<p>The post <a href="http://blog.newrelic.com/2013/03/22/community-news-an-overview-of-webp-matz-talks-about-the-release-of-ruby-2-0-more/">Community News:  An Overview of WebP, Matz Talks About the Release of Ruby 2.0 &#038; More</a> appeared first on <a href="http://blog.newrelic.com">New Relic blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.newrelic.com/2013/03/22/community-news-an-overview-of-webp-matz-talks-about-the-release-of-ruby-2-0-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
