rails is not enough, by javier ramirez, at conferencia rails 2010 in madrid, spain

27
Rails Rails is not is not Enough Enough by javier ramírez by javier ramírez @supercoco9 @supercoco9 [email protected] [email protected] http://javier-ramirez.com http://javier-ramirez.com

Upload: javier-ramirez

Post on 10-May-2015

1.680 views

Category:

Technology


1 download

DESCRIPTION

We rails people tend to think of Rails as the center-piece of web development. The same thing can be said of .net, Spring/Java Server Faces, Drupal, Python or name-your-web-framework-of-choice-here people.Web frameworks are just a component of web applications, and if you want to succeed you better know the miriads of other components beyond your rockstar code.In my session I will talk about things you must take into account and tools/techniques you should master if you want to make a difference in web development, independently of your development language/framework.Talk delivered at conferencia rails 2010 in Madrid, Spain.

TRANSCRIPT

Page 1: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Rails Rails is not is not

EnoughEnoughby javier ramírezby javier ramírez

@supercoco9@[email protected]@aspgems.com

http://javier-ramirez.comhttp://javier-ramirez.com

Page 2: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

A monkey's view A monkey's view of weBof weB

developmentdevelopment

internetweb server

database

request

response

model

controller

viewmodel

Page 3: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Standing Standing on the on the

shoulders shoulders of giantsof giants

Ignoring HTTP, HTML, JavaScript or CSS is not an optionIgnoring HTTP, HTML, JavaScript or CSS is not an option

Code like a pro. Validate!Code like a pro. Validate!

Protect yourself, use frameworksProtect yourself, use frameworks

Page 4: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Run Run FORREST FORREST RUNRUN

https://code.google.com/speed/page-speedhttps://code.google.com/speed/page-speedhttp://developer.yahoo.com/yslow/http://developer.yahoo.com/yslow/https://www.facebook.com/notes/facebook-engineering/bigpipe-https://www.facebook.com/notes/facebook-engineering/bigpipe-pipelining-web-pages-for-high-performance/389414033919pipelining-web-pages-for-high-performance/389414033919http://yehudakatz.com/2010/09/07/automatic-flushing-the-rails-3-1-planhttp://yehudakatz.com/2010/09/07/automatic-flushing-the-rails-3-1-planhttp://github.com/mkelly12/google_closure_compilerhttp://github.com/mkelly12/google_closure_compiler

Page 5: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Size Size Doesn't Doesn't matter,matter,

if you if you know know

howhow

Page 6: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Adding muscleAdding muscleServer Configuration management and provisioningServer Configuration management and provisioning

Cloud servicesCloud serviceshttp://opscode.com/chefhttp://opscode.com/chefhttp://puppetlabs.comhttp://puppetlabs.com

Deploy strategiesDeploy strategies

http://github.com/capistranohttp://github.com/capistrano http://github.com/lg/murderhttp://github.com/lg/murder http://github.com/calavera/marabuntahttp://github.com/calavera/marabunta

Page 7: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Reducing loadReducing loadUser external serversUser external serversPage/reverse proxy caching Page/reverse proxy caching Key/value middlemenKey/value middlemenDistribute (queue, map reduce...)Distribute (queue, map reduce...)Set limitsSet limitsDisplay less contentDisplay less content

Degrade gracefully Degrade gracefully

http://www.railsinside.com/case-studies/421-http://www.railsinside.com/case-studies/421-kgb-scaling-superbowl-traffic-case-study.htmlkgb-scaling-superbowl-traffic-case-study.html

Page 8: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Paul Paul the octopusthe octopus

Page 9: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Look for traffic patterns (peak hours and “valleys”)Look for traffic patterns (peak hours and “valleys”)

Test your siteTest your siteApachebenchApachebenchhttperfhttperfJmeterJmeter

Do the mathsDo the maths(req/s)*60*60(req/s)*60*60(req/s)*60*60*100/(busiest % hour)(req/s)*60*60*100/(busiest % hour)

Our numbers:Our numbers:7% 7% 11 million pageviews/month11 million pageviews/month8 boxes8 boxes

~37 million pageviews limit ~37 million pageviews limit

Page 10: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Plan For Plan For FailureFailure

Page 11: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

My other car is a porscheMy other car is a porsche

Page 12: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Sharpening Sharpening youryouraxeaxe

Page 13: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

general programming Conceptsgeneral programming Concepts

RubyRuby

Data StorageData Storage

Algorithms (sorting, map/reduce, sawzall...)Algorithms (sorting, map/reduce, sawzall...)

ACID ACID

SOLID SOLID

Page 14: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

How much How much did your did your business business Yesterday?Yesterday?

Page 15: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

