• Save
Lessons Learnt From Working With Rails
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Lessons Learnt From Working With Rails

on

  • 4,299 views

As given at Scotland On Rails 2008. ...

As given at Scotland On Rails 2008.

(note: the highlighting and layering hasn't come through so well in Slideshares conversion process. I'll probably put a version to download from my site to solve this)

Statistics

Views

Total Views
4,299
Views on SlideShare
4,299
Embed Views
0

Actions

Likes
5
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Lessons Learnt From Working With Rails Presentation Transcript

  • 1. Lessons Learnt fromWorking With Rails Martin Sadler workingwithrails.com
  • 2. HAZ HACKF EST This Talk I CANOverview The Scene Strategy Popularity RUBY1Contests vs Launch AuthorityFeatures Performance Stats http://flickr.com/photos/intangiblyawesome/12593056/
  • 3. But First
  • 4. In The Beginning
  • 5. In The Beginning (Autumn 2006)
  • 6. Current Release 1.1.5
  • 7. O’Reilly - State of the book market
  • 8. The ratings are based on the number of skilled engineers world-wide, courses and third party vendors. TIOBE Programming language popularity
  • 9. Rails Resources ROR Forums / Newsgroup Blogs Official ROR wikiPlugin directory More blogs Rubyforge
  • 10. Frustrated?
  • 11. Ouch!
  • 12. Ouch!
  • 13. Ouch!
  • 14. Ouch!
  • 15. http://flickr.com/photos/zachklein/54389823/
  • 16. http://flickr.com/photos/zachklein/54389823/
  • 17. Ouch!http://flickr.com/photos/zachklein/54389823/
  • 18. Ouch!http://flickr.com/photos/zachklein/54389823/
  • 19. Issues
  • 20. Issues• Limitations of wiki page length
  • 21. Issues• Limitations of wiki page length• Spam
  • 22. Issues• Limitations of wiki page length• Spam• No ability to cross reference data
  • 23. Issues• Limitations of wiki page length• Spam• No ability to cross reference data• Tricky to navigate
  • 24. Issues• Limitations of wiki page length• Spam• No ability to cross reference data• Tricky to navigate• No one had ownership
  • 25. Issues• Limitations of wiki page length• Spam• No ability to cross reference data• Tricky to navigate• No one had ownership• More Spam!
  • 26. Solution? Strategy?
  • 27. Putting it together http://flickr.com/photos/laffy4k/166300185/
  • 28. Putting it togetherSources http://flickr.com/photos/laffy4k/166300185/
  • 29. Putting it together Sources WikiNewsgroup http://flickr.com/photos/laffy4k/166300185/
  • 30. Putting it together Extract Sources WikiNewsgroup http://flickr.com/photos/laffy4k/166300185/
  • 31. Putting it together Extract Map Sources and Combine WikiNewsgroup http://flickr.com/photos/laffy4k/166300185/
  • 32. Putting it together Rails Models Extract Map Sources and Combine WikiNewsgroup http://flickr.com/photos/laffy4k/166300185/
  • 33. Putting it together Rails New Interface Models Extract Map Display Sources and Filter Combine Manage WikiNewsgroup http://flickr.com/photos/laffy4k/166300185/
  • 34. Principles create a web application to...• Improve the usability and accessibility of the content.• Increase reliability - give back control and ownership to the individuals whose information is being displayed• Add value
  • 35. Early Concept Text Early proof of concept wireframe design
  • 36. BonusDatabase would already be populated with everyones records!
  • 37. BonusDatabase would already be populated with everyones records! Good Idea?
  • 38. Hey, I didn’t give you permission to copy my data!http://flickr.com/photos/dvusd/2213212393/
  • 39. But...• No need for people to enter their details again. (DRY)• Great kick start - site looks active before any users had really started using it• Users got a chance to see how it worked straight away• Data already in public domainCover the bases : Have an opt-out for users
  • 40. Add Value• Additional profile information e.g. • How long have you been using Rails? • How long have you been using Ruby? • Rails Core contributor Added extra attributes to profiles that created new data streams e.g. rank by authority
  • 41. ManagementGive as much freedom as a Wiki using a structured database. Give control and ownership to the individuals whose information is being displayed How?
  • 42. Reporting• Needed side effect• Self policing http://flickr.com/photos/chrisjohnbeckett/442682895/
  • 43. Detour Extracting from the source
  • 44. Profile Attributes• First name • Email• Last name • Job title• Country• Location• Company• Company url
  • 45. Using HPricot with XPathLooking for patterns .. and finding edge cases
  • 46. Using HPricot with XPathLooking for patterns .. and finding edge cases
  • 47. Using HPricot with XPathLooking for patterns .. and finding edge cases
  • 48. Using HPricot with XPathLooking for patterns .. and finding edge cases
  • 49. Using HPricot with XPathLooking for patterns .. and finding edge cases
  • 50. Using HPricot with XPathLooking for patterns .. and finding edge cases
  • 51. Using HPricot with XPathLooking for patterns .. and finding edge cases
  • 52. Using HPricot with XPathLooking for patterns .. and finding edge cases
  • 53. Using HPricot with XPathLooking for patterns .. and finding edge cases
  • 54. Using HPricot with XPathLooking for patterns .. and finding edge cases
  • 55. Using HPricot with XPathLooking for patterns .. and finding edge cases
  • 56. An operation in data cleansing
  • 57. ResultAbout 90% Success rate in porting the data Edge cases proved to be challenging Spam was a continued annoyance
  • 58. Detour end? Almost
  • 59. In Sync?WWR - Keeping records in sync with the Rails Wiki
  • 60. In Sync? CrAZY!WWR - Keeping records in sync with the Rails Wiki
  • 61. Back to the plan....
  • 62. 1st Iteration• Set (limited) scope of project• Knocked together a basic proof of concept.• Scraping and validity, versioning of the data extracted.• Dev work in 2 - 3 Days• Put out a version to get feedback from the community.
  • 63. The Launch
  • 64. “So this is basically a facebook for hiring? Looks cool.” - DHHFlickr Credit: http://www.flickr.com/photos/rooreynolds/243058018/
  • 65. Release Strategy• Ask DHH• Notify Ruby Inside• Send mail out to initial beta testers• Post Announce on Rails newsgroup
  • 66. Release Strategy Continued...• Released on a Thursday • End of week - People are more open to trying things out. • Released in the AM (before America went online) • Any issues could be ironed out before the larger rush of folks
  • 67. Ruby InsideNov 17th 2006 http://www.rubyinside.com/worlds-largest-index-of-rails-developers-workingwithrails-launches-303.html
  • 68. Ruby on Rails Weblog Text http://weblog.rubyonrails.org/2006/12/3/working-with-rails-tell-the-world
  • 69. Keeping Track http://flickr.com/photos/andropolis/• Direct emails 1121113459/• Technorati• Google Stats (referrers)• Google & Google Blog Search
  • 70. Authority VSPopularity
  • 71. Authority vs Popularity Provide by the By other users user
  • 72. Where are they used?
  • 73. Where are they used?
  • 74. Where are they used? Data Streams & Filters
  • 75. Where are they used? Data Streams & Filters
  • 76. Where are they used? Data Streams & Filters
  • 77. Useful for?Reputation Marketing CV Kudos Endorsements
  • 78. When will I be famous?
  • 79. When will I be famous?
  • 80. I Can Haz Internetz
  • 81. I Can Haz Internetz
  • 82. Authority, Popularity, and Experience are metrics by which to compare Rails developers.It’s up to the visitor to decide what weighting they give to them.
  • 83. Contests(aka Hackfests)
  • 84. January 2007 Rails Coding FTW• First ever global Rails Hackfest• 20 tickets to RailsConf inc hotel• 24 days• 263 participants
  • 85. Rails Coding FTWKick-off • Jeremy Kemper (Core Team) • Derek Sivers (CD Baby) • Coded over a weekend • Lots of emails ..time diff!
  • 86. Rails Coding FTWIn practice• Queried a custom Trac activity report (RSS)• Generated ‘votes’ per contributor• Re-factored popularity chart ranking code
  • 87. Prize Stats Oakleys32+ Rails Conf tickets $$$ 50 USB Hubs • Lots of them PlanHQHosting 40 Make Magazines
  • 88. Under the hood
  • 89. Chart Infrastructure Chart RankSet VoteSet Ranks Votes
  • 90. Generation• Chart Scheduler (background daemon)• Uses OpenWFEru scheduler gem• Generates a RankSet and ranks for a given set of votes Summary Votes fetched at Midnight Ranks generated once a day at 8am http://openwferu.rubyforge.org/scheduler.html
  • 91. Generation• Chart Scheduler (background daemon)• Uses OpenWFEru scheduler gem• Generates a RankSet and ranks for a given set of votes Summary Votes fetched at Midnight Ranks generated once a day at 8am http://openwferu.rubyforge.org/scheduler.html
  • 92. Has Many Charts? Overall Popularity | Blog Popularity | CodePopularity | Training Popularity | Speaking Popularity | Publications Popularity | Overall Activity |Hackfest 2007 | Rails Activity Weekly | Rails ActivityMonthly | Rails Activity Yearly | Monthly: June 2007 | Monthly: July 2007 | Monthly: August 2007 | Monthly: September 2007 Uses STI: Chart::Contribution, Chart::Base
  • 93. How many records? *this figure is actually now much higher so these figures will be even higher!
  • 94. How many records?• 12 Charts *this figure is actually now much higher so these figures will be even higher!
  • 95. How many records?• 12 Charts• 10,000 users* *this figure is actually now much higher so these figures will be even higher!
  • 96. How many records?• 12 Charts• 10,000 users*• 12 * 10, 000 = 120000 votes a day *this figure is actually now much higher so these figures will be even higher!
  • 97. How many records?• 12 Charts• 10,000 users*• 12 * 10, 000 = 120000 votes a day• 12 * 10, 000 = 120000 ranks a day *this figure is actually now much higher so these figures will be even higher!
  • 98. How many records?• 12 Charts• 10,000 users*• 12 * 10, 000 = 120000 votes a day• 12 * 10, 000 = 120000 ranks a day• 240,000 records generated a day *this figure is actually now much higher so these figures will be even higher!
  • 99. How many records?• 12 Charts• 10,000 users*• 12 * 10, 000 = 120000 votes a day• 12 * 10, 000 = 120000 ranks a day• 240,000 records generated a day• 1,680,000 a week *this figure is actually now much higher so these figures will be even higher!
  • 100. How many records?• 12 Charts• 10,000 users*• 12 * 10, 000 = 120000 votes a day• 12 * 10, 000 = 120000 ranks a day• 240,000 records generated a day• 1,680,000 a week• 50,400,000 a month *this figure is actually now much higher so these figures will be even higher!
  • 101. Lots of records what to watch out for?
  • 102. Lots of records what to watch out for?• (Careful) Indexing
  • 103. Lots of records what to watch out for?• (Careful) Indexing• Archiving
  • 104. Lots of records what to watch out for?• (Careful) Indexing• Archiving• Joins
  • 105. Benefits• Versatile - can rank pretty much anything• Ability to scale• Keeps vote and rank history
  • 106. Feature after Feature• Busy few months• Groups, Sites, Gems, Plugins... Hackfests, lots of updates
  • 107. Development Strategy• Short iterations of developments• Mainly FDD• Try out features in branches• Used Edge Rails to stay ahead of the game• SVK is your friend* * the cooler kids now use git
  • 108. Enter the BlogsphereThe WWR Feed Aggregatorhttp://www.slideshare.net/martinbtt/getting-distributed-with-ruby-on-rails/
  • 109. Enter the BlogsphereThe WWR Feed Aggregatorhttp://www.slideshare.net/martinbtt/getting-distributed-with-ruby-on-rails/ In Summary
  • 110. Enter the BlogsphereThe WWR Feed Aggregatorhttp://www.slideshare.net/martinbtt/getting-distributed-with-ruby-on-rails/ In Summary Uses AP4R gem async messagingDistributed fetching and processing of feeds
  • 111. Behind the scenes• STI for many of the resources• Global filters for all• Custom filters available for specific resources
  • 112. Performance
  • 113. Performance• Typically 8 db queries per page• fragment caching for long running tasks• extensive use of db query cache• optimised queries - indexes etc• lots of ram• avoid db joins where possible
  • 114. Ranksfor the hackfests)(before being re-factored Use of MYSQL variables for ranks
  • 115. Back to the stats Where next?
  • 116. Adoption of Rails amongst users 1.0 0.5This chart was created by tallying up the number of people using Rails based on when they said they started using Rails on WWR Rails 0.5 and 1.0 release dates are also shown for reference
  • 117. Adoption of Rails amongst users 1.0 0.5 Old skool After Fan Boys?! Rubists partyThis chart was created by tallying up the number of people using Rails based on when they said they started using Rails on WWR Rails 0.5 and 1.0 release dates are also shown for reference
  • 118. Adoption of Rails amongst users 1.00.5 Text Trend shows steady growth
  • 119. What about Ruby?WWR users Ruby experience
  • 120. Rails Experience 1.00.5 Ruby Experience
  • 121. Rails Experience 1.00.5 Ruby Experience
  • 122. Rails Experience 1.00.5 ROR web site, Log, Wiki Launched Ruby Experience
  • 123. Rails Experience 1.00.5 ROR web site, Log, Wiki Launched Ruby Experience
  • 124. Rails Experience 1.00.5 ROR web site, Log, Wiki Launched Ruby Experience
  • 125. Where next? (For Rails)
  • 126. Where next? (For Rails)• Corporate experimentation with Rails. These have largely started to pay off and large scale developments are starting to happen.• A heap of books for new developers to pick up and learn.• Rails matures
  • 127. Where next? (For Rails)• Corporate experimentation with Rails. These have largely started to pay off and large scale developments are starting to happen.• A heap of books for new developers to pick up and learn.• Rails matures Big name companies using Rails http://blog.obiefernandez.com/content/2008/03/big-name-compan.html
  • 128. http://radar.oreilly.com/archives/2008/03/state-of-the-computer-book-mar-22.html
  • 129. http://radar.oreilly.com/archives/2008/03/state-of-the-computer-book-mar-22.html
  • 130. See Also: http://blogs.zdnet.com/enterprisealley/?p=122
  • 131. And WWR?
  • 132. The sites usage is continuing to grow - the number ofvisitors is now roughly double what it was 6 months ago. O’Reilly will be continuing it’s support through the rest of 2008 New features coming soon...
  • 133. With Thanks to & YOU!
  • 134. beyondthetype.comtwitter.com/martinbtt