<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
  <id>http://rails.pixnet.net/blog</id>
  <title><![CDATA[Always on Rails:: 痞客邦 PIXNET ::]]></title>
  <author>
    <name>rails</name>
    <email>rails@not-valid.com</email>
  </author>
  <updated>2009-10-16T14:38:30+08:00</updated>
  <published>2009-10-16T14:38:30+08:00</published>
  <link rel="self" href="http://rails.pixnet.net/blog" hreflang="zh"/>
  <subtitle><![CDATA[xdite 主筆的 Ruby on Rails 部落格]]></subtitle>
  <rights>Copyright 2003-2009 rails,Pixnet Digital Media Coporation. All rights reserved.</rights>
  <generator>PIXNET Media Digital Coporation</generator>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/29565604</id>
    <title><![CDATA[[Basic] 一些新手學習 rails 可以當做 example 的 application ]]></title>
    <updated>2009-10-16T14:38:30+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/29565604"/>
    <summary><![CDATA[Jetpack Blog 10/14 整理了一篇 High Quality Ruby on Rails Example Applications

練功時可以參考別人的寫法

]]></summary>
    <content type="html"><![CDATA[Jetpack Blog 10/14 整理了一篇 <a href="http://jetpackweb.com/blog/2009/10/14/high-quality-ruby-on-rails-example-applications/">High Quality Ruby on Rails Example Applications</a><br />
<br />
練功時可以參考別人的寫法<br />
<br />
  <div class="more"><a href="http://rails.pixnet.net/blog/post/29565604">(Read More...)</a></div>]]></content>
    <category term="General Turtorial"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/29565604#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/29565569</id>
    <title><![CDATA[[Scale] Scale Frontend 應該注意的五件事]]></title>
    <updated>2009-10-16T14:34:13+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/29565569"/>
    <summary><![CDATA[EngineYard Blog 10/13 發表的一篇文章：Rails in the Wild: 5 Client-Side Performance Observations

五個重點：

1. It’s easy to forget to compress your JavaScript and CSS

要記得 :cache => true

2. Watch out for slow third party services

都是慢在第三方

3. Using multiple image hosts doesn’t always mean higher performance

拆那麼多台未必會比較快

4. S3 is NOT a Webserver!

S3 是 storage ，不是 web server。所以不要一股腦的把東西往上丟，要注意有沒有敏感資訊，而且 s3p 是沒有幫忙做 gzip 的。

5. Most performance variability is NOT attributable to page factors

速度慢通常是慢在後端..]]></summary>
    <content type="html"><![CDATA[EngineYard Blog 10/13 發表的一篇文章：<a href="http://www.engineyard.com/blog/2009/rails-in-the-wild-5-client-side-performance-observations/">Rails in the Wild: 5 Client-Side Performance Observations</a><br />
<br />
五個重點：<br />
<br />
1. <strong>It’s easy to forget to compress your JavaScript and CSS<br />
</strong><br />
要記得 :cache => true<br />
<br />
2. <strong>Watch out for slow third party services</strong><br />
<br />
都是慢在第三方<br />
<br />
3. <strong>Using multiple image hosts doesn’t always mean higher performance</strong><br />
<br />
拆那麼多台未必會比較快<br />
<br />
4. <strong>S3 is NOT a Webserver!<br />
</strong><br />
S3 是 storage ，不是 web server。所以不要一股腦的把東西往上丟，要注意有沒有敏感資訊，而且 s3p 是沒有幫忙做 gzip 的。<br />
<br />
5. <strong>Most performance variability is NOT attributable to page factors<br />
</strong><br />
速度慢通常是慢在後端..  <div class="more"><a href="http://rails.pixnet.net/blog/post/29565569">(Read More...)</a></div>]]></content>
    <category term="Scaling Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/29565569#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/29565472</id>
    <title><![CDATA[[寄信] 使用 Mad Mini 發送電子報]]></title>
    <updated>2009-10-16T14:14:06+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/29565472"/>
    <summary><![CDATA[這是今天在 EnvyLab 看到的一篇文章所提到的新 starup Mad Mini。

一般傳統寄信的做法通常是靠 ActionMailler 去寄。不過 ActionMailer 本身有相當多的問題，大量使用會有維護上的困難。

這篇文章的建議是使用 Mad Mini API 取代掉 deliver method ，而不自己 maintain server 的做法....]]></summary>
    <content type="html"><![CDATA[這是今天在 EnvyLab 看到的<a href="http://blog.envylabs.com/summit/">一篇文章</a>所提到的新 starup <a href="http://madmimi.com/">Mad Mini</a>。<br />
<br />
一般傳統寄信的做法通常是靠 ActionMailler 去寄。不過 ActionMailer 本身有相當多的問題，大量使用會有維護上的困難。<br />
<br />
這篇文章的建議是使用 <a href="http://developer.madmimi.com/">Mad Mini API</a> 取代掉 deliver method ，而不自己 maintain server 的做法....  <div class="more"><a href="http://rails.pixnet.net/blog/post/29565472">(Read More...)</a></div>]]></content>
    <category term="Development Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/29565472#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/29552394</id>
    <title><![CDATA[[Scale] 使用不同 backend 做 Cache]]></title>
    <updated>2009-10-14T18:50:07+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/29552394"/>
    <summary><![CDATA[在開發時，使用 partial 是相當簡潔以及迅速的做法。但這會帶來一個壞處。造成相當多的  db query 以及 render :partial 這個行為帶來的 slow down。

解法是，在 controller 下 find all 時，順便下 :include ，把相關的 model 都拉一拉回來。

至於 partial 這部份，就使用 fragment cache 的做法，把 html 丟進 memcache ..XD。時間到 expire 掉。

這樣噴頁面速度就會相當快。

目前我使用的是 Handcache + Moneta。

Moneta supports 相當多的 backend 

* File store for xattr
* Basic File Store
* Memcache store
* In-memory store
* The xattrs in a file system
* DataMapper
* S3
* Berkeley DB
* Redis
* SDBM
* Tokyo
* CouchDB

]]></summary>
    <content type="html"><![CDATA[在開發時，使用 partial 是相當簡潔以及迅速的做法。但這會帶來一個壞處。造成相當多的  db query 以及 render :partial 這個行為帶來的 slow down。<br />
<br />
解法是，在 controller 下 find all 時，順便下 :include ，把相關的 model 都拉一拉回來。<br />
<br />
至於 partial 這部份，就使用 fragment cache 的做法，把 html 丟進 memcache ..XD。時間到 expire 掉。<br />
<br />
這樣噴頁面速度就會相當快。<br />
<br />
目前我使用的是 <a href="http://github.com/ihower/handcache">Handcache</a> + <a href="http://github.com/wycats/moneta">Moneta</a>。<br />
<br />
<a href="http://github.com/wycats/moneta">Moneta</a> supports 相當多的 backend <br />
<br />
* File store for xattr<br />
* Basic File Store<br />
* Memcache store<br />
* In-memory store<br />
* The xattrs in a file system<br />
* DataMapper<br />
* S3<br />
* Berkeley DB<br />
* Redis<br />
* SDBM<br />
* Tokyo<br />
* CouchDB<br />
<br />
  <div class="more"><a href="http://rails.pixnet.net/blog/post/29552394">(Read More...)</a></div>]]></content>
    <category term="Scaling Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/29552394#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/29552365</id>
    <title><![CDATA[[Scale] Rails 接 cluster db]]></title>
    <updated>2009-10-14T18:46:58+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/29552365"/>
    <summary><![CDATA[使用 Data Fabric 這個 gem。

這個 gem 的想法是建一個 proxy，先去問 mapping table，然後要資料時 reset db connection 去該負責的 db 拿資料。]]></summary>
    <content type="html"><![CDATA[使用 <a href="http://github.com/fiveruns/data_fabric">Data Fabric</a> 這個 gem。<br />
<br />
這個 gem 的想法是建一個 proxy，先去問 mapping table，然後要資料時 reset db connection 去該負責的 db 拿資料。  <div class="more"><a href="http://rails.pixnet.net/blog/post/29552365">(Read More...)</a></div>]]></content>
    <category term="Scaling Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/29552365#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/29552354</id>
    <title><![CDATA[[Scale] Rails Application 接兩個以上的 db]]></title>
    <updated>2009-10-14T18:44:31+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/29552354"/>
    <summary><![CDATA[Splitting up Rails Models to different databases

然後在 lib/tasks/dev.rake 裡寫 override db:create; db:drop 的 rake; 確保重建資料時一致

]]></summary>
    <content type="html"><![CDATA[<a href="http://www.elctech.com/tutorials/splitting-up-rails-models-to-different-databases">Splitting up Rails Models to different databases</a><br />
<br />
然後在 lib/tasks/dev.rake 裡寫 override db:create; db:drop 的 rake; 確保重建資料時一致<br />
<br />
  <div class="more"><a href="http://rails.pixnet.net/blog/post/29552354">(Read More...)</a></div>]]></content>
    <category term="Scaling Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/29552354#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/29463682</id>
    <title><![CDATA[[Trick]多重 asset_host]]></title>
    <updated>2009-10-04T17:31:33+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/29463682"/>
    <summary><![CDATA[可指定 asset_host 為 http://asset%d.example.com

或



Yehuda 在 WindyCindyRails 2009 分享的技巧。]]></summary>
    <content type="html"><![CDATA[可指定 asset_host 為 http://asset%d.example.com<br />
<br />
或<br />
<br />
<script src="http://gist.github.com/201283.js"></script><br />
<br />
Yehuda 在 <a href="http://vimeo.com/6703956">WindyCindyRails 2009 </a>分享的技巧。  <div class="more"><a href="http://rails.pixnet.net/blog/post/29463682">(Read More...)</a></div>]]></content>
    <category term="Scaling Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/29463682#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/29250407</id>
    <title><![CDATA[Plugin: Oink]]></title>
    <updated>2009-09-09T10:00:39+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/29250407"/>
    <summary><![CDATA[http://github.com/noahd1/oink/tree/master

Description

Rails plugin and log parser to help narrow down the source(s) of increased memory usage in rails applications.
Synopsis

Oink adds memory and active record instantiation information to rails log during runtime and provides an executable to help digest the enhanced logs.

Given a minimum threshold and a metric (memory or active record instantiation), the oink executable reports:

   1. The top ten single requests which exceeded the threshold for the metric, ordered by the request which exceeded the threshold the most
   2. The number of times each action exceeded the threshold for the metric, ordered by the action which exceeded the threshold the most
   3. (in verbose mode) The log lines produced by requests which exceeded the threshold

協助降低 Rails Application 降低記憶體用量的 plugin

]]></summary>
    <content type="html"><![CDATA[<a href="http://github.com/noahd1/oink/tree/master">http://github.com/noahd1/oink/tree/master</a><br />
<br />
Description<br />
<br />
Rails plugin and log parser to help narrow down the source(s) of increased memory usage in rails applications.<br />
Synopsis<br />
<br />
Oink adds memory and active record instantiation information to rails log during runtime and provides an executable to help digest the enhanced logs.<br />
<br />
Given a minimum threshold and a metric (memory or active record instantiation), the oink executable reports:<br />
<br />
   1. The top ten single requests which exceeded the threshold for the metric, ordered by the request which exceeded the threshold the most<br />
   2. The number of times each action exceeded the threshold for the metric, ordered by the action which exceeded the threshold the most<br />
   3. (in verbose mode) The log lines produced by requests which exceeded the threshold<br />
<br />
協助降低 Rails Application 降低記憶體用量的 plugin<br />
<br />
  <div class="more"><a href="http://rails.pixnet.net/blog/post/29250407">(Read More...)</a></div>]]></content>
    <category term="Development Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/29250407#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/29208536</id>
    <title><![CDATA[[懶人] Magick Installer]]></title>
    <updated>2009-09-04T16:33:14+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/29208536"/>
    <summary><![CDATA[因為 rmagick 在 MacOS 下實在太難裝了。於是有人寫了一支 script 來處理這種惱人的事。

http://github.com/maddox/magick-installer]]></summary>
    <content type="html"><![CDATA[因為 rmagick 在 MacOS 下實在太難裝了。於是有人寫了一支 script 來處理這種惱人的事。<br />
<a href=" http://github.com/maddox/magick-installer"><br />
http://github.com/maddox/magick-installer</a>  <div class="more"><a href="http://rails.pixnet.net/blog/post/29208536">(Read More...)</a></div>]]></content>
    <category term="Development Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/29208536#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/29198274</id>
    <title><![CDATA[[Scale] 在 Rails Project 對 Database 打 index 應該注意的一些事項]]></title>
    <updated>2009-09-03T11:15:54+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/29198274"/>
    <summary><![CDATA[Matt Jankowski provided a great article on properly indexing your database for your Rails application. He covers indexing validation and STI columns, state columns for state machines, association columns, and more.]]></summary>
    <content type="html"><![CDATA[<p>Matt Jankowski provided a great article on <a href="http://robots.thoughtbot.com/post/163627511/a-grand-piano-for-your-violin">properly indexing your database</a> for your Rails application. He covers indexing validation and <span class="caps">STI</span> columns, state columns for state machines, association columns, and more.</p>  <div class="more"><a href="http://rails.pixnet.net/blog/post/29198274">(Read More...)</a></div>]]></content>
    <category term="Development Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/29198274#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/28941631</id>
    <title><![CDATA[Set Your Server Right]]></title>
    <updated>2009-08-07T12:43:02+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/28941631"/>
    <summary><![CDATA[怎樣 SETUP 好你的 production 環境的指南

Set Up Your Server Right, Part 1
]]></summary>
    <content type="html"><![CDATA[怎樣 SETUP 好你的 production 環境的指南<br />
<br />
<a href="http://blog.envylabs.com/2009/08/set-up-your-server-right-part-1/">Set Up Your Server Right, Part 1</a><br />
  <div class="more"><a href="http://rails.pixnet.net/blog/post/28941631">(Read More...)</a></div>]]></content>
    <category term="Deployment"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/28941631#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/28897627</id>
    <title><![CDATA[[Basic] Git Basics at Rails]]></title>
    <updated>2009-08-03T11:37:53+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/28897627"/>
    <summary><![CDATA[用 Git 管理 Rails Project 的一些基本指令和 Workflow，一樣也出自 Rails Undergroud。

Git Basics at Rails UndergroundView more presentations from Ariejan De vroom.]]></summary>
    <content type="html"><![CDATA[用 Git 管理 Rails Project 的一些基本指令和 Workflow，一樣也出自 Rails Undergroud。<br />
<br />
<div style="width:425px;text-align:left" id="__ss_1764707"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/ariejan/git-basics-at-rails-underground" title="Git Basics at Rails Underground">Git Basics at Rails Underground</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gitbasics-railsunderground-090724095204-phpapp01&stripped_title=git-basics-at-rails-underground" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gitbasics-railsunderground-090724095204-phpapp01&stripped_title=git-basics-at-rails-underground" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/ariejan">Ariejan De vroom</a>.</div></div>  <div class="more"><a href="http://rails.pixnet.net/blog/post/28897627">(Read More...)</a></div>]]></content>
    <category term="Deployment"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/28897627#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/28897237</id>
    <title><![CDATA[Rails I18n From The Trenches]]></title>
    <updated>2009-08-03T11:31:56+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/28897237"/>
    <summary><![CDATA[Rails Undergroud 上的投影片。會收這篇主要是因為教導了如何在翻譯檔裡下條件式判斷...

Rails I18n From The TrenchesView more documents from clemensk.]]></summary>
    <content type="html"><![CDATA[Rails Undergroud 上的投影片。會收這篇主要是因為教導了如何在翻譯檔裡下條件式判斷...<br />
<br />
<div style="width:425px;text-align:left" id="__ss_1767916"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/clemensk/rails-i18n-from-the-trenches" title="Rails I18n From The Trenches">Rails I18n From The Trenches</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=railsi18nfromthetrenches-090725085720-phpapp02&stripped_title=rails-i18n-from-the-trenches" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=railsi18nfromthetrenches-090725085720-phpapp02&stripped_title=rails-i18n-from-the-trenches" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/clemensk">clemensk</a>.</div></div>  <div class="more"><a href="http://rails.pixnet.net/blog/post/28897237">(Read More...)</a></div>]]></content>
    <category term="Development Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/28897237#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/28763862</id>
    <title><![CDATA[Pragmatic Patterns of Ruby on Rails]]></title>
    <updated>2009-07-22T10:42:47+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/28763862"/>
    <summary><![CDATA[這是 RubyKaigi 2009 上的演講，是一份指導寫出高品質的 Ruby on Rails 的投影片。對新手很有幫助。

這裡也有人對這份投影片做了摘要。

Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009View more documents from nay.]]></summary>
    <content type="html"><![CDATA[這是 RubyKaigi 2009 上的演講，是一份指導寫出高品質的 Ruby on Rails 的投影片。對新手很有幫助。<br />
<br />
這裡也有人對<a href="http://d.hatena.ne.jp/LukeSilvia/20090719/p1">這份投影片做了摘要</a>。<br />
<br />
<div style="width:425px;text-align:left" id="__ss_1735096"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/nay/pragmatic-patterns-of-ruby-on-rails-ruby-kaigi2009-1735096" title="Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009">Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rubykaigi2009-090717101103-phpapp01&stripped_title=pragmatic-patterns-of-ruby-on-rails-ruby-kaigi2009-1735096" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rubykaigi2009-090717101103-phpapp01&stripped_title=pragmatic-patterns-of-ruby-on-rails-ruby-kaigi2009-1735096" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/nay">nay</a>.</div></div>  <div class="more"><a href="http://rails.pixnet.net/blog/post/28763862">(Read More...)</a></div>]]></content>
    <category term="Development Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/28763862#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/27999632</id>
    <title><![CDATA[[懶人] Ubuntu / Debian + nginx + mod_rails]]></title>
    <updated>2009-05-28T21:52:38+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/27999632"/>
    <summary><![CDATA[rails-nginx-passenger-ubuntu 

Ubuntu / Debian ，尤其是 Debian ...在 setup 基本環境時，用預設的 apt-get 安裝 ruby & rails 環境以及一些常用的 gem（如 RMagick)，會有一堆奇怪的相依性問題。

有人整理了使用這份 recipes，照著裝會相當順利 ...。裡面也附贈了啟動/關閉 nginx 的 script，使用時要記得修改套件的路徑。  ]]></summary>
    <content type="html"><![CDATA[<a href="http://github.com/jnstq/rails-nginx-passenger-ubuntu/tree/master">rails-nginx-passenger-ubuntu </a><br />
<br />
Ubuntu / Debian ，尤其是 Debian ...在 setup 基本環境時，用預設的 apt-get 安裝 ruby & rails 環境以及一些常用的 gem（如 RMagick)，會有一堆奇怪的相依性問題。<br />
<br />
有人整理了使用這份 recipes，照著裝會相當順利 ...。裡面也附贈了啟動/關閉 nginx 的 script，使用時要記得修改套件的路徑。    <div class="more"><a href="http://rails.pixnet.net/blog/post/27999632">(Read More...)</a></div>]]></content>
    <category term="Deployment"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/27999632#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/27999391</id>
    <title><![CDATA[[懶人] Youvegotrails - 自動產生 Rails Template]]></title>
    <updated>2009-05-28T21:30:35+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/27999391"/>
    <summary><![CDATA[  ]]></summary>
    <content type="html"><![CDATA[ <a href="http://www.youvegotrails.com/"><img src="http://pic.pimg.tw/xdite/4a1e93350766f.png" border="0" title="yougotrails.png" alt="yougotrails.png" /> </a>  <div class="more"><a href="http://rails.pixnet.net/blog/post/27999391">(Read More...)</a></div>]]></content>
    <category term="Deployment"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/27999391#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/27998678</id>
    <title><![CDATA[Roodi - parses your code and warns you about design problems.]]></title>
    <updated>2009-05-28T20:42:25+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/27998678"/>
    <summary><![CDATA[Roodi parses your code and warns you about design problems.]]></summary>
    <content type="html"><![CDATA[<a href="http://github.com/martinjandrews/roodi/tree/master">Roodi</a> parses your code and warns you about design problems.  <div class="more"><a href="http://rails.pixnet.net/blog/post/27998678">(Read More...)</a></div>]]></content>
    <category term="Ruby Gems"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/27998678#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/27998664</id>
    <title><![CDATA[Flay - finds code duplication in your project.]]></title>
    <updated>2009-05-28T20:39:40+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/27998664"/>
    <summary><![CDATA[Flay finds code duplication in your project.
]]></summary>
    <content type="html"><![CDATA[<a href="http://ruby.sadi.st/Flay.html">Flay</a> finds code duplication in your project.<br />
  <div class="more"><a href="http://rails.pixnet.net/blog/post/27998664">(Read More...)</a></div>]]></content>
    <category term="Ruby Gems"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/27998664#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/27998602</id>
    <title><![CDATA[[Scale] Scaling Rails Application 的五個小技巧]]></title>
    <updated>2009-05-28T20:27:41+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/27998602"/>
    <summary><![CDATA[原文刊載於 EngineYard 。

1) Cache, cache, cache and more cache.
能 Cache 的盡量 cache，不論是 Client Caching 或者是 Server-side Caching。

2) Segregate data and data serving
別為了方便就只用一個 DB 硬撐。把靜態檔案能扔上 CDN （S3, Akamai ...）的就扔。一些特定的簡單 model 可以考慮拆開用 key-value 的 data store 作...

3) Minimize & handle external dependencies
降低對於 external sites 的 dependencies, 例如抓外界 RSS 這件事，因為太不可預期了....

4) Tend your database and your job handlers
檢視 SQL Query 與 背景工作所消耗的資源量...

