SlideShare une entreprise Scribd logo
1  sur  22
Wednesday, November 25, 2009
JRuby on Google App Engine
           Extending the Java Platform & APIs
           John Woodell
           Nov 27, 2009




             2



Wednesday, November 25, 2009
What is Google App Engine?
           • A cloud-computing platform
           • We provide the container and services
           • Run your web apps on Google’s infrastructure
           • Pay-as-you-go, with free quota to get started




             3



Wednesday, November 25, 2009
WhiteHouse.gov/openforquestions




             4



Wednesday, November 25, 2009
Quotas and Billing
                   Resource        Provided Free      Additional Cost
                   CPU time        6.5 hours/day        $0.10/hour


                 Bandwidth In       1GByte/day         $0.10/GByte

              Bandwidth Out         1GByte/day         $0.12/GByte

                 Stored Data           1 GB           $0.005/GB-day

                 Emails sent     2000/day to users    $0.0001/email
                                50000/day to admins

             5



Wednesday, November 25, 2009
JRuby on App Engine
             6



Wednesday, November 25, 2009
Current Issues with JRuby on App Engine
           • Several seconds to “spin-up” a new JRuby instance
           • Some gems still need their extensions ported to Java
           • Not officially supported , but you have all that you need




                               +                          =       ?
             7



Wednesday, November 25, 2009
$ sudo gem install google-appengine
           Successfully installed appengine-rack-0.0.4
           Successfully installed appengine-jruby-jars-0.0.6
           Successfully installed appengine-sdk-1.2.6
           Successfully installed appengine-tools-0.0.6
           Successfully installed google-appengine-0.0.6
           5 gems installed
           Installing ri documentation for appengine-rack-0.0.4...
           Installing ri documentation for appengine-jruby-jars-0.0.6...
           Installing ri documentation for appengine-sdk-1.2.6...
           Installing ri documentation for appengine-tools-0.0.6...
           Installing ri documentation for google-appengine-0.0.6...
           Installing RDoc documentation for appengine-rack-0.0.4...
           Installing RDoc documentation for appengine-jruby-jars-0.0.6...
           Installing RDoc documentation for appengine-sdk-1.2.6...
           Installing RDoc documentation for appengine-tools-0.0.6...
           Installing RDoc documentation for google-appengine-0.0.6...




             8



Wednesday, November 25, 2009
App Engine Gems
           • Development Gems
             – appengine-rack
             – appengine-tools      dev_appserver.rb & appcfg.rb
             – appengine-sdk
             – appengine-jruby-jars
           • Runtime Gems
           – appengine-rack
           – dm-appengine
           – appengine-apis




             9



Wednesday, November 25, 2009
Dev AppServer
           • Customized Jetty server
           • Local implementation of services
                 – LRU memcache
                 – Disk-backed datastore
                 – HttpClient-backed URLFetch
           • Emulates the production environment
                 – Sandbox restrictions may be inconsistent,
                  so run tests on production servers as well




            10



Wednesday, November 25, 2009
Deployment
           • Your app lives at
             – <app_id>.appspot.com, or
             – Custom domain with Google Apps
           • Deploying uploads
             – Static files
             – Resource files
             – Other metadata (datastore indexes, cron jobs)
           • Admin Console
                 – dashboards
                 – manage multiple versions
                 – view logs



            11



Wednesday, November 25, 2009
App Engine JRuby APIs
           • AppEngine::Users
           • AppEngine::Datastore
           • AppEngine::Memcache
           • AppEngine::Mail
           • AppEngine::URLFetch
           • AppEngine::Images
           • AppEngine::Logger
           • AppEngine::Testing
           • AppEngine::XMPP
           • AppEngine::Labs::TaskQueue



            12



Wednesday, November 25, 2009
Users API
           • Existing User Account
           • Restrict your app to a domain


          map '/src' do
            use AppEngine::Rack::AdminRequired
            use AppEngine::Rack::SSLRequired
            run ActionController::Dispatcher.new
          end

          map '/' do
            run ActionController::Dispatcher.new
          end
            13



Wednesday, November 25, 2009
XMPP API




            14



Wednesday, November 25, 2009
Memcache API
           • No configuration required
           • Same API as Ruby-Memcache
           • Keys can be any Symbol or String
           • Can store any Marshalable or Serializable object


          cache = AppEngine::Memcache.new
          cache.set_many({:a => 1, :foo => 1..5})
          a, foo = cache.get(:a, :foo)




            15



