SlideShare a Scribd company logo
JRuby

By Josh Moore
Who am I

 Josh Moore
    www.codingforrent.com
    twitter.com/codingforrent
    http://github.com/joshsmoore
  Ruby
    Watir at work
    Rails on the Google App Engine for hobby
        maintain rails_dm_datastore gem
Contents

 What is JRuby?
 Quick compare to MRI 1.8.7 and 1.9.1
 Gem Compatibility
 Java Integration
 Performance
 JRuby on Rails
 Short comings
 Google App Engine
What is JRuby

 Ruby interpreter on top of the JVM
   Started in 2001
   Runs rails in 2006
 Compatible syntax
   1.8.7/1.9.1(mostly)
Quick Comparison
        MRI 1.8.7              MRI 1.9.1             JRuby



Gems    Compatible             Fairly Compatible     Fairly Compatible



Rails   yes                    yes (Rails3)          yes



Speed          slow                 fast                   medium to fast
               Green threads        native threads         native threads


Pros    Compatibility               Fast                   medium Fast
                                    Better syntax?         Java integration
                                                           Ruby 1.8.x and 1.9
                                                           syntax

Cons    Slow                   ruby compatibility    C extension with
                               problems              compatibility problems
Ruby Gems

 Pure Ruby gems, no problem
 Gems with C extensions, have problems
    C extensions can work if invoked using
    the Foreign Function Invocation interface.
       Nokogiri
     Switch to using Java instead of C
       Hpricot
 Some gems are JRuby only
     Jemini
Performance




  Performance numbers using this project
Java Integration - Libraries
  Any library in the classpath can be accessed
  Maven is a Build/depedency management to for Java, acts
  like gems in ruby
      Similar to rake and gems put together
      Gemcutter - 10,467 gems
      Maven - 158,643 archives, thats a lot
      Coming with JRuby 1.5.0
Java Integration - Code

    nil == null
    self == this
    Java interfaces mapped to modules
    to_java converts ruby objects to Java objects
    Closer Convention
        Implement Java interfaces as blocks

b = JButton.new('click me')

b.add_action_listener do |event|
 JOptionPane.show_message_dialog nil, "Clicked"
end
Java Integration - Code
   Getters and Setters

Java                     Java in JRuby
   getA and setA            a and a=

   Object Creation
Java                     Java in JRuby
   new Object(1)            Object.new 1
Demo 1

Swing UI in Ruby
JVM Benefits

 World class garbage collection
 Performance
 Native Threads (really run rails in parallel)
 Pretty much runs on any hardware
JVM Optimization
JVM Optimization
Rails

  It just works (like most pure ruby libraries)
  Only deployment is different
       you can actually deploy and test in MRI and then deploy
       using JRuby
       deploy using warbler
Deploying Rails

  Packaged into WAR (Web Application Archive)
     Deployable on any Java Application server, or any Java
     hosting service.
     Including cloud hosting like Google App Engine
Known Problems

 ObjectSpace is disabled
 Slower startup time
 C extension incompatibilities
Rails on the
Google App Engine
    By Josh Moore
What is it?

  Cloud hosting solution provided by Google.
  Even more "cloudish" (ie less control and even
  easier scaling) then heroku
     All you do is submit your code and it runs you have no
     control over where it runs or what it is running on or even
     how many instances are running.
     Getting lots of request GAE simply starts up more
     instances of your app automatically.
     Computer resources scaled 100% dynamically
     Built for scalability, including sharding of data
Architecture
Persistence - Datastore

  No RDMS
  Datastore
     Fast
     Not a relational database
     No SQL, GQL instead
     Some fast SQL operations are slow
         Sums/counts are not really efficient so it is best to
         keep running totals.
         Joining can be very inefficient
     All these differences can be overcome, it just requires a
     paradigm shift.
Strengths

 Fluid scalability
     no configuration required
 Fairly complete API set
 Persistence designed for scalability
 Everything designed for dynamic scalability
 No need to worry about or configure anything on the server
 side
The Downsides/Restrictions

 Officially Java and Python
     Ruby support not official
 Restrictive
     Only 30 seconds per request (spin up time)
     Only one set of rules
     Cannot write to file system from app
     Code restrictions
         No Threads and other API restrictions
         Absolutely no C code
JRuby on GAE

 Tools - http://code.google.com/p/appengine-jruby/
    Project Run by John Woodell (Google employee)
    Also wraps the local development environment
 Work from MRI 1.8.7
    no need to mess with jruby
 Provide API wrappers for google services
 Rack adapter - Rails, Sinatra, or custom
    Rails patches provided
 Datamapper adapter
    No ActiveRecord