5) Shard your unavoidably relational data

對 DB 作 Sharding 。]]></summary>
    <content type="html"><![CDATA[<a href="http://www.engineyard.com/blog/2009/5-tips-to-scale-your-ror-application/">原文刊載於 EngineYard</a> 。<br />
<br />
1) <strong>Cache, cache, cache and more cache.</strong><br />
能 Cache 的盡量 cache，不論是 Client Caching 或者是 Server-side Caching。<br />
<br />
2) <strong>Segregate data and data serving</strong><br />
別為了方便就只用一個 DB 硬撐。把靜態檔案能扔上 CDN （S3, Akamai ...）的就扔。一些特定的簡單 model 可以考慮拆開用 key-value 的 data store 作...<br />
<br />
3) <strong>Minimize & handle external dependencies</strong><br />
降低對於 external sites 的 dependencies, 例如抓外界 RSS 這件事，因為太不可預期了....<br />
<br />
4) <strong>Tend your database and your job handlers</strong><br />
檢視 SQL Query 與 背景工作所消耗的資源量...<br />
<br />
5) <strong>Shard your unavoidably relational data</strong><br />
<br />
對 DB 作 Sharding 。  <div class="more"><a href="http://rails.pixnet.net/blog/post/27998602">(Read More...)</a></div>]]></content>
    <category term="Scaling Tips"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/27998602#comments</wfw:comment>
  </entry>
  <entry xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <id>http://rails.pixnet.net/blog/post/27997784</id>
    <title><![CDATA[進階學習 Ruby on Rails （2009）]]></title>
    <updated>2009-05-28T19:36:53+08:00</updated>
    <link rel="alternate" href="http://rails.pixnet.net/blog/post/27997784"/>
    <summary><![CDATA[原文連結
上一篇提及了一些入門必練的基礎。而現在要繼續寫的是進階篇。大致分為兩個方向：隨心所欲整合 / Scale 與 Deploy* 隨心所欲的整合
1. 認識更多的 Plugin / Gem，減少重造輪子的機會Gem / Plugin 的擴充性一向對 Rails 的開發加速作用有大大的加分效果。- Github 或 RubyForge- RailsEnvy 每週介紹 新穎 / 亮眼 / 實用 / whatever 的 gem / plugin 與新知2. 可以移植到其他專案的好用 code，重寫成 plugin 或者 porting 成 Rails Engine。撰寫自己的 Template。Plugin Patterns (Peepcode) 想學會寫 Rails plugin 請看這份 PDF 。Rails Engine # 把以前的 app 當成一個 plugin 使用Rails Template # 每次開專案都會安裝的套件以及執行的動作寫成 Template3. 開發自己的 View Helper 以及 Form builder。Rails 不僅僅提供好用的 helper，甚至你可以利用 Rails 提供的 API 撰寫自己的 Helper 和 Builder。為自己的專案套上 standard layout 以及減少寫噁心 html 的機會。 handicaft_interfaces handicraft_ujs handicraft_helper建議閱讀 ihower 在上次 Ruby Tuesday 釋出的 Building Web Interface on Rails，以及把玩 ihower 在 github 上提供的 demo application。這次的 demo 含了 Rails3 提供的 Unobtrusive Javascript 的概念實作，使用 jQuery on Rails 作為範例。4. 對於各項第三方整合方案的熟悉 Rails 只是一套網頁框架，但它並不是阿拉丁神燈。比如說你需要搜尋功能、付款功能、寄送簡訊、與 IM 整合 ...。Rails 當然 ....*不可能* 內建。雖然比較少書籍在介紹這方面的資訊，但是有幾個 Site 出了不錯的 Video Turtorial（付費 / 不付費都有..)。Peepcode  RailscastsAsciiCasts # Railscasts 的圖文教學版 ...Railskits # 當然你有能力開發、有能力改，但沒時間從頭開發，也可以從這裡買 Solution 回去改 ...5. Deep in Ruby / RailsAdvanced Rails (O&rsquo;Reilly) 難得真的有 Advanced 到的書Writing Efficient Ruby Code (Addison Wesley shortcut PDF) Code Review (Peepcode)
* Scale 與 Deploy當站大了（code 變多, query 變多 , 活動變多 ) 以後就會遇到架構複雜 / 速度慢的問題。有幾個方向是可以鑽研的
1. 換掉 Ruby 。well ... Ruby 有很多種版本，也許你可以嘗試換上 Ruby Enterprise 節省記憶體以及改善 GC 。2. 嘗試不同的 Web Server / Rails Web server，找出最適合的搭配。Mongrel / Thin / mod_rails / FastCGI +  Apache / Nginx / lighthttpd 都是可以嘗試的組合。3. 使用 Rails Metal 或拆散架構 Rails 不是萬能框架，也沒必要用 Rails 這種肥重框架單做簡單的事（如 API 的提供）。能改用其他語言或其他框架（Sinatra）都是可以嘗試的方法 ...。Sinatra with ActiveRecord 的整合方法，我寫了一份 demo 放在 github 上。4. 檢視 SQL Query 與 Code 效率。可以使用 NewRelic RPM ，監視整個網站。找出下的不好的 query，或者是寫的不好的 ORM 語法改善。關於 ActiveRecord 的基礎與進階可以參考 RailsEnvy 出的 Advanced ActiveRecord 和 Pragprog 出的 Everyday ActiveRecord。少用 join，多用幾個 select 達到同樣的效果，必要時自己手寫 query...Code 效率可參考 "Deep in Ruby / Rails" 的書單 ...5. Scaling Rails 看完照著 tune，能 cache 的就 cache ..6. Monitor Hoptoad #500 自動寄信 / 整理 log God  # 監視誰死掉了，記憶體吃太多，自動重開 ....7. Deploy 機器很多架構複雜，update code 重開麻煩。就寫個 Capistrano Recipes 幫你的忙吧 ...。也可搭配 Chef。8. EC2onrails懶人架構，前提是要熟 EC2 與 Capistrano ...9. 雲端：Heroku / GAE有興趣可以參考上個月我寫的這一篇的 Sinatra on the Cloud。
其他 Scale 和架構 design 的東西就都屬於 General Scaling Knowledge，就不在這篇專講 Rails 的文章詳述下去...。* 總結練到最後其實就是固定訂一些重要的 feed 來看，有新東西就練和寫心得 ...這樣會進步的非常快。只看書當然不可能比直接看 API 和 blog post 學的快...介紹幾個消息來源是值得訂的：
RailsEnvyRuby on Rails Official BlogRubyInsideDr. NicYahuda KatzRick Olson
每一次當 Rails 界舉辦 Conf ，例如 RailsConf 2009 或者是 Acts as Conference 2009，其實也都還蠻多 slides 和 video 可以看，看完以後知識會長不少 ....
railsconf 2009 的 video 與 slides act_as_conf 2009 的 video 
希望提供這些資訊能讓大家對學習和練習有個方向....]]></summary>
    <content type="html"><![CDATA[<p><a href="http://blog.xdite.net/?p=1227">原文連結</a><br /></p>
<p><a href="http://blog.xdite.net/?p=1190">上一篇</a>提及了一些入門必練的基礎。而現在要繼續寫的是進階篇。大致分為兩個方向：隨心所欲整合 / Scale 與 Deploy<br /><br /><span style="font-size: 14pt;"><strong>* 隨心所欲的整合</strong></span><br /><br /></p>
<blockquote><strong>1. 認識更多的 Plugin / Gem，減少重造輪子的機會</strong><br />Gem / Plugin 的擴充性一向對 Rails 的開發加速作用有大大的加分效果。<br />- <a href="http://github.com">Github</a> 或 <a href="http://rubyforge.org">RubyForge</a><br />- <a href="http://railsenvy.com">RailsEnvy</a> 每週介紹 新穎 / 亮眼 / 實用 / whatever 的 gem / plugin 與新知<br /><br />2. <strong>可以移植到其他專案的好用 code，重寫成 plugin 或者 porting 成 <a href="http://blog.xdite.net/?p=1126">Rails Engine</a>。撰寫自己的 <a href="http://blog.xdite.net/?p=1133">Template</a></strong>。<br /><a href="https://peepcode.com/products/rails-2-plugin-patterns">Plugin Patterns (Peepcode)</a> 想學會寫 Rails plugin 請看這份 PDF 。<br />Rails Engine # 把以前的 app 當成一個 plugin 使用<br />Rails Template # 每次開專案都會安裝的套件以及執行的動作寫成 Template<br /><br />3.<strong> 開發自己的 View Helper 以及 Form builder</strong>。<br />Rails 不僅僅提供好用的 helper，甚至你可以利用 Rails 提供的 API 撰寫自己的 Helper 和 Builder。為自己的專案套上 standard layout 以及減少寫噁心 html 的機會。<br /> <a href="http://github.com/ihower/handicraft-interfaces/tree/master">handicaft_interfaces</a><br /> <a href="http://github.com/ihower/handicraft_ujs/tree/master">handicraft_ujs</a><br /> <a href="http://github.com/ihower/handicraft_helper/tree/master">handicraft_helper</a><br /><br />建議閱讀 ihower 在上次 Ruby Tuesday 釋出的 <a href="http://www.slideshare.net/ihower/building-web-interface-on-rails?type=presentation">Building Web Interface on Rails</a>，以及把玩 ihower 在 github 上提供的 demo application。這次的 demo 含了 Rails3 提供的 Unobtrusive Javascript 的概念實作，使用 jQuery on Rails 作為範例。<br /><br />4. <strong>對於各項第三方整合方案的熟悉 </strong><br /><br />Rails 只是一套網頁框架，但它並不是阿拉丁神燈。比如說你需要搜尋功能、付款功能、寄送簡訊、與 IM 整合 ...。Rails 當然 ....<strong>*不可能*</strong> 內建。雖然比較少書籍在介紹這方面的資訊，但是有幾個 Site 出了不錯的 Video Turtorial（付費 / 不付費都有..)。<br /><br /><a href="http://peepcode.com">Peepcode</a>  <br /><a href="http://railscasts.com/">Railscasts</a><br /><a href="http://asciicasts.com">AsciiCasts</a> # Railscasts 的圖文教學版 ...<br /><br /><a href="http://railskits.com/">Railskits</a> # 當然你有能力開發、有能力改，但沒時間從頭開發，也可以從這裡買 Solution 回去改 ...<br /><br />5. <strong>Deep in Ruby / Rails</strong><br /><a href="http://www.oreilly.com/catalog/9780596510329/index.html">Advanced Rails (O&rsquo;Reilly)</a> 難得真的有 Advanced 到的書<br />Writing Efficient Ruby Code (Addison Wesley shortcut PDF) <br />Code Review (Peepcode)</blockquote>
<p><br /><br /><br /><strong><br />*<span style="font-size: 14pt;"> Scale 與 Deploy</span></strong><br /><br />當站大了（code 變多, query 變多 , 活動變多 ) 以後就會遇到架構複雜 / 速度慢的問題。有幾個方向是可以鑽研的<br /><br /></p>
<blockquote>1. <strong>換掉 Ruby </strong>。<br />well ... Ruby 有很多種版本，也許你可以嘗試換上 <a href="http://www.rubyenterpriseedition.com/">Ruby Enterprise</a> 節省記憶體以及改善 GC 。<br /><br />2. <strong>嘗試不同的 Web Server / Rails Web server，找出最適合的搭配</strong>。<br />Mongrel / Thin / mod_rails / FastCGI +  Apache / Nginx / lighthttpd 都是可以嘗試的組合。<br /><br />3. <strong>使用 <a href="http://weblog.rubyonrails.org/2008/12/17/introducing-rails-metal">Rails Metal</a> 或拆散架構 </strong><br />Rails 不是萬能框架，也沒必要用 Rails 這種肥重框架單做簡單的事（如 API 的提供）。能改用其他語言或其他框架（<a href="http://www.sinatrarb.com/ ">Sinatra</a>）都是可以嘗試的方法 ...。<br />Sinatra with ActiveRecord 的整合方法，我寫了一份 <a href="http://github.com/xdite/twitter-message-wall/tree/master">demo</a> 放在 github 上。<br /><br />4. <strong>檢視 SQL Query 與 Code 效率</strong>。<br />可以使用 <a href="http://www.newrelic.com/">NewRelic</a> RPM ，監視整個網站。找出下的不好的 query，或者是寫的不好的 ORM 語法改善。<br /><br />關於 ActiveRecord 的基礎與進階可以參考 RailsEnvy 出的 <a href="http://envycasts.com/products/advanced-activerecord">Advanced ActiveRecord</a> 和 Pragprog 出的 <a href="http://www.pragprog.com/screencasts/v-rbar/everyday-active-record">Everyday ActiveRecord</a>。少用 join，多用幾個 select 達到同樣的效果，必要時自己手寫 query...<br /><br />Code 效率可參考 "Deep in Ruby / Rails" 的書單 ...<br /><br />5. <strong><a href="http://railslab.newrelic.com/scaling-rails">Scaling Rails</a></strong> <br />看完照著 tune，能 cache 的就 cache ..<br /><br />6. <strong>Monitor </strong><br /><a href="http://hoptoadapp.com/welcome">Hoptoad</a> #500 自動寄信 / 整理 log <br /><a href="http://god.rubyforge.org/">God</a>  # 監視誰死掉了，記憶體吃太多，自動重開 ....<br /><br />7. <strong>Deploy </strong><br />機器很多架構複雜，update code 重開麻煩。就寫個 <a href="http://www.capify.org/">Capistrano</a> Recipes 幫你的忙吧 ...。也可搭配 <a href="http://www.orug.org/articles/2009/05/18/cooking-with-chef">Chef</a>。<br /><br />8. <strong><a href="http://ec2onrails.rubyforge.org/">EC2onrails</a></strong><br />懶人架構，前提是要<a href="http://blog.xdite.net/?p=734">熟 EC2</a> 與 Capistrano ...<br /><br />9. <strong>雲端：<a href="http://heroku.com">Heroku</a> / GAE</strong><br />有興趣可以參考上個月我寫的這一篇的 <a href="http://blog.xdite.net/?p=1152">Sinatra on the Cloud</a>。</blockquote>
<p><br /><br />其他 Scale 和架構 design 的東西就都屬於 General Scaling Knowledge，就不在這篇專講 Rails 的文章詳述下去...。<br /><br />* 總結<br /><br />練到最後其實就是固定訂一些重要的 feed 來看，有新東西就練和寫心得 ...這樣會進步的非常快。只看書當然不可能比直接看 API 和 blog post 學的快...<br />介紹幾個消息來源是值得訂的：<br /></p>
<blockquote><br /><a href="http://www.railsenvy.com/">RailsEnvy</a><br /><a href="http://weblog.rubyonrails.org/">Ruby on Rails Official Blog</a><br /><a href="http://www.rubyinside.com/">RubyInside</a><br /><a href="http://drnicwilliams.com/">Dr. Nic</a><br /><a href="http://yehudakatz.com/">Yahuda Katz</a><br /><a href="http://techno-weenie.net/">Rick Olson</a></blockquote>
<p><br /><br />每一次當 Rails 界舉辦 Conf ，例如 <a href="http://www.railsconf.com">RailsConf 2009 </a>或者是 <a href="http://www.actsasconference.com/">Acts as Conference 2009</a>，其實也都還蠻多 slides 和 video 可以看，看完以後知識會長不少 ....</p>
<blockquote><br />railsconf 2009 的 <a href="http://railsconf.blip.tv/">video</a> 與 <a href="http://en.oreilly.com/rails2009/public/schedule/proceedings">slides </a><br />act_as_conf 2009 的 <a href="http://www.techscreencast.com/tag/actsasconference-2009">video</a> </blockquote>
<p><br /><br />希望提供這些資訊能讓大家對學習和練習有個方向....</p>  <div class="more"><a href="http://rails.pixnet.net/blog/post/27997784">(Read More...)</a></div>]]></content>
    <category term="General Turtorial"/>
    <wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://rails.pixnet.net/blog/post/27997784#comments</wfw:comment>
  </entry>
</feed>