Wednesday, November 25, 2009
URL Fetch API
           • Drop-in replacement for Net::HTTP


          AppEngine::URLFetch.fetch(url, options={})

          :method
          :payload
          :headers
          :allow_truncated
          :follow_redirects
          :deadline




            16



Wednesday, November 25, 2009
Small & Modular Frameworks
           • Rack
           • Sinatra
           • Merb/Rails3*
           • Duby




              * Currently unreleased

            17



Wednesday, November 25, 2009
DataMapper Finders
          # Comparisons you’d expect
          Zoo.first(:name => 'Galveston')

          # The 'gt/lt' means greater/less-than.
          Person.all(:age.gt => 30)
          Person.all(:age.lt => 40)

          # The 'gte/lte' means greather/less-than-or-equal-to.
          Person.all(:age.gte => 30)
          Person.all(:age.lte => 40)

          # The value of a pair is an Array
          Person.all(:name => 'Sam', :id => [ 1, 2, 3, 4, 5 ])
          Person.all(:name => [ 'bob', 'rick', 'steve' ])

          # Ordering
          Person.all(:order => [ :age.desc ])

            18



Wednesday, November 25, 2009
DataMapper Associations
           • has n, has 1
           • belongs_to, many_to_one

          class Post
          include DataMapper::Resource
            property :id, Serial
            property :message, Text
            has n, :comments
          end

          class Comment
            include DataMapper::Resource
            property :id, Serial
            property :message, Text
            belongs_to :post
          end

            19



Wednesday, November 25, 2009
Demo



Wednesday, November 25, 2009
Resources
           • John Woodell, woodie@google.com
           • Google App Engine for JRuby
                 – http://code.google.com/p/appengine-jruby/
           • Google Group
                 – http://groups.google.com/group/appengine-jruby
           • Blog: JRuby on App Engine Blog
                 – http://jruby-appengine.blogspot.com/




            21



Wednesday, November 25, 2009
Wednesday, November 25, 2009

Contenu connexe

Tendances

modern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Campmodern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
Puppet
 
Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in Production
Docker, Inc.
 
Rackspace Hack Night - Vagrant & Packer
Rackspace Hack Night - Vagrant & PackerRackspace Hack Night - Vagrant & Packer
Rackspace Hack Night - Vagrant & Packer
Marc Cluet
 

Tendances (20)

modern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Campmodern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
 
We All Live in a Yellow (Serverless) Submarine
We All Live in a Yellow (Serverless) SubmarineWe All Live in a Yellow (Serverless) Submarine
We All Live in a Yellow (Serverless) Submarine
 
Optimizing training on Apache MXNet
Optimizing training on Apache MXNetOptimizing training on Apache MXNet
Optimizing training on Apache MXNet
 
Mitchell Hashimoto, HashiCorp
Mitchell Hashimoto, HashiCorpMitchell Hashimoto, HashiCorp
Mitchell Hashimoto, HashiCorp
 
Achieving Infrastructure Portability with Chef
Achieving Infrastructure Portability with ChefAchieving Infrastructure Portability with Chef
Achieving Infrastructure Portability with Chef
 
Advanced Scheduling with Amazon ECS (September 2017)
Advanced Scheduling with Amazon ECS (September 2017)Advanced Scheduling with Amazon ECS (September 2017)
Advanced Scheduling with Amazon ECS (September 2017)
 
Deep Dive into AWS Fargate
Deep Dive into AWS FargateDeep Dive into AWS Fargate
Deep Dive into AWS Fargate
 
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and AnsibleService Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
 
Carlos Conde : AWS Game Days - TIAD Paris
Carlos Conde : AWS Game Days - TIAD ParisCarlos Conde : AWS Game Days - TIAD Paris
Carlos Conde : AWS Game Days - TIAD Paris
 
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
 
Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in Production
 
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
 
Introduction to ansible galaxy
Introduction to ansible galaxyIntroduction to ansible galaxy
Introduction to ansible galaxy
 
Rackspace Hack Night - Vagrant & Packer
Rackspace Hack Night - Vagrant & PackerRackspace Hack Night - Vagrant & Packer
Rackspace Hack Night - Vagrant & Packer
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
 
Managing Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with AnsibleManaging Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with Ansible
 
Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)
 
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Local Dev on Virtual Machines - Vagrant, VirtualBox and AnsibleLocal Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
 
How Ansible Makes Automation Easy
How Ansible Makes Automation EasyHow Ansible Makes Automation Easy
How Ansible Makes Automation Easy
 
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
 

Similaire à JRubyConf 2009