Rails

  Some Modification required
    Datamapper based
    TinyDS based
Demo 2
Why do I use JRuby and GAE

 I Learned Java in College
     Like to atleast have a chance of knowing what is going
     on under the hood
 GAE
     Still in its infancy so still lots of work to be done
Question?
http://api.wefeelfine.org:8080/ShowFeelings?
returnfields=feeling&limit=1&conditions=1

http://shootout.alioth.debian.org/u32/benchmark.php?
test=all&lang=yarv&lang2=ruby

http://blog.pluron.com/2009/05/ruby-19-performance.html

http://blog.headius.com/2009/04/how-jruby-makes-ruby-fast.
html

http://github.com/acangiano/ruby-benchmark-suite

http://www.jarvana.com/jarvana/info/repository_statistics

More Related Content

What's hot

Micronaut: Evolving Java for the Microservices and Serverless Era
Micronaut: Evolving Java for the Microservices and Serverless EraMicronaut: Evolving Java for the Microservices and Serverless Era
Micronaut: Evolving Java for the Microservices and Serverless Era
graemerocher
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
Ryan Cuprak
 
Migrating to Java 9 Modules
Migrating to Java 9 ModulesMigrating to Java 9 Modules
Migrating to Java 9 Modules
Sander Mak (@Sander_Mak)
 
Coding Your Way to Java 12
Coding Your Way to Java 12Coding Your Way to Java 12
Coding Your Way to Java 12
Sander Mak (@Sander_Mak)
 
Ruby Plugins for Jenkins
Ruby Plugins for JenkinsRuby Plugins for Jenkins
Ruby Plugins for Jenkins
cowboyd
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
Ryan Cuprak
 
How we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we gotHow we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we got
Baruch Sadogursky
 
Better Career with Java
Better Career with JavaBetter Career with Java
Better Career with Java
Mert Çalışkan
 
Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7
Roberto Cortez
 
MongoDB training for java software engineers
MongoDB training for java software engineersMongoDB training for java software engineers
MongoDB training for java software engineers
Moshe Kaplan
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]
Ryan Cuprak
 
Migrating to Java 11
Migrating to Java 11Migrating to Java 11
Migrating to Java 11
Arto Santala
 
Javantura v4 - JVM++ The GraalVM - Martin Toshev
Javantura v4 - JVM++ The GraalVM - Martin ToshevJavantura v4 - JVM++ The GraalVM - Martin Toshev
Javantura v4 - JVM++ The GraalVM - Martin Toshev
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
Ryan Cuprak
 
Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019
graemerocher
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
Johan Edstrom
 
Developing in the Cloud
Developing in the CloudDeveloping in the Cloud
Developing in the Cloud
Ryan Cuprak
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
Johan Edstrom
 
Your fist RubyMotion Application
Your fist RubyMotion ApplicationYour fist RubyMotion Application
Your fist RubyMotion Application
toamitkumar
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
Ryan Cuprak
 

What's hot (20)

Micronaut: Evolving Java for the Microservices and Serverless Era
Micronaut: Evolving Java for the Microservices and Serverless EraMicronaut: Evolving Java for the Microservices and Serverless Era
Micronaut: Evolving Java for the Microservices and Serverless Era
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
 
Migrating to Java 9 Modules
Migrating to Java 9 ModulesMigrating to Java 9 Modules
Migrating to Java 9 Modules
 
Coding Your Way to Java 12
Coding Your Way to Java 12Coding Your Way to Java 12
Coding Your Way to Java 12
 
Ruby Plugins for Jenkins
Ruby Plugins for JenkinsRuby Plugins for Jenkins
Ruby Plugins for Jenkins
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
How we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we gotHow we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we got
 
Better Career with Java
Better Career with JavaBetter Career with Java
Better Career with Java
 
Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7
 
MongoDB training for java software engineers
MongoDB training for java software engineersMongoDB training for java software engineers
MongoDB training for java software engineers
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]
 
Migrating to Java 11
Migrating to Java 11Migrating to Java 11
Migrating to Java 11
 
Javantura v4 - JVM++ The GraalVM - Martin Toshev
Javantura v4 - JVM++ The GraalVM - Martin ToshevJavantura v4 - JVM++ The GraalVM - Martin Toshev
Javantura v4 - JVM++ The GraalVM - Martin Toshev
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
Developing in the Cloud
Developing in the CloudDeveloping in the Cloud
Developing in the Cloud
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
 
Your fist RubyMotion Application
Your fist RubyMotion ApplicationYour fist RubyMotion Application
Your fist RubyMotion Application
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 

