SlideShare una empresa de Scribd logo
1 de 23
Sunday, May 9, 2010
JRuby on App Engine
            Run Ruby apps on Google Servers,
            with access to first-class Java APIs
            John Woodell
            May 6, 2010




              2



Sunday, May 9, 2010
Google App Engine
              3



Sunday, May 9, 2010
Key Features
            • No need to install or maintain your own stack
            • Use Google scalable services via standard APIs
            • Built-in application management console
            • Google does the scaling for you
            • Pay-as-you-go, with free quota to get started




              4



Sunday, May 9, 2010
Key Limitations
            • No native code
            • No threads or sockets
            • No writing to the filesystem
            • No relational database
            • No more than 30 seconds per request




              5



Sunday, May 9, 2010
Dev AppServer
            • 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




              6



Sunday, May 9, 2010
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



              7



Sunday, May 9, 2010
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

              8



Sunday, May 9, 2010
App Engine Product Roadmap
            • SSL for third-party domains
            • Background servers capable of running for longer than 30s
            • Ability to reserve instances to reduce application loading overhead
            • Ability to select different availability vs. latency options for Datastore
            • Support for mapping operations across datasets
            • Datastore dump and restore facility
            • Raise request/response size limits for some APIs
            • Improved monitoring and alerting of application serving
            • Support for Browser Push (Comet) communication
            • Built-in support for OAuth & OpenID



              9



Sunday, May 9, 2010
JRuby on App Engine
             10



Sunday, May 9, 2010
Rails Deployment History
           • 2004 - FastCGI on Apache or Lighttpd
                      “a rocket that sometimes blows up in strange ways”
           • 2006 - Mongrel clusters behind Apache mod_proxy
                      “high throughput, but requires multiple moving parts”
           • 2008 - Phusion Passenger on Apache
                      “simply upload files, rack-based, REE/COW”
           • 2010 - Running in a servlet container with JRuby-Rack
                      “powerful/portable/scalable, rack-based, JRuby”




             11



Sunday, May 9, 2010
Benefits of JRuby
            • Outperforms MRI in many cases... 2x to 10x
            • Gem extensions written in Java (no more segfaults)
            • A wealth of integration options and first-class Java APIs
            • Spin-up new instances quickly using Duby (or Java) servlets




             12



Sunday, May 9, 2010
App Engine JRuby Milestones
            • 2009-04-08   @olabini publishes blog post on YARBL
            • 2009-05-06   RailsConf
            • 2009-11-02   0.0.5 bundler, precompilation, Duby
            • 2009-11-20   RubyConf
            • 2009-12-02   0.0.6 Rails 3.0.pre primer & image demos
            • 2009-12-27   @urekat publishes Rails 2.3.5 patches
            • 2010-01-21   0.0.8 Rails 2.3.5 Primer for DM & TinyDS
            • 2010-01-26   0.0.9 Mechanize and Hpricot demos
            • 2010-02-19   @carlhuda publishes bundler08
            • 2010-02-27   0.0.10 ActionMailer demos
            • 2010-04-08   0.0.11 deferred dispatcher (early look)
            • 2010-05-06   0.0.12 JRuby 1.5 & OpenSSL 0.7
             13



Sunday, May 9, 2010
Current Issues with JRuby on App Engine
            • Several seconds to “spin-up” a new JRuby instance
            • Some gems may need their extensions ported to Java
            • Not officially supported , but you have all that you need




                                       +
             14



Sunday, May 9, 2010
Install it Now

                      sudo gem install google-appengine



                        Everything you need installs as gems


             15



Sunday, May 9, 2010
App Engine Gems
            • Development Gems
              – appengine-sdk
              – appengine-jruby-jars
              – appengine-rack
              – appengine-tools . . . dev_appserver.rb & appcfg.rb
            • Runtime Gems
                  – appengine-rack . . . . rack & jruby-rack
                  – appengine-apis
            • Related Gems
              – dm-appengine
                  – rails_appengine
                  – rails_dm_datastore
                  – rails_tiny_ds
             16