Aloha on-rails-2009
Aloha on-rails-2009Aloha on-rails-2009
Aloha on-rails-2009
John Woodell
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Nilesh Panchal
 
Gaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume LaforgeGaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume Laforge
Guillaume Laforge
 

Similaire à JRubyConf 2009 (20)

Rubypalooza 2009
Rubypalooza 2009Rubypalooza 2009
Rubypalooza 2009
 
Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby Conference
 
RubyConf 2009
RubyConf 2009RubyConf 2009
RubyConf 2009
 
Aloha on-rails-2009
Aloha on-rails-2009Aloha on-rails-2009
Aloha on-rails-2009
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
App Engine Meetup
App Engine MeetupApp Engine Meetup
App Engine Meetup
 
Kuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsKuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails Apps
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
OpenStack Deployments with Chef
OpenStack Deployments with ChefOpenStack Deployments with Chef
OpenStack Deployments with Chef
 
Cloudfoundry Overview
Cloudfoundry OverviewCloudfoundry Overview
Cloudfoundry Overview
 
Ship It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails EcosystemShip It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails Ecosystem
 
Australian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStackAustralian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStack
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
Rails and the Apache SOLR Search Engine
Rails and the Apache SOLR Search EngineRails and the Apache SOLR Search Engine
Rails and the Apache SOLR Search Engine
 
Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk Götz
 
Logging & Docker - Season 2
Logging & Docker - Season 2Logging & Docker - Season 2
Logging & Docker - Season 2
 
Chef for OpenStack - OpenStack Fall 2012 Summit
Chef for OpenStack  - OpenStack Fall 2012 SummitChef for OpenStack  - OpenStack Fall 2012 Summit
Chef for OpenStack - OpenStack Fall 2012 Summit
 
Chef for OpenStack- Fall 2012.pdf
Chef for OpenStack- Fall 2012.pdfChef for OpenStack- Fall 2012.pdf
Chef for OpenStack- Fall 2012.pdf
 
Gaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume LaforgeGaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume Laforge
 
MongoDB Use Cases and Roadmap
MongoDB Use Cases and RoadmapMongoDB Use Cases and Roadmap
MongoDB Use Cases and Roadmap
 

Plus de John Woodell

Plus de John Woodell (7)

Deploying and Maintaining an Enterprise OpenLDAP Directory
Deploying and Maintaining an Enterprise OpenLDAP DirectoryDeploying and Maintaining an Enterprise OpenLDAP Directory
Deploying and Maintaining an Enterprise OpenLDAP Directory
 
Enterprise Mail and Calendaring with Open Software
Enterprise Mail and Calendaring with Open SoftwareEnterprise Mail and Calendaring with Open Software
Enterprise Mail and Calendaring with Open Software
 
Appengine ja-night-10
Appengine ja-night-10Appengine ja-night-10
Appengine ja-night-10
 
Rejectkaigi 2010
Rejectkaigi 2010Rejectkaigi 2010
Rejectkaigi 2010
 
Jrubykaigi 2010
Jrubykaigi 2010Jrubykaigi 2010
Jrubykaigi 2010
 
Oscon 2010
Oscon 2010Oscon 2010
Oscon 2010
 
