Nick Sieger: Tag railsconf2007 tag:blog.nicksieger.com,2005:Typo Typo 2010-11-22T18:17:31+00:00 Nick Sieger urn:uuid:35f07fbf-9a1b-4848-9e0a-848ba7029697 2007-05-18T17:10:39+00:00 2010-11-22T18:17:31+00:00 RailsConf 2007 Opening Keynote: David Heinemeier Hansson <h1>Rails 2&#46;0</h1> <h2>Where we&#8217;ve been</h2> <p>David is surprised and proud of the community that we already have, and wants us to be comfortable with where we are, and not always looking toward the future&#46; We have:</p> <ul> <li>Million gem downloads</li> <li>Hundreds of plugins</li> <li>10k users on the rubyonrails&#45;talk mailing list</li> <li>Ruby job descriptions (asking for 3 years RoR experience, longer than David)</li> <li><a href="http://www.amazon.com/s/002-0555878-2213644?ie=UTF8&amp;tag=mozilla-20&amp;index=blended&amp;link%5Fcode=qs&amp;field-keywords=ruby%20on%20rails&amp;sourceid=Mozilla-search">Books, books, books</a> (and not just English books, but non&#45;English titles as well), surpassing VBA, Perl, and Python in book sales</li> <li>IDEs from NetBeans, Borland, Aptana, etc&#46;</li> </ul> <p>Rails 2&#46;0 is not going to be the &#8220;Unicorn&#8221;&#46; It&#8217;s not going to be a total rewrite, it actually has a release schedule, it will not break backwards&#45;compatibility&#46; Instead, it will build upon what we already have, and continue the philosophy of building on what is useful and needed&#46; In fact, 95% of what&#8217;s in 2&#46;0 already works today, in the edge&#46; Example, a simple controller that handles three formats of input/output, with a person resource for accessing the data from a remote server&#46;</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">class </span><span class="class">PeopleController</span> <span class="punct">&lt;</span> <span class="constant">ApplicationController</span> <span class="punct">...</span> <span class="keyword">def </span><span class="method">create</span> <span class="attribute">@person</span> <span class="punct">=</span> <span class="constant">Person</span><span class="punct">.</span><span class="ident">create</span><span class="punct">(...)</span> <span class="ident">respond_to</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">format</span><span class="punct">|</span> <span class="ident">format</span><span class="punct">.</span><span class="ident">html</span> <span class="punct">{</span> <span class="ident">redirect_to</span> <span class="ident">person_url</span><span class="punct">(</span><span class="attribute">@person</span><span class="punct">)</span> <span class="punct">}</span> <span class="ident">format</span><span class="punct">.</span><span class="ident">xml</span> <span class="punct">{</span> <span class="ident">render</span> <span class="symbol">:status</span> <span class="punct">=&gt;</span> <span class="symbol">:created</span><span class="punct">,</span> <span class="symbol">:location</span> <span class="punct">=&gt;</span> <span class="ident">person_url</span><span class="punct">(</span><span class="attribute">@person</span><span class="punct">),</span> <span class="punct">...</span> <span class="punct">}</span> <span class="ident">format</span><span class="punct">.</span><span class="ident">js</span> <span class="punct">{</span> <span class="ident">render</span> <span class="symbol">:update</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">js</span><span class="punct">|</span> <span class="punct">...</span> <span class="keyword">end</span> <span class="punct">}</span> <span class="keyword">end</span> <span class="keyword">end</span> <span class="keyword">end</span> <span class="keyword">class </span><span class="class">Person</span> <span class="punct">&lt;</span> <span class="constant">ActiveResource</span><span class="punct">::</span><span class="constant">Base</span> <span class="constant">self</span><span class="punct">.</span><span class="ident">site</span> <span class="punct">=</span> <span class="punct">&quot;</span><span class="string">http://example.com/</span><span class="punct">&quot;</span> <span class="keyword">end</span></code></pre></div> <p>David then goes into a live demo of the new scaffold resource, which by appearance is identical to the old scaffolding, except it comes pre&#45;baked with a REST&#45;ful XML interface&#46; He then adds support for a text format with a couple of lines of code, jumps into IRB, defines an active resource, and proceeds to change the data remotely&#46;</p> <p>If you want to add search to your controller, you can do it in a DRY way, and all the format/view work you&#8217;ve done will benefit:</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">class </span><span class="class">PeopleController</span> <span class="punct">&lt;</span> <span class="constant">ApplicationController</span> <span class="keyword">def </span><span class="method">index</span> <span class="keyword">if</span> <span class="ident">params</span><span class="punct">[</span><span class="symbol">:name</span><span class="punct">]</span> <span class="attribute">@people</span> <span class="punct">=</span> <span class="constant">Person</span><span class="punct">.</span><span class="ident">find</span> <span class="symbol">:all</span><span class="punct">,</span> <span class="symbol">:conditions</span> <span class="punct">=&gt;</span> <span class="punct">[&quot;</span><span class="string">name like ?</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string"><span class="expr">#{params[:name]}</span>%</span><span class="punct">&quot;]</span> <span class="keyword">else</span> <span class="attribute">@people</span> <span class="punct">=</span> <span class="constant">Person</span><span class="punct">.</span><span class="ident">find</span> <span class="symbol">:all</span> <span class="keyword">end</span> <span class="punct">...</span> <span class="keyword">end</span> <span class="keyword">end</span></code></pre></div> <p>David points out that 37signals, Shopify, Fluxiom, et&#46; al&#46; are real sites, with non&#45;trivial domains that are still well executed in Rails, so it&#8217;s not just about simple scaffolding demos&#46;</p> <p>In Rails 2&#46;0, ActiveResource will be bundled with Rails, and ActionWebService will not&#46;</p> <h2>Friends of Rails</h2> <ul> <li>AJAX!</li> <li>REST!</li> <li>Atom? &#45;&#45; Atom should be more native to Rails</li> <li>Openid? &#45;&#45; Openid is not necessarily something that needs to be used by all, but still a strong ally&#46;</li> </ul> <h2>9 other things I like about Rails 2</h2> <ul> <li>Breakpoints are back &#45;&#45; no longer depends on <code>Binding.of_caller</code>; instead Rails depends and builds upon <a href="http://rubyforge.org/projects/ruby-debug/"><code>ruby-debug</code></a> by Kent Sibilev&#46;</li> <li>HTTP Performance &#45;&#45; streamlining &#46;js and &#46;css, even though it feels better to break up Javascript and CSS into many little pieces, and gzip them</li> </ul> <div class="typocode"><pre><code class="typocode_ruby "><span class="punct">&lt;%=</span><span class="string"> javascript_include_tag :all, :cache </span><span class="punct">=&gt;</span> <span class="constant">true</span> <span class="punct">%&gt;</span><span class="string"> &lt;%= stylesheet_link_tag :all, :cache =</span><span class="punct">&gt;</span> <span class="constant">true</span> <span class="punct">%&gt;</span><span class="string"></span></code></pre></div> <p>We can also fake out the browser and configure multiple asset hosts (4) you can maximize browser connections</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="ident">config</span><span class="punct">.</span><span class="ident">action_controller</span><span class="punct">.</span><span class="ident">asset_host</span> <span class="punct">=</span> <span class="punct">'</span><span class="string">assets%d.highrisehq.com</span><span class="punct">'</span></code></pre></div> <ul> <li>Query cache</li> </ul> <div class="typocode"><pre><code class="typocode_ruby "><span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span><span class="punct">.</span><span class="ident">cache</span> <span class="keyword">do</span> <span class="comment"># actions here are cached</span> <span class="keyword">end</span></code></pre></div> <ul> <li>Rendering and MIME types &#45;&#45; bake the MIME convention into the template, and separate from the rendering mechanism people/index&#46;html&#46;erb people/index&#46;xml&#46;builder people/index&#46;rss&#46;erb people/index&#46;atom&#46;builder</li> <li>config/initializers replacing config/environment&#46; Initializers are &#46;rb files in the config/initializers directory of your app that are automatically loaded during initialization time&#46;</li> <li>Sexy migrations</li> </ul> <div class="typocode"><pre><code class="typocode_ruby "><span class="ident">create_table</span> <span class="symbol">:people</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">t</span><span class="punct">|</span> <span class="ident">t</span><span class="punct">.</span><span class="ident">integer</span> <span class="symbol">:account_id</span> <span class="ident">t</span><span class="punct">.</span><span class="ident">string</span> <span class="symbol">:first_name</span><span class="punct">,</span> <span class="symbol">:last_name</span><span class="punct">,</span> <span class="symbol">:null</span> <span class="punct">=&gt;</span> <span class="constant">false</span> <span class="ident">t</span><span class="punct">.</span><span class="ident">text</span> <span class="symbol">:description</span> <span class="ident">t</span><span class="punct">.</span><span class="ident">timestamps</span> <span class="keyword">end</span></code></pre></div> <ul> <li>HTTP authentication (<code>authenticate_or_request_with_http_basic</code>, <code>authenticate_with_http_basic</code>)</li> <li>The MIT assumption &#45;&#45; the licensing question &#45;&#45; make it easier to understand</li> <li>Spring cleaning &#45;&#45; getting rid of the cruft &#45;&#45; stay tuned!</li> </ul> Nick Sieger urn:uuid:40171862-80d2-460f-9ad6-ead9fe29fd91 2007-05-19T20:34:00+00:00 2010-11-22T18:23:55+00:00 RailsConf 2007: Chris Wanstrath: Kickin' Ass with Cache-fu <p>Chris is here to talk about games, since he used to work for Gamespot&#46; He coded PHP, which is like training wheels without the bike&#46; He had to sit in a glass cube and help keep the site running during E3 last year&#46; There were 100 gajillion teenage boys during their lunch break hitting refresh, and it all blew up&#46; Couldn&#8217;t even gzip the responses, because the servers heated up to much&#46; They served 50M pages in a day, without downtime&#46; They did it with Memcache&#46;</p> <p>Memcache is a distributed hash &#45;&#45; multiple daemons running on different servers&#46; Developed by Livejournal for their infrastructure, you just put up the servers, and they just work&#46;</p> <p>Should you use Memcache? No&#46; <a href="http://c2.com/xp/YouArentGonnaNeedIt.html">YAGNI</a>, UYRDNI (unless you really do need it)&#46;</p> <h2>Rails and Memcache</h2> <p>Fragments, Actions, Sessions, Objects, cache it all&#46; You can use:</p> <ul> <li><code>memcache-client</code> (by Robot&#45;coop guys/Eric Hodel)&#46; Marshal&#46;unload is 40 times faster than Object&#46;new/loading from the database&#46;</li> <li>CachedModel &#45;&#45; integration with ActiveRecord</li> <li>Fragment Cache Store</li> <li>Memcache session store</li> </ul> <p>&#46;&#46;&#46;or&#46;&#46;&#46;</p> <h2><code>cache_fu</code></h2> <p>Or, <code>acts_as_cached</code>&#46; It knows about all the aforementioned objects, with a single YAML config file (<code>config/memcached.yml</code>)&#46; Word to the wise: don&#8217;t use names in your server config file&#46; Use IPs, avoid BIND and connections to the servers with every connection&#46; Don&#8217;t let DNS outages bring down your servers&#46;</p> <ul> <li><code>get_cache</code></li> <li><code>expire_cache</code></li> </ul> <p>This is all you need &#45;&#45; if you&#8217;re using <code>set_cache</code>, you probably don&#8217;t understand how the plugin works&#46; Expire cache on the &#8220;after save&#8221; hook, which allows you to cache ID misses as well&#46;</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">class </span><span class="class">Presentation</span> <span class="punct">&lt;</span> <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span> <span class="ident">acts_as_cached</span> <span class="ident">after_save</span> <span class="symbol">:expire_cache</span> <span class="keyword">end</span></code></pre></div> <p>Example: only cache published items</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">class </span><span class="class">Presentation</span> <span class="punct">&lt;</span> <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span> <span class="ident">acts_as_cached</span> <span class="symbol">:conditions</span> <span class="punct">=&gt;</span> <span class="punct">'</span><span class="string">published = 1</span><span class="punct">'</span> <span class="keyword">end</span></code></pre></div> <p>Cached&#45;scoped&#45;finders (if somebody thinks of a good name, let Chris know)&#46; The idea is to move custom finder logic to a method on your model, and then wrap a cache&#45;scoping thingy around it&#46; <code>cache_fu</code> ties this up nicely by giving you a <code>cached</code> method on AR::Base&#46;</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">class </span><span class="class">Topic</span> <span class="punct">&lt;</span> <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span> <span class="keyword">def </span><span class="method">self.weekly_popular</span> <span class="constant">Topic</span><span class="punct">.</span><span class="ident">find</span> <span class="symbol">:all</span><span class="punct">,</span> <span class="punct">...</span> <span class="keyword">end</span> <span class="keyword">end</span> <span class="constant">Topic</span><span class="punct">.</span><span class="ident">cached</span><span class="punct">(</span><span class="symbol">:weekly_popular</span><span class="punct">)</span></code></pre></div> <p>Adding date to cache key with <code>alias_method_chain</code>:</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">def </span><span class="method">self.cache_key_with_date</span><span class="punct">(</span><span class="ident">id</span><span class="punct">)</span> <span class="punct">...</span> <span class="keyword">end</span> <span class="keyword">class </span><span class="punct">&lt;&lt;</span> <span class="constant">self</span> <span class="ident">alias_method_chain</span> <span class="symbol">:cache_key</span><span class="punct">,</span> <span class="symbol">:date</span> <span class="keyword">end</span></code></pre></div> <p>Cached loads by ID: <code>Topic.find(1, 2, 3)</code> moves to <code>Topic.get_cache(1, 2, 3)</code>, which can parallelize calls to memcached and bring them back as they&#8217;re ready&#46;</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="ident">user_ids</span> <span class="punct">=</span> <span class="attribute">@topic</span><span class="punct">.</span><span class="ident">posts</span><span class="punct">.</span><span class="ident">map</span><span class="punct">(&amp;</span><span class="symbol">:user_id</span><span class="punct">).</span><span class="ident">uniq</span> <span class="attribute">@users</span> <span class="punct">=</span> <span class="constant">User</span><span class="punct">.</span><span class="ident">get_cache</span><span class="punct">(</span><span class="ident">user_ids</span><span class="punct">)</span></code></pre></div> <p>You can also cache associations, so that you&#8217;re navigating associations via Memcache&#46;</p> <p>Cache overrides</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">class </span><span class="class">ApplicationController</span> <span class="punct">&lt;</span> <span class="constant">ActionController</span><span class="punct">::</span><span class="constant">Base</span> <span class="ident">before_filter</span> <span class="symbol">:set_cache_override</span> <span class="keyword">def </span><span class="method">set_cache_override</span> <span class="constant">ActsAsCached</span><span class="punct">.</span><span class="ident">skip_cache_gets</span> <span class="punct">=</span> <span class="punct">!!</span><span class="ident">params</span><span class="punct">[</span><span class="symbol">:skip_cache</span><span class="punct">]</span> <span class="keyword">end</span> <span class="keyword">end</span></code></pre></div> <p><code>reset_cache</code>: Slow, uncached operations can sometimes queue up and wedge a site&#46; Instead, issue cache resets on completion of a request, rather than expiring beforehand&#46; That way, requests that continue to pile up will still use the cached copy until the rebuild is complete&#46;</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">class </span><span class="class">Presentation</span> <span class="punct">&lt;</span> <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span> <span class="ident">after_save</span> <span class="symbol">:reset_cache</span> <span class="keyword">end</span></code></pre></div> <p>Versioning: a way to expire cache on new code releases</p> <div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">class </span><span class="class">Presentation</span> <span class="punct">&lt;</span> <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Base</span> <span class="ident">acts_as_cached</span> <span class="symbol">:version</span> <span class="punct">=&gt;</span> <span class="number">1</span> <span class="keyword">end</span></code></pre></div> <p>Deployment: Chris recommends using Monit to ensure your Memcache servers are up&#46;</p> <p><code>libketama</code>: consistent hashing that gives you the ability to redeploy Memcache servers without invalidating all the keys&#46;</p> <p>Q: Page caching? A: Nginx with native Memcache page caching, but outside of Rails domains&#46;</p> <p>Lots of other questions, but dude, Chris talks too fast!</p> Nick Sieger urn:uuid:f0f0e50c-df6a-47dc-81fe-0845c594512c 2007-05-19T19:30:06+00:00 2010-11-22T18:23:55+00:00 RailsConf 2007: Bradley Taylor: Virtual Clusters <p>How does Rails figure into virtualization? Bradley will cover this topic with examples and case studies&#46; Along the way, hardware items may be mentioned, but are not critical&#46; Really, it&#8217;s about the design of the clusters, not the bits of plumbing you use to connect them up&#46;</p> <p>Virtualization is partitioning of physical servers that allow you to run multiple servers on it&#46; Xen, Virtuozzo, VMWare, Solaris containers, KVM, etc&#46; Bradley uses Xen&#46; The virtual servers share the same processor (hopefully multi&#45;core), memory, storage, network cards (but with indepenent IP addresses), etc&#46;, but run independently of each other&#46; VPS, slice, container, accelerator, VM, it&#8217;s all the same&#46; Memory, storage, and CPU can be guaranteed with the virtualization layer&#46;</p> <p>Why would you do this? <em>Consolidate</em> servers for less hardware and cost; <em>Isolate</em> applications &#45;&#45; bad apps don&#8217;t drag the server down, contain intrusions, use different software stacks; <em>Replicate</em> &#45;&#45; easily create new servers and deploy in a standardized and automated way; <em>Utilize</em> &#45;&#45; take advantage of all CPU, memory, storage, resources; <em>Allocate</em> resources, give a server exactly what it requires, grow/shrink up and down, and balance them&#46; Bradley says, &#8220;Once you go to virtualization you won&#8217;t want to go back&#46; Do the simplest thing that could possibly work&#46;&#8221;</p> <p>Virtual clusters, then, are a bunch of servers cooperating toward a common goal &#45;&#45; if you have many versions or copies of one thing&#46; More than one customer, more than one version of software, etc&#46;</p> <p>For Rails, this means a lot of things: you can have many development environments and stages, take advantage of memory isolation, protect against PHP/Java, and make multiple&#45;server scaling accessible&#46;</p> <h2>Examples</h2> <ul> <li>Two servers for production and staging</li> <li>Three for web/db/staging</li> <li>Mixed languages &#45;&#45; instead of 1x1GB server use 3x300MB servers</li> <li>High availability applications with fewer servers</li> <li>Multiple applications &#45;&#45; one server per application</li> <li>Standardized roles/appliances &#45;&#45; mail, ftp, dns, web, db</li> </ul> <h2><a href="http://www.eastmedia.com/">EastMedia</a></h2> <ul> <li>They can incubate customers in separate images</li> <li>Dev/staging/production servers</li> <li>Shared SVN/trac</li> <li>2 physical servers => 8 virtual servers</li> </ul> <h2>Boom Design</h2> <ul> <li>Again, multiple stages</li> <li>Customer staging, with lower uptime requirements</li> <li>Low&#45;traffic apps on a single server, but everything else gets its own dedicated server</li> <li>2GB memory spread across 9 virtual servers</li> </ul> Nick Sieger urn:uuid:c67fa477-41f0-4798-9fa2-2c27ae65e537 2007-05-19T17:22:42+00:00 2010-11-22T18:23:56+00:00 RailsConf 2007: Saturday Morning Keynotes <p><strong>Cyndi Mitchell &#45;&#45; ThoughtWorks Studios</strong></p> <p>Enterprise (the &#8220;e&#8221; word)</p> <p>Before IT got involved, &#8220;enterprise&#8221; was a bold new venture&#46; Toyota manufacturing, Skype disruption of telephony&#46;</p> <p>Enterprise in terms of IT has come to mean bloatware, incompetence, corruption, waste of time, no value&#46;</p> <p>So this is the battle: The enterprise (to boldly go where no man has gone before) we need to reclaim vs&#46; the bloatware/competence/corruption/fear&#45;based selling etc&#46;</p> <p>RubyWorks &#45;&#45; package stack with haproxy, mongrel, monit through an RPM repository</p> <p>For JRuby support, call <a href="http://ola-bini.blogspot.com/">Ola</a>&#46;</p> <p><strong>Tim Bray &#45;&#45; Web Guy from Sun Microsystems</strong></p> <p>Change the world that are better than just using a cool web framework: http://pragmaticstudio&#46;com/donate/</p> <p>Sun loves Ruby&#46; Ruby <em>and</em> Rails, that is&#46; The impact of the Ruby language is going to be at least as big as Rails is for web development&#46;</p> <p>Sun provided servers for Ruby 2&#46;0 development, and can provide servers for your potentially cool, worthy, open source project, just drop Tim an email&#46;</p> <p>A few more obligatory plugs for NetBeans and Sun sponsoring the conference&#46; &#8220;Pre&#45;alpha,&#8221; he says&#46; Hmm, I wonder what <a href="http://blogs.sun.com/tor/">Tor</a> would say about that!</p> <p>JRuby: when would you use JRuby vs&#46; Ruby? If you have no pain, keep using C Ruby&#46; But if you have management concerns, deployment concerns, etc&#46; then by all means do try it!</p> <p>Obligatory handshake/sandal connection with ThoughtWorks and Cyndi &#45;&#45; running <a href="http://studios.thoughtworks.com/2007/5/7/mingle-to-run-on-jruby">Mingle</a> (and cruisecontrol&#46;rb) with JRuby&#46;</p> <p>Sun: &#8220;Hi, the answer is Java, what was the question?&#8221; So why would Sun want to support Ruby? Well, you guys are programmers&#46; Programmers who deliver quality software fast&#46; And those programmers need computers, and OSes, and web servers, and support and services, etc&#46; Plug, plug, plug&#46;</p> <p>How do you make money on free products? Sun has open&#45;sourcing Java, Solaris, even Sparc&#46; Joyent is open&#45;sourcing their stuff&#46; Where does the money come from? 1&#46; Adoption 2&#46; Deployment 3&#46; Monetization at the point of value</p> <p>What if we win? Are our problems over? No, we&#8217;ll have to deal with Java&#46; And &#46;NET&#46; And PHP&#46; <em>From the audience: And COBOL&#46;</em> The Network Is The Computer&#46; The Network Is Heterogeneous&#46; <strong>Deal with it&#46;</strong> So how do we interoperate?</p> <ul> <li>Just Run Java (and JRuby, of course!, and JavaScript, and PHP, etc&#46;)</li> <li>Use Atom/REST&#46; Everything should have a publish button&#46; <em>Don&#8217;t use WS&#45;DeathStar or WCF or WSIT&#46;</em></li> </ul> <p>Developer issues: Scaling, Static vs&#46; Dynamic, Maintainability, Concurrency, Tooling, Integration, Time to Market&#46; Which two of these matter the most?</p> <p>Tim&#8217;s final assertion: Maintainability and Time to Market, and that&#8217;s why we&#8217;re all at RailsConf&#46;</p> Nick Sieger urn:uuid:f408e374-3a8c-4436-b31f-cf1d3fe7e4be 2007-05-18T19:33:31+00:00 2010-11-22T18:23:56+00:00 RailsConf 2007: Evan Weaver: Going Off Grid <p>Evan is talking about leaving Rails as a full&#45;stack framework and remixing bits and pieces for integration projects&#46; He&#8217;s doing it in the context of a case study on Bio: a project at the University of Delaware working with DNA data in large SQL databases&#46; Evan states that all of bioinformatics is an integration problem&#46; (Me: That&#8217;s probably true of any research project where data is coming from multiple, varied sources&#46; So where does Rails fit in this?)</p> <p>So how do you cope with this? Use the Rails console as an admin interface, mapping AR onto the legacy schema&#46;</p> <p>Shadow (<code>gem install shadow</code>) is a REST&#45;ful record server &#45;&#45; a small Mongrel handler that allows you to manipulate the database remotely&#46; It uses dynamic ActiveRecord classes that are created and trashed for each request&#46;</p> <p>Parallelization &#45;&#45; uses the Sun 1 grid engine that distributes shell scripts across 128 nodes&#46; Used for job and backend processing&#46;</p> <p>bioruby/bioperl/biopython &#45;&#45; bioinformatics libraries in other languages &#45;&#45; bioruby is not complete, but we still want to use Ruby, so he looked at ways of integrating Ruby with other languages&#46; No RubyInline for Perl or Python, no up&#45;to&#45;date direct/C bindings&#46; He ended up building a socket&#45;level interface into python&#46;</p> <p>Admin tools to consider &#45;&#45; streamlined, active_scaffold, autoadmin, Django (<code>manage.py inspectdb; manage.py syncdb; manage.py runserver</code>)&#46; (Wow, come to RailsConf, get a Django demo&#46; Unexpected surprise!)</p> <p>Extending Rails &#45;&#45; <code>has_many_polymorphs</code> for easy creation directed graphs</p> <p>Frustrating AR tidbits: <code>has_many_through</code> has a huge case statement, with sql strings everywhere, and tightly intertwined classes&#46; Ugh&#46;</p> <p>Scaling big webapps: AR/SQL is not the way&#46; Instead, go to a hyper&#45;denormalized model, where the DB is just a big hash&#46; This leads to things like berkeleydb, memcached, madeleine, etc&#46; and MySQL just becomes a persistence store for memcache&#46; One key is moving joins at write&#45;time, so that reads don&#8217;t need to re&#45;join associations&#46; You&#8217;re essentially duplicating/caching the data out to each association, but this makes sharding/splitting of data easier&#46; Example: Flickr user photos vs&#46; photos placed in a group&#46;</p> <p>Evan doesn&#8217;t believe that SQL is a viable data store for webapps &#45;&#45; I think he means large&#45;scale webapps&#46; Not everyone who&#8217;s trying to build a web application will run into these kinds of issues, so your mileage may vary&#46; Still, it&#8217;s refreshing to see more people rebel against the incumbent 30&#45;year gorilla of SQL&#46;</p> Nick Sieger urn:uuid:50294722-50b0-41d1-8034-6c47be216960 2007-05-17T17:35:00+00:00 2010-11-22T18:23:56+00:00 RailsConf Releases <p>Just a quick update&#46; Firstly, I just released ci_reporter 1&#46;3; it should be available in the gem index shortly&#46; Thanks to Bret Pettichord, Jeremy Beheler, and Charlie Kunz for reporting issues and prodding me to fix a couple of bugs&#46; The two new items in this release are:</p> <ul> <li>RSpec 0&#46;9/trunk&#45;compatible&#46; You can now <a href="http://rspec.rubyforge.org/"><code>describe/it</code></a> all you want with ci_reporter&#46;</li> <li>Errors and failure stack traces now include the full error message and exception type&#46;</li> </ul> <p>Secondly, JRuby 1&#46;0RC2 has been released&#46; Although there is no official release announcement at the moment, it is <a href="http://dist.codehaus.org/jruby/">available for download</a> and has been propagated to the central Maven repository also&#46; Please do check it out and let us know on the <a href="http://xircles.codehaus.org/projects/jruby/lists">mailing lists</a> or in <a href="http://jira.codehaus.org/browse/JRUBY">JIRA</a> if you come across any blocker issues or regressions&#46; Just a couple more weeks of stabilization; expect a rockin&#8217; 1&#46;0 release in June!</p> <p>Lastly, expect an <a href="http://jruby-extras.rubyforge.org/ActiveRecord-JDBC/">ActiveRecord&#45;JDBC 0&#46;3&#46;2</a> release Real Soon Now&#46;</p>