Sunday, May 9, 2010
App Engine JRuby APIs
            • AppEngine::Users
            • AppEngine::Datastore
            • AppEngine::Memcache
            • AppEngine::Mail
            • AppEngine::URLFetch
            • AppEngine::Images
            • AppEngine::Logger
            • AppEngine::XMPP
            • AppEngine::Labs::TaskQueue




             17



Sunday, May 9, 2010
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



             18



Sunday, May 9, 2010
Datastore API + DataMapper
             # 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 ])

             19



Sunday, May 9, 2010
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)




             20



Sunday, May 9, 2010
URL Fetch API
            • Drop-in replacement for Net::HTTP


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

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




             21



Sunday, May 9, 2010
Resources
            • John Woodell, @johnwoodell
            • Blog
                  – http://jruby-appengine.blogspot.com/
            • Code Site
                  – http://code.google.com/p/appengine-jruby/
            • Google Group
                  – http://groups.google.com/group/appengine-jruby




             22



Sunday, May 9, 2010
Sunday, May 9, 2010

Más contenido relacionado

La actualidad más candente

Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with Memcached
Acquia
 
Uptime Database Appliance - Technology Preview
Uptime Database Appliance - Technology PreviewUptime Database Appliance - Technology Preview
Uptime Database Appliance - Technology Preview
Uptime Technologies LLC
 
Beyond Horizontal Scalability: Concurrency and Messaging Using Spring
Beyond Horizontal Scalability: Concurrency and Messaging Using SpringBeyond Horizontal Scalability: Concurrency and Messaging Using Spring
Beyond Horizontal Scalability: Concurrency and Messaging Using Spring
Bruce Snyder
 
DataMapper on Infinispan
DataMapper on InfinispanDataMapper on Infinispan
DataMapper on Infinispan
Lance Ball
 
Enterprise Messaging With Spring JMS
Enterprise Messaging With Spring JMSEnterprise Messaging With Spring JMS
Enterprise Messaging With Spring JMS
Bruce Snyder
 
TorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e RubyTorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e Ruby
Bruno Oliveira
 

La actualidad más candente (19)

Crank Up Your Apps With TorqueBox
Crank Up Your Apps With TorqueBoxCrank Up Your Apps With TorqueBox
Crank Up Your Apps With TorqueBox
 