Railsconf 2010
Railsconf 2010Railsconf 2010
Railsconf 2010
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Dernier (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

JRubyConf 2009

  • 2. JRuby on Google App Engine Extending the Java Platform & APIs John Woodell Nov 27, 2009 2 Wednesday, November 25, 2009
  • 3. What is Google App Engine? • A cloud-computing platform • We provide the container and services • Run your web apps on Google’s infrastructure • Pay-as-you-go, with free quota to get started 3 Wednesday, November 25, 2009
  • 4. WhiteHouse.gov/openforquestions 4 Wednesday, November 25, 2009
  • 5. Quotas and Billing Resource Provided Free Additional Cost CPU time 6.5 hours/day $0.10/hour Bandwidth In 1GByte/day $0.10/GByte Bandwidth Out 1GByte/day $0.12/GByte Stored Data 1 GB $0.005/GB-day Emails sent 2000/day to users $0.0001/email 50000/day to admins 5 Wednesday, November 25, 2009
  • 6. JRuby on App Engine 6 Wednesday, November 25, 2009
  • 7. Current Issues with JRuby on App Engine • Several seconds to “spin-up” a new JRuby instance • Some gems still need their extensions ported to Java • Not officially supported , but you have all that you need + = ? 7 Wednesday, November 25, 2009
  • 8. $ sudo gem install google-appengine Successfully installed appengine-rack-0.0.4 Successfully installed appengine-jruby-jars-0.0.6 Successfully installed appengine-sdk-1.2.6 Successfully installed appengine-tools-0.0.6 Successfully installed google-appengine-0.0.6 5 gems installed Installing ri documentation for appengine-rack-0.0.4... Installing ri documentation for appengine-jruby-jars-0.0.6... Installing ri documentation for appengine-sdk-1.2.6... Installing ri documentation for appengine-tools-0.0.6... Installing ri documentation for google-appengine-0.0.6... Installing RDoc documentation for appengine-rack-0.0.4... Installing RDoc documentation for appengine-jruby-jars-0.0.6... Installing RDoc documentation for appengine-sdk-1.2.6... Installing RDoc documentation for appengine-tools-0.0.6... Installing RDoc documentation for google-appengine-0.0.6... 8 Wednesday, November 25, 2009
  • 9. App Engine Gems • Development Gems – appengine-rack – appengine-tools dev_appserver.rb & appcfg.rb – appengine-sdk – appengine-jruby-jars • Runtime Gems – appengine-rack – dm-appengine – appengine-apis 9 Wednesday, November 25, 2009
  • 10. Dev AppServer • Customized Jetty server • Local implementation of services – LRU memcache – Disk-backed datastore – HttpClient-backed URLFetch • Emulates the production environment – Sandbox restrictions may be inconsistent, so run tests on production servers as well 10 Wednesday, November 25, 2009
  • 11. Deployment • Your app lives at – <app_id>.appspot.com, or – Custom domain with Google Apps • Deploying uploads – Static files – Resource files – Other metadata (datastore indexes, cron jobs) • Admin Console – dashboards – manage multiple versions – view logs 11 Wednesday, November 25, 2009
  • 12. App Engine JRuby APIs • AppEngine::Users • AppEngine::Datastore • AppEngine::Memcache • AppEngine::Mail • AppEngine::URLFetch • AppEngine::Images • AppEngine::Logger • AppEngine::Testing • AppEngine::XMPP • AppEngine::Labs::TaskQueue 12 Wednesday, November 25, 2009
  • 13. Users API • Existing User Account • Restrict your app to a domain map '/src' do use AppEngine::Rack::AdminRequired use AppEngine::Rack::SSLRequired run ActionController::Dispatcher.new end map '/' do run ActionController::Dispatcher.new end 13 Wednesday, November 25, 2009
  • 14. XMPP API 14 Wednesday, November 25, 2009
  • 15. Memcache API • No configuration required • Same API as Ruby-Memcache • Keys can be any Symbol or String • Can store any Marshalable or Serializable object cache = AppEngine::Memcache.new cache.set_many({:a => 1, :foo => 1..5}) a, foo = cache.get(:a, :foo) 15 Wednesday, November 25, 2009
  • 16. URL Fetch API • Drop-in replacement for Net::HTTP AppEngine::URLFetch.fetch(url, options={}) :method :payload :headers :allow_truncated :follow_redirects :deadline 16 Wednesday, November 25, 2009
  • 17. Small & Modular Frameworks • Rack • Sinatra • Merb/Rails3* • Duby * Currently unreleased 17 Wednesday, November 25, 2009
  • 18. DataMapper Finders # Comparisons you’d expect Zoo.first(:name => 'Galveston') # The 'gt/lt' means greater/less-than. Person.all(:age.gt => 30) Person.all(:age.lt => 40) # The 'gte/lte' means greather/less-than-or-equal-to. Person.all(:age.gte => 30) Person.all(:age.lte => 40) # The value of a pair is an Array Person.all(:name => 'Sam', :id => [ 1, 2, 3, 4, 5 ]) Person.all(:name => [ 'bob', 'rick', 'steve' ]) # Ordering Person.all(:order => [ :age.desc ]) 18 Wednesday, November 25, 2009
  • 19. DataMapper Associations • has n, has 1 • belongs_to, many_to_one class Post include DataMapper::Resource property :id, Serial property :message, Text has n, :comments end class Comment include DataMapper::Resource property :id, Serial property :message, Text belongs_to :post end 19 Wednesday, November 25, 2009
  • 21. Resources • John Woodell, woodie@google.com • Google App Engine for JRuby – http://code.google.com/p/appengine-jruby/ • Google Group – http://groups.google.com/group/appengine-jruby • Blog: JRuby on App Engine Blog – http://jruby-appengine.blogspot.com/ 21 Wednesday, November 25, 2009