Similar to JRuby and Google App Engine

Practical JRuby
Practical JRubyPractical JRuby
Practical JRuby
David Keener
 
Ruby On Google App Engine 2nd Athens Ruby Me
Ruby On Google App Engine 2nd Athens Ruby MeRuby On Google App Engine 2nd Athens Ruby Me
Ruby On Google App Engine 2nd Athens Ruby Me
Panagiotis Papadopoulos
 
Dynamic Languages on the JVM
Dynamic Languages on the JVMDynamic Languages on the JVM
Dynamic Languages on the JVM
elliando dias
 
Rails On Spring
Rails On SpringRails On Spring
Rails On Spring
swamy g
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
Brian Sam-Bodden
 
JRuby in a Java World
JRuby in a Java WorldJRuby in a Java World
JRuby in a Java World
Mark Menard
 
JRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVMJRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVM
Raimonds Simanovskis
 
Ruby on Google App Engine: Upgrade to Google App "Turbo" Engine
Ruby on Google App Engine: Upgrade to Google App "Turbo" EngineRuby on Google App Engine: Upgrade to Google App "Turbo" Engine
Ruby on Google App Engine: Upgrade to Google App "Turbo" Engine
Joseph Ku
 
Day 8 - jRuby
Day 8 - jRubyDay 8 - jRuby
Day 8 - jRuby
Barry Jones
 
Charles Nutter Presentations
Charles Nutter PresentationsCharles Nutter Presentations
Charles Nutter Presentations
webuploader
 
Why don't you Groovy?
Why don't you Groovy?Why don't you Groovy?
Why don't you Groovy?
Orest Ivasiv
 
[2014.11.18] java script execution environment survey
[2014.11.18] java script execution environment survey[2014.11.18] java script execution environment survey
[2014.11.18] java script execution environment survey
DongGyun Han
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
Barry Jones
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
Oracle
 
Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009
Arun Gupta
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
elliando dias
 
Java2 platform
Java2 platformJava2 platform
Java2 platform
Sajan Sahu
 
Django vs. Ruby on Rails Comparison: Web Frameworks Performance and Popularity
Django vs. Ruby on Rails Comparison: Web Frameworks Performance and PopularityDjango vs. Ruby on Rails Comparison: Web Frameworks Performance and Popularity
Django vs. Ruby on Rails Comparison: Web Frameworks Performance and Popularity
rorbitssoftware
 
Ruby BDD for Java
Ruby BDD for JavaRuby BDD for Java
Ruby BDD for Java
Renzo Borgatti
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
mithunsasidharan
 

Similar to JRuby and Google App Engine (20)

Practical JRuby
Practical JRubyPractical JRuby
Practical JRuby
 
Ruby On Google App Engine 2nd Athens Ruby Me
Ruby On Google App Engine 2nd Athens Ruby MeRuby On Google App Engine 2nd Athens Ruby Me
Ruby On Google App Engine 2nd Athens Ruby Me
 
Dynamic Languages on the JVM
Dynamic Languages on the JVMDynamic Languages on the JVM
Dynamic Languages on the JVM
 
Rails On Spring
Rails On SpringRails On Spring
Rails On Spring
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
 
JRuby in a Java World
JRuby in a Java WorldJRuby in a Java World
JRuby in a Java World
 
JRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVMJRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVM
 
Ruby on Google App Engine: Upgrade to Google App "Turbo" Engine
Ruby on Google App Engine: Upgrade to Google App "Turbo" EngineRuby on Google App Engine: Upgrade to Google App "Turbo" Engine
Ruby on Google App Engine: Upgrade to Google App "Turbo" Engine
 
Day 8 - jRuby
Day 8 - jRubyDay 8 - jRuby
Day 8 - jRuby
 
Charles Nutter Presentations
Charles Nutter PresentationsCharles Nutter Presentations
Charles Nutter Presentations
 
Why don't you Groovy?
Why don't you Groovy?Why don't you Groovy?
Why don't you Groovy?
 
[2014.11.18] java script execution environment survey
[2014.11.18] java script execution environment survey[2014.11.18] java script execution environment survey
[2014.11.18] java script execution environment survey
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
 
Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
 
Java2 platform
Java2 platformJava2 platform
Java2 platform
 
Django vs. Ruby on Rails Comparison: Web Frameworks Performance and Popularity
Django vs. Ruby on Rails Comparison: Web Frameworks Performance and PopularityDjango vs. Ruby on Rails Comparison: Web Frameworks Performance and Popularity
Django vs. Ruby on Rails Comparison: Web Frameworks Performance and Popularity
 