Puppet Camp New York 2015: Puppet Enterprise Scaling Lessons Learned (Interme...
Puppet Camp New York 2015: Puppet Enterprise Scaling Lessons Learned (Interme...Puppet Camp New York 2015: Puppet Enterprise Scaling Lessons Learned (Interme...
Puppet Camp New York 2015: Puppet Enterprise Scaling Lessons Learned (Interme...
 
Pitfalls of Continuous Deployment
Pitfalls of Continuous DeploymentPitfalls of Continuous Deployment
Pitfalls of Continuous Deployment
 
Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with Memcached
 
Uptime Database Appliance - Technology Preview
Uptime Database Appliance - Technology PreviewUptime Database Appliance - Technology Preview
Uptime Database Appliance - Technology Preview
 
Thinking through puppet code layout
Thinking through puppet code layoutThinking through puppet code layout
Thinking through puppet code layout
 
Making DSpace XMLUI Your Own
Making DSpace XMLUI Your OwnMaking DSpace XMLUI Your Own
Making DSpace XMLUI Your Own
 
Docker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developersDocker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developers
 
Introducing Immutant
Introducing Immutant Introducing Immutant
Introducing Immutant
 
Beyond Horizontal Scalability: Concurrency and Messaging Using Spring
Beyond Horizontal Scalability: Concurrency and Messaging Using SpringBeyond Horizontal Scalability: Concurrency and Messaging Using Spring
Beyond Horizontal Scalability: Concurrency and Messaging Using Spring
 
Caching and JCache with Greg Luck 18.02.16
Caching and JCache with Greg Luck 18.02.16Caching and JCache with Greg Luck 18.02.16
Caching and JCache with Greg Luck 18.02.16
 
DataMapper on Infinispan
DataMapper on InfinispanDataMapper on Infinispan
DataMapper on Infinispan
 
Enterprise Messaging With Spring JMS
Enterprise Messaging With Spring JMSEnterprise Messaging With Spring JMS
Enterprise Messaging With Spring JMS
 
Managing MySQL with Ansible
Managing MySQL with AnsibleManaging MySQL with Ansible
Managing MySQL with Ansible
 
Learn you some Ansible for great good!
Learn you some Ansible for great good!Learn you some Ansible for great good!
Learn you some Ansible for great good!
 
TorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e RubyTorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e Ruby
 
Postgres Plus Cloud Database on OpenStack
Postgres Plus Cloud Database on OpenStackPostgres Plus Cloud Database on OpenStack
Postgres Plus Cloud Database on OpenStack
 
Puppet_training
Puppet_trainingPuppet_training
Puppet_training
 
IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...
IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...
IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...
 

Similar a Red Dirt Ruby Conference

Aloha on-rails-2009
Aloha on-rails-2009Aloha on-rails-2009
Aloha on-rails-2009
John Woodell
 
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Guillaume Laforge
 
Google appenginejava.ppt
Google appenginejava.pptGoogle appenginejava.ppt
Google appenginejava.ppt
Young Alista
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
catherinewall
 

Similar a Red Dirt Ruby Conference (20)

App Engine Meetup
App Engine MeetupApp Engine Meetup
App Engine Meetup
 
Aloha on-rails-2009
Aloha on-rails-2009Aloha on-rails-2009
Aloha on-rails-2009
 
Railsconf 2010
Railsconf 2010Railsconf 2010
Railsconf 2010
 
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
 
JRubyConf 2009
JRubyConf 2009JRubyConf 2009
JRubyConf 2009
 
Oscon 2010
Oscon 2010Oscon 2010
Oscon 2010
 
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
 
AppEngine Performance Tuning
AppEngine Performance TuningAppEngine Performance Tuning
AppEngine Performance Tuning
 
Gaelyk - Groovy Grails eXchange 2010 - Guillaume Laforge
Gaelyk - Groovy Grails eXchange 2010 - Guillaume LaforgeGaelyk - Groovy Grails eXchange 2010 - Guillaume Laforge
Gaelyk - Groovy Grails eXchange 2010 - Guillaume Laforge
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
2011 June - Singapore GTUG presentation. App Engine program update + intro to Go
2011 June - Singapore GTUG presentation. App Engine program update + intro to Go2011 June - Singapore GTUG presentation. App Engine program update + intro to Go
2011 June - Singapore GTUG presentation. App Engine program update + intro to Go
 
Node.js
Node.jsNode.js
Node.js
 
What is Google App Engine?
What is Google App Engine?What is Google App Engine?
What is Google App Engine?
 
Kuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsKuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails Apps
 
Rubypalooza 2009
Rubypalooza 2009Rubypalooza 2009
Rubypalooza 2009
 
Google appenginejava.ppt
Google appenginejava.pptGoogle appenginejava.ppt
Google appenginejava.ppt
 
Gaelyk - Paris GGUG 2011 - Guillaume Laforge
Gaelyk - Paris GGUG 2011 - Guillaume LaforgeGaelyk - Paris GGUG 2011 - Guillaume Laforge
Gaelyk - Paris GGUG 2011 - Guillaume Laforge
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
Surrogate dependencies (in node js) v1.0
Surrogate dependencies  (in node js)  v1.0Surrogate dependencies  (in node js)  v1.0
Surrogate dependencies (in node js) v1.0
 
AWS (Hadoop) Meetup 30.04.09
AWS (Hadoop) Meetup 30.04.09AWS (Hadoop) Meetup 30.04.09
AWS (Hadoop) Meetup 30.04.09
 

Más de John Woodell

Más de John Woodell (6)

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
 
RubyConf 2009
RubyConf 2009RubyConf 2009
RubyConf 2009
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 

Red Dirt Ruby Conference

  • 2. JRuby on App Engine Run Ruby apps on Google Servers, with access to first-class Java APIs John Woodell May 6, 2010 2 Sunday, May 9, 2010
  • 3. Google App Engine 3 Sunday, May 9, 2010
  • 4. Key Features • No need to install or maintain your own stack • Use Google scalable services via standard APIs • Built-in application management console • Google does the scaling for you • Pay-as-you-go, with free quota to get started 4 Sunday, May 9, 2010
  • 5. Key Limitations • No native code • No threads or sockets • No writing to the filesystem • No relational database • No more than 30 seconds per request 5 Sunday, May 9, 2010
  • 6. Dev AppServer • 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 6 Sunday, May 9, 2010
  • 7. 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 7 Sunday, May 9, 2010
  • 8. 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 8 Sunday, May 9, 2010
  • 9. App Engine Product Roadmap • SSL for third-party domains • Background servers capable of running for longer than 30s • Ability to reserve instances to reduce application loading overhead • Ability to select different availability vs. latency options for Datastore • Support for mapping operations across datasets • Datastore dump and restore facility • Raise request/response size limits for some APIs • Improved monitoring and alerting of application serving • Support for Browser Push (Comet) communication • Built-in support for OAuth & OpenID 9 Sunday, May 9, 2010
  • 10. JRuby on App Engine 10 Sunday, May 9, 2010
  • 11. Rails Deployment History • 2004 - FastCGI on Apache or Lighttpd “a rocket that sometimes blows up in strange ways” • 2006 - Mongrel clusters behind Apache mod_proxy “high throughput, but requires multiple moving parts” • 2008 - Phusion Passenger on Apache “simply upload files, rack-based, REE/COW” • 2010 - Running in a servlet container with JRuby-Rack “powerful/portable/scalable, rack-based, JRuby” 11 Sunday, May 9, 2010
  • 12. Benefits of JRuby • Outperforms MRI in many cases... 2x to 10x • Gem extensions written in Java (no more segfaults) • A wealth of integration options and first-class Java APIs • Spin-up new instances quickly using Duby (or Java) servlets 12 Sunday, May 9, 2010
  • 13. App Engine JRuby Milestones • 2009-04-08 @olabini publishes blog post on YARBL • 2009-05-06 RailsConf • 2009-11-02 0.0.5 bundler, precompilation, Duby • 2009-11-20 RubyConf • 2009-12-02 0.0.6 Rails 3.0.pre primer & image demos • 2009-12-27 @urekat publishes Rails 2.3.5 patches • 2010-01-21 0.0.8 Rails 2.3.5 Primer for DM & TinyDS • 2010-01-26 0.0.9 Mechanize and Hpricot demos • 2010-02-19 @carlhuda publishes bundler08 • 2010-02-27 0.0.10 ActionMailer demos • 2010-04-08 0.0.11 deferred dispatcher (early look) • 2010-05-06 0.0.12 JRuby 1.5 & OpenSSL 0.7 13 Sunday, May 9, 2010
  • 14. Current Issues with JRuby on App Engine • Several seconds to “spin-up” a new JRuby instance • Some gems may need their extensions ported to Java • Not officially supported , but you have all that you need + 14 Sunday, May 9, 2010
  • 15. Install it Now sudo gem install google-appengine Everything you need installs as gems 15 Sunday, May 9, 2010
  • 16. App Engine Gems • Development Gems – appengine-sdk – appengine-jruby-jars – appengine-rack – appengine-tools . . . dev_appserver.rb & appcfg.rb • Runtime Gems – appengine-rack . . . . rack & jruby-rack – appengine-apis • Related Gems – dm-appengine – rails_appengine – rails_dm_datastore – rails_tiny_ds 16 Sunday, May 9, 2010
  • 17. App Engine JRuby APIs • AppEngine::Users • AppEngine::Datastore • AppEngine::Memcache • AppEngine::Mail • AppEngine::URLFetch • AppEngine::Images • AppEngine::Logger • AppEngine::XMPP • AppEngine::Labs::TaskQueue 17 Sunday, May 9, 2010
  • 18. 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 18 Sunday, May 9, 2010
  • 19. Datastore API + DataMapper # 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 ]) 19 Sunday, May 9, 2010
  • 20. 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) 20 Sunday, May 9, 2010
  • 21. URL Fetch API • Drop-in replacement for Net::HTTP AppEngine::URLFetch.fetch(url, options={}) :method :payload :headers :allow_truncated :follow_redirects :deadline 21 Sunday, May 9, 2010
  • 22. Resources • John Woodell, @johnwoodell • Blog – http://jruby-appengine.blogspot.com/ • Code Site – http://code.google.com/p/appengine-jruby/ • Google Group – http://groups.google.com/group/appengine-jruby 22 Sunday, May 9, 2010