http://google.com/analyticshttp://google.com/analytics http://web.analytics.yahoo.comhttp://web.analytics.yahoo.com http://omniture.comhttp://omniture.com http://coremetrics.comhttp://coremetrics.com http://webtrends.comhttp://webtrends.com http://piwik.orghttp://piwik.org

How many visitors I get?How many visitors I get?How many pages they see?How many pages they see?Why are they getting here?Why are they getting here?What's the entry/exit point?What's the entry/exit point?Where are they going?Where are they going?Which pages are engaging?Which pages are engaging?Is my workflow too complex?Is my workflow too complex?Am I doing better than before?Am I doing better than before?How much did my business today?How much did my business today?

http://clicktale.comhttp://clicktale.com http://percentmobile.comhttp://percentmobile.com http://feedburner.comhttp://feedburner.com

Page 16: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Do you know Do you know who enters who enters your shop?your shop?

https://www.google.com/adplannerhttps://www.google.com/adplanner

Page 17: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

How can I help you?How can I help you?Are you happy with me?Are you happy with me?What do you like about me?What do you like about me?Am I missing the point?Am I missing the point?

https://www.kissinsights.comhttps://www.kissinsights.com http://www.4qsurvey.comhttp://www.4qsurvey.com http://getsatisfaction.comhttp://getsatisfaction.com http://uservoice.comhttp://uservoice.com

How popular/unpopular am I?How popular/unpopular am I?

http://blogpulse.comhttp://blogpulse.com http://icerocket.comhttp://icerocket.com http://thinkupapp.comhttp://thinkupapp.com https://analytics.postrank.comhttps://analytics.postrank.com http://www.google.com/alertshttp://www.google.com/alerts

Page 18: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Mirror mirror Mirror mirror on the wall on the wall Who in the Who in the land is land is fairest fairest of all?of all?

http://compete.comhttp://compete.com http://google.com/trendshttp://google.com/trends

Page 19: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

If you build it, they will comeIf you build it, they will come

Page 20: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Mr. ObviousMr. ObviousSEMSEM

PRPR

TwitterTwitter => 126 => 126

Facebook => 130 Facebook => 130

Buttons/bannersButtons/banners

Share profitsShare profits

Page 21: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

quack like a duckquack like a duckwhat's the message I'm sending? => webmaster toolswhat's the message I'm sending? => webmaster tools

Internal/external searches => webmaster tools & analyticsInternal/external searches => webmaster tools & analytics

Google adwords keyword toolGoogle adwords keyword tool

http://google.com/insights/searchhttp://google.com/insights/search

http://youtube.comhttp://youtube.com

http://delicious.comhttp://delicious.com

Page 22: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

The The Scientific Scientific

methodmethod

A/B TestingA/B Testing

https://optimizely.appspot.comhttps://optimizely.appspot.com http://google.com/websiteoptimizerhttp://google.com/websiteoptimizer

A/B Testing for AdsA/B Testing for Ads

Adwords campaign experimentsAdwords campaign experiments

Page 23: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

UxymoronUxymoronNon-standard interfaces, usually hard to build, Non-standard interfaces, usually hard to build, making the users more likely to make mistakes and making the users more likely to make mistakes and find the design much more difficult to usefind the design much more difficult to use

Also said of the moron who Also said of the moron who thought it was such a great thought it was such a great idea to implement that idea to implement that interfaceinterface

Page 24: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

Jakob's Law of the Internet Jakob's Law of the Internet User ExperienceUser Experience

Users spend most of Users spend most of their time on other sites. their time on other sites. This means that users This means that users prefer your site to work prefer your site to work the same way as all the the same way as all the other sites they already other sites they already know alikeknow alike

http://www.useit.com/alertbox/20000723.htmlhttp://www.useit.com/alertbox/20000723.html

Page 25: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

RTFCRTFC

Google Google MicrosoftMicrosoftYahooYahooTwitterTwitterFacebookFacebookLinkedInLinkedInXingXingGithub...Github...

Read The F***king CodeRead The F***king Code

Page 26: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

All All together together

now!now!

Standards are coolStandards are coolRemember the client-sideRemember the client-sideThink big, keep smallThink big, keep smallEstimateEstimateHave a B planHave a B plan

Analyse & MeasureAnalyse & MeasureHave a conversationHave a conversationShout your nameShout your nameMake an educated guessMake an educated guessBe easy to useBe easy to useKeep learningKeep learning

Page 27: Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, Spain

javier ramírezjavier ramírez@supercoco9@supercoco9

[email protected]@aspgems.com http://javier-ramirez.comhttp://javier-ramirez.com

All the images were found via All the images were found via http://ffffound.comhttp://ffffound.com . Many thanks to their authors . Many thanks to their authors