Ruby BDD for Java
Ruby BDD for JavaRuby BDD for Java
Ruby BDD for Java
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 

Recently uploaded

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
marufrahmanstratejm
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 

Recently uploaded (20)

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 

JRuby and Google App Engine

  • 2. Who am I Josh Moore www.codingforrent.com twitter.com/codingforrent http://github.com/joshsmoore Ruby Watir at work Rails on the Google App Engine for hobby maintain rails_dm_datastore gem
  • 3. Contents What is JRuby? Quick compare to MRI 1.8.7 and 1.9.1 Gem Compatibility Java Integration Performance JRuby on Rails Short comings Google App Engine
  • 4. What is JRuby Ruby interpreter on top of the JVM Started in 2001 Runs rails in 2006 Compatible syntax 1.8.7/1.9.1(mostly)
  • 5. Quick Comparison MRI 1.8.7 MRI 1.9.1 JRuby Gems Compatible Fairly Compatible Fairly Compatible Rails yes yes (Rails3) yes Speed slow fast medium to fast Green threads native threads native threads Pros Compatibility Fast medium Fast Better syntax? Java integration Ruby 1.8.x and 1.9 syntax Cons Slow ruby compatibility C extension with problems compatibility problems
  • 6. Ruby Gems Pure Ruby gems, no problem Gems with C extensions, have problems C extensions can work if invoked using the Foreign Function Invocation interface. Nokogiri Switch to using Java instead of C Hpricot Some gems are JRuby only Jemini
  • 7. Performance Performance numbers using this project
  • 8. Java Integration - Libraries Any library in the classpath can be accessed Maven is a Build/depedency management to for Java, acts like gems in ruby Similar to rake and gems put together Gemcutter - 10,467 gems Maven - 158,643 archives, thats a lot Coming with JRuby 1.5.0
  • 9. Java Integration - Code nil == null self == this Java interfaces mapped to modules to_java converts ruby objects to Java objects Closer Convention Implement Java interfaces as blocks b = JButton.new('click me') b.add_action_listener do |event| JOptionPane.show_message_dialog nil, "Clicked" end
  • 10. Java Integration - Code Getters and Setters Java Java in JRuby getA and setA a and a= Object Creation Java Java in JRuby new Object(1) Object.new 1
  • 11. Demo 1 Swing UI in Ruby
  • 12. JVM Benefits World class garbage collection Performance Native Threads (really run rails in parallel) Pretty much runs on any hardware
  • 15. Rails It just works (like most pure ruby libraries) Only deployment is different you can actually deploy and test in MRI and then deploy using JRuby deploy using warbler
  • 16. Deploying Rails Packaged into WAR (Web Application Archive) Deployable on any Java Application server, or any Java hosting service. Including cloud hosting like Google App Engine
  • 17. Known Problems ObjectSpace is disabled Slower startup time C extension incompatibilities
  • 18. Rails on the Google App Engine By Josh Moore
  • 19. What is it? Cloud hosting solution provided by Google. Even more "cloudish" (ie less control and even easier scaling) then heroku All you do is submit your code and it runs you have no control over where it runs or what it is running on or even how many instances are running. Getting lots of request GAE simply starts up more instances of your app automatically. Computer resources scaled 100% dynamically Built for scalability, including sharding of data
  • 21. Persistence - Datastore No RDMS Datastore Fast Not a relational database No SQL, GQL instead Some fast SQL operations are slow Sums/counts are not really efficient so it is best to keep running totals. Joining can be very inefficient All these differences can be overcome, it just requires a paradigm shift.
  • 22. Strengths Fluid scalability no configuration required Fairly complete API set Persistence designed for scalability Everything designed for dynamic scalability No need to worry about or configure anything on the server side
  • 23. The Downsides/Restrictions Officially Java and Python Ruby support not official Restrictive Only 30 seconds per request (spin up time) Only one set of rules Cannot write to file system from app Code restrictions No Threads and other API restrictions Absolutely no C code
  • 24. JRuby on GAE Tools - http://code.google.com/p/appengine-jruby/ Project Run by John Woodell (Google employee) Also wraps the local development environment Work from MRI 1.8.7 no need to mess with jruby Provide API wrappers for google services Rack adapter - Rails, Sinatra, or custom Rails patches provided Datamapper adapter No ActiveRecord
  • 25. Rails Some Modification required Datamapper based TinyDS based
  • 27. Why do I use JRuby and GAE I Learned Java in College Like to atleast have a chance of knowing what is going on under the hood GAE Still in its infancy so still lots of work to be done