Ruby on Google App Engine: Upgrade to Google App "Turbo" Engine
Ruby on Google App Engine Upgrade to Google App “Turbo” Engine Joseph Ku (Chieh-Fang Ku) firstname.lastname@example.org
OutlineWhat’s Google App Be preparedEngine? What’s JRubyWhy Google AppEngine? Why Sinatra and why not Rails? Free quotas and limits Hack! Hack! Hack! Signiﬁcant References features v1.0.6 Build 201104022100
Who am I?Joseph Ku (Chieh-Fang Ku)(@josephku) Male Single, but not richA Linux user since 1996Fed by embedded Linux and AndroidRuby lover and Guitar Hero rocker
Before we start...Don’t take any notes. This slide will bepublished with CC BY-NC-ND.Don’t judge my look and shape. It’s cold, andI need Calories.Don’t play Angry Birds during my presentation ...including Angry Birds Seasons edition
Before we start...You CAN interrupt me anytime.You CAN take pictures anytime.You CAN go to the toilet anytime.
What’s Google App Engine? GAE (Google App Engine) lets you run your web apps on Googles infrastructure. Reliable PaaS (Platform as a Service) Easy to use, maintain and scale Almost free!
What’s Google App Engine? GAE (Google App Engine) lets you run your web apps on Googles infrastructure. Typical PaaS (Platform as a Service) Only supports Python and Java runtime environments Who did choose GAE?...
Free quotas and limitsFree Quotas (without 1 GB sharedenabling billing) Datastore/ Blobstore size 43,200,000 requests per day 6.5 CPU-hours per day 45,200 requests per minute 1 GB shared bandwidth in/out per day
Free quotas and limitsLimits 10 apps for 150 MB app code developer account size 30 sec per request 1,000 deployments 10 MB HTTP 200 indexes response size
Signiﬁcant featuresSchedule tasks Google account integration Schedule tasks - Like Cron service URL fetch Every minutes! Mail Up to 20 tasks MemcacheTask queues - only Image manipulationsupport Python
Be prepared for the real world Java SE Development Kit (JDK) 6 Ruby 1.8.7-p330 or 1.8.7-p334 RubyGems 1.3.7 JRuby 1.5.6
Be prepared for the real world Suggestions: Use “RVM” to deploy your Ruby environment on Linux or Mac Use “Pik” to deploy your Ruby environment on Windows
Be prepared for the real world Install all packages we need: $ gem install google-appengine And do some tricks... $ gem uninstall appengine-sdk $ gem install appengine-sdk -v "1.4.0"
Be prepared for the real world Create a GAE app and test it: $ appcfg.rb generate_app myapp $ echo “gem jruby-rack, < 1.0.6” >> myapp/ Gemﬁle $ dev_server.rb myapp Go and check http://localhost:8080/
What’s JRuby100% Java implementation of the Rubyprogramming language We could call Ruby MRI, “CRuby.”Open source, Started in 2001Always aiming for compatibility with currentRuby version Latest release: 1.6.0 (update to 2011.03.15)
Why Sinatra and why not RailsSinatra is lighter than RailsSinatra’s CGI-friendly is more close to GAETons of problems while trying to deploy aRails app to GAEBig performance issues in Rails apps on GAEBesides...
Why Sinatra and why not RailsThere is Heroku!!$ gem install heroku$ heroku create myapp$ git push heroku masterGo and check http://myapp.heroku.com