SlideShare una empresa de Scribd logo
1 de 50
An introduction to Maglev

         Rudi Engelbrecht


               Ruby Conf - 17 June 2011
lautus
MagLev Concepts




lautus            MiniRubyConf
MagLev Concepts
    • Root Object




lautus              MiniRubyConf
MagLev Concepts
    • Root Object
    • Persistency by Reachability




lautus                     MiniRubyConf
MagLev Concepts
    • Root Object
    • Persistency by Reachability
     • (transitive closure)




lautus                        MiniRubyConf
MagLev Concepts
    • Root Object
    • Persistency by Reachability
     • (transitive closure)
    • Repository (Stone)


lautus                        MiniRubyConf
MagLev Concepts
    • Root Object
    • Persistency by Reachability
     • (transitive closure)
    • Repository (Stone)
    • Virtual Machines (Gems)

lautus                        MiniRubyConf
MagLev Concepts
    • Root Object
    • Persistency by Reachability
     • (transitive closure)
    • Repository (Stone)
    • Virtual Machines (Gems)
     • local vs remote gems
lautus                        MiniRubyConf
MagLev Concepts
    • Root Object
    • Persistency by Reachability
     • (transitive closure)
    • Repository (Stone)
    • Virtual Machines (Gems)
     • local vs remote gems
    • Garbage Collector
lautus                        MiniRubyConf
Ruby
        VM


       Ruby
        VM    Shared
               Page    Repository
              Cache
Ruby
 VM


Ruby
 VM
TwitterClone
 class Person                                def remove_follower(person)
                                              @followers.delete(person)
 attr_accessor :username, :followers         end

  def initialize(username)                   def to_s
   @username = username                       result = "@#{@username} -->
   @followers = Array.new                  [#{@followers.size}]"
  end                                         @followers.each {|f| result = result +
                                           " #{f.username}" }
  def add_follower(person)                    result
   @followers << person                      end
  end                                      end

lautus                                 MiniRubyConf
TwitterClone
 Maglev.persistent do
  require 'person'
 end

 Maglev::PERSISTENT_ROOT[:persons] = Array.new

 Maglev.commit_transaction




lautus                         MiniRubyConf
person.rb
person.rb




person.rb
:persons

                 Array




  person.rb




person.rb
:persons

                 Array


                             :persons

                                        Array

  person.rb



                         person.rb
person.rb
TwitterClone
 require 'person'

 dhh = Person.new("dhh")             persons =
 obie = Person.new("obie")           Maglev::PERSISTENT_ROOT[:persons]
 unclebob = Person.new("unclebob")
 noob1 = Person.new("noob1")         persons << dhh
 noob2 = Person.new("noob2")         persons << obie
                                     persons << unclebob
 dhh.add_follower(obie)
 dhh.add_follower(unclebob)          Maglev.commit_transaction
 obie.add_follower(unclebob)
 unclebob.add_follower(noob1)
 unclebob.add_follower(noob2)
lautus                           MiniRubyConf
:persons

           Array


                   :persons

                              Array
:persons

             Array


dhh                  :persons

                                Array
:persons

              Array


dhh    obie           :persons

                                 Array
:persons

              Array


dhh    obie               :persons

               unclebob              Array
:persons

              Array


dhh    obie               :persons

               unclebob              Array
:persons

              Array


dhh    obie               :persons

               unclebob              Array
:persons

              Array


dhh    obie               :persons

               unclebob              Array
:persons

                Array


dhh      obie               :persons

                 unclebob              Array


      noob1
:persons

                Array


dhh      obie               :persons

                 unclebob              Array


      noob1     noob2
:persons

                Array


dhh      obie                 :persons

                 unclebob                    Array


      noob1                 dhh      obie
                noob2
                                              unclebob


                             noob1          noob2
TwitterClone

 persons = Maglev::PERSISTENT_ROOT[:persons]

 persons.each {|p| puts p}




lautus                         MiniRubyConf
TwitterClone




lautus         MiniRubyConf
TwitterClone


    • Multiple VM’s



lautus                MiniRubyConf
TwitterClone


    • Multiple VM’s
    • Concurrent access - MVCC


lautus                  MiniRubyConf
TwitterClone


    • Multiple VM’s
    • Concurrent access - MVCC
    • First commit wins

lautus                  MiniRubyConf
TwitterClone2                                                 def add_follower(person)
 class Person                                                  @followers << person
   attr_accessor :username, :email, :followers, :following    end

  def initialize(username)                                    def remove_follower(person)
   @username = username                                        @followers.delete(person)
   @email = username + "@mail.com"                            end
   @followers = Array.new
   @following = Array.new                                     def to_s
  end                                                          result = "@#{@username} --> [#{@following.size} :
                                                             #{@followers.size}]"
  def follows(person)                                          result = result + " following: {"
   @following << person                                        @following.each {|f| result = result + " #{f.username}"}
   person.add_follower(self)                                   result = result + " }"
  end                                                          result = result + " followed by: {"
                                                               @followers.each {|f| result = result + " #{f.username}"}
  def unfollows(person)                                        result = result + " }"
   @following.delete(person)                                   result
   person.remove_follower(self)                               end
  end                                                        end


lautus                                                   MiniRubyConf
TwitterClone2
 Maglev.persistent do
  require 'person'
 end

 Maglev::PERSISTENT_ROOT[:persons] = Array.new

 Maglev.commit_transaction




lautus                         MiniRubyConf
TwitterClone2
    require 'person'

    dhh = Person.new("dhh")
    obie = Person.new("obie")
    unclebob = Person.new("unclebob")
    noob1 = Person.new("noob1")
    noob2 = Person.new("noob2")

    obie.follows(dhh)
    unclebob.follows(dhh)
    unclebob.follows(obie)
    noob1.follows(unclebob)
    noob2.follows(unclebob)

    persons = Maglev::PERSISTENT_ROOT[:persons]

    persons << dhh
    persons << obie
    persons << unclebob

lautus                                      MiniRubyConf
TwitterClone2

 persons = Maglev::PERSISTENT_ROOT[:persons]

 persons.each {|p| puts p}




lautus                         MiniRubyConf
MagLev




lautus   MiniRubyConf
MagLev


    • Concurrent access to objects in distributed VM’s



lautus                     MiniRubyConf
MagLev


    • Concurrent access to objects in distributed VM’s
    • Rabbit in hat trick


lautus                     MiniRubyConf
MagLev


    • Concurrent access to objects in distributed VM’s
    • Rabbit in hat trick
    • Proc’s can be persisted

lautus                     MiniRubyConf
MagLev


    • Concurrent access to objects in distributed VM’s
    • Rabbit in hat trick
    • Proc’s can be persisted
     • references enclosing environment’s variables

lautus                         MiniRubyConf
Dinner




lautus   MiniRubyConf
Dinner



    • Enjoy!


lautus         MiniRubyConf

Más contenido relacionado

La actualidad más candente

#살아있다 #자프링외길12년차 #코프링2개월생존기
#살아있다 #자프링외길12년차 #코프링2개월생존기#살아있다 #자프링외길12년차 #코프링2개월생존기
#살아있다 #자프링외길12년차 #코프링2개월생존기Arawn Park
 
Moose talk at FOSDEM 2011 (Perl devroom)
Moose talk at FOSDEM 2011 (Perl devroom)Moose talk at FOSDEM 2011 (Perl devroom)
Moose talk at FOSDEM 2011 (Perl devroom)xSawyer
 
HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係Kiwamu Okabe
 
Introduction to Moose
Introduction to MooseIntroduction to Moose
Introduction to Moosethashaa
 
Realm: Building a mobile database
Realm: Building a mobile databaseRealm: Building a mobile database
Realm: Building a mobile databaseChristian Melchior
 
JS Level Up: Prototypes
JS Level Up: PrototypesJS Level Up: Prototypes
JS Level Up: PrototypesVernon Kesner
 
Golang slidesaudrey
Golang slidesaudreyGolang slidesaudrey
Golang slidesaudreyAudrey Lim
 
Webinar: MongoDB Persistence with Java and Morphia
Webinar: MongoDB Persistence with Java and MorphiaWebinar: MongoDB Persistence with Java and Morphia
Webinar: MongoDB Persistence with Java and MorphiaMongoDB
 
Why is Haskell so hard! (And how to deal with it?)
Why is Haskell so hard! (And how to deal with it?)Why is Haskell so hard! (And how to deal with it?)
Why is Haskell so hard! (And how to deal with it?)Saurabh Nanda
 
Javascript the New Parts v2
Javascript the New Parts v2Javascript the New Parts v2
Javascript the New Parts v2Federico Galassi
 
Modern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlModern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlNova Patch
 
Moose (Perl 5)
Moose (Perl 5)Moose (Perl 5)
Moose (Perl 5)xSawyer
 
7주 JavaScript 실습
7주 JavaScript 실습7주 JavaScript 실습
7주 JavaScript 실습지수 윤
 

La actualidad más candente (20)

#살아있다 #자프링외길12년차 #코프링2개월생존기
#살아있다 #자프링외길12년차 #코프링2개월생존기#살아있다 #자프링외길12년차 #코프링2개월생존기
#살아있다 #자프링외길12년차 #코프링2개월생존기
 
Moose talk at FOSDEM 2011 (Perl devroom)
Moose talk at FOSDEM 2011 (Perl devroom)Moose talk at FOSDEM 2011 (Perl devroom)
Moose talk at FOSDEM 2011 (Perl devroom)
 
HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係
 
Realm to Json & Royal
Realm to Json & RoyalRealm to Json & Royal
Realm to Json & Royal
 
Persistens i scala
Persistens i scalaPersistens i scala
Persistens i scala
 
Introduction to Moose
Introduction to MooseIntroduction to Moose
Introduction to Moose
 
Realm: Building a mobile database
Realm: Building a mobile databaseRealm: Building a mobile database
Realm: Building a mobile database
 
JS Level Up: Prototypes
JS Level Up: PrototypesJS Level Up: Prototypes
JS Level Up: Prototypes
 
Golang slidesaudrey
Golang slidesaudreyGolang slidesaudrey
Golang slidesaudrey
 
Webinar: MongoDB Persistence with Java and Morphia
Webinar: MongoDB Persistence with Java and MorphiaWebinar: MongoDB Persistence with Java and Morphia
Webinar: MongoDB Persistence with Java and Morphia
 
Elastic search 검색
Elastic search 검색Elastic search 검색
Elastic search 검색
 
Why is Haskell so hard! (And how to deal with it?)
Why is Haskell so hard! (And how to deal with it?)Why is Haskell so hard! (And how to deal with it?)
Why is Haskell so hard! (And how to deal with it?)
 
1.1 motivation
1.1 motivation1.1 motivation
1.1 motivation
 
Floggy-M3DD-2009-01-21
Floggy-M3DD-2009-01-21Floggy-M3DD-2009-01-21
Floggy-M3DD-2009-01-21
 
Javascript the New Parts v2
Javascript the New Parts v2Javascript the New Parts v2
Javascript the New Parts v2
 
Modern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlModern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in Perl
 
Android Guava
Android GuavaAndroid Guava
Android Guava
 
Moose (Perl 5)
Moose (Perl 5)Moose (Perl 5)
Moose (Perl 5)
 
7주 JavaScript 실습
7주 JavaScript 실습7주 JavaScript 실습
7주 JavaScript 실습
 
Intro to Redis
Intro to RedisIntro to Redis
Intro to Redis
 

Similar a Introduction to Ruby MagLev

Maglev Rubyfuza, Cape Town, 2012
Maglev Rubyfuza, Cape Town, 2012Maglev Rubyfuza, Cape Town, 2012
Maglev Rubyfuza, Cape Town, 2012rengelbrecht
 
Ruby - Uma Introdução
Ruby - Uma IntroduçãoRuby - Uma Introdução
Ruby - Uma IntroduçãoÍgor Bonadio
 
Ruby 入門 第一次就上手
Ruby 入門 第一次就上手Ruby 入門 第一次就上手
Ruby 入門 第一次就上手Wen-Tien Chang
 
Ruby 程式語言入門導覽
Ruby 程式語言入門導覽Ruby 程式語言入門導覽
Ruby 程式語言入門導覽Wen-Tien Chang
 
Desarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutosDesarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutosEdgar Suarez
 
Introductionto fp with groovy
Introductionto fp with groovyIntroductionto fp with groovy
Introductionto fp with groovyIsuru Samaraweera
 
Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2Henry S
 
Postobjektové programovanie v Ruby
Postobjektové programovanie v RubyPostobjektové programovanie v Ruby
Postobjektové programovanie v RubyJano Suchal
 
Rails Model Basics
Rails Model BasicsRails Model Basics
Rails Model BasicsJames Gray
 
Модерни езици за програмиране за JVM (2011)
Модерни езици за програмиране за JVM (2011)Модерни езици за програмиране за JVM (2011)
Модерни езици за програмиране за JVM (2011)Bozhidar Batsov
 
Akka and the Zen of Reactive System Design
Akka and the Zen of Reactive System DesignAkka and the Zen of Reactive System Design
Akka and the Zen of Reactive System DesignLightbend
 
Rails for PHP Developers
Rails for PHP DevelopersRails for PHP Developers
Rails for PHP DevelopersRobert Dempsey
 
Removing Methods (MOTM 2010.01)
Removing Methods (MOTM 2010.01)Removing Methods (MOTM 2010.01)
Removing Methods (MOTM 2010.01)Kevin Munc
 
Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Brian Hogan
 
Rails workshop for Java people (September 2015)
Rails workshop for Java people (September 2015)Rails workshop for Java people (September 2015)
Rails workshop for Java people (September 2015)Andre Foeken
 
Ruby :: Training 1
Ruby :: Training 1Ruby :: Training 1
Ruby :: Training 1Pavel Tyk
 
Active Support Core Extensions (1)
Active Support Core Extensions (1)Active Support Core Extensions (1)
Active Support Core Extensions (1)RORLAB
 

Similar a Introduction to Ruby MagLev (20)

Maglev Rubyfuza, Cape Town, 2012
Maglev Rubyfuza, Cape Town, 2012Maglev Rubyfuza, Cape Town, 2012
Maglev Rubyfuza, Cape Town, 2012
 
Ruby - Uma Introdução
Ruby - Uma IntroduçãoRuby - Uma Introdução
Ruby - Uma Introdução
 
Ruby 入門 第一次就上手
Ruby 入門 第一次就上手Ruby 入門 第一次就上手
Ruby 入門 第一次就上手
 
Ruby 程式語言入門導覽
Ruby 程式語言入門導覽Ruby 程式語言入門導覽
Ruby 程式語言入門導覽
 
Desarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutosDesarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutos
 
Groovy unleashed
Groovy unleashed Groovy unleashed
Groovy unleashed
 
Spl Not A Bridge Too Far phpNW09
Spl Not A Bridge Too Far phpNW09Spl Not A Bridge Too Far phpNW09
Spl Not A Bridge Too Far phpNW09
 
Introductionto fp with groovy
Introductionto fp with groovyIntroductionto fp with groovy
Introductionto fp with groovy
 
Profiling Ruby
Profiling RubyProfiling Ruby
Profiling Ruby
 
Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2
 
Postobjektové programovanie v Ruby
Postobjektové programovanie v RubyPostobjektové programovanie v Ruby
Postobjektové programovanie v Ruby
 
Rails Model Basics
Rails Model BasicsRails Model Basics
Rails Model Basics
 
Модерни езици за програмиране за JVM (2011)
Модерни езици за програмиране за JVM (2011)Модерни езици за програмиране за JVM (2011)
Модерни езици за програмиране за JVM (2011)
 
Akka and the Zen of Reactive System Design
Akka and the Zen of Reactive System DesignAkka and the Zen of Reactive System Design
Akka and the Zen of Reactive System Design
 
Rails for PHP Developers
Rails for PHP DevelopersRails for PHP Developers
Rails for PHP Developers
 
Removing Methods (MOTM 2010.01)
Removing Methods (MOTM 2010.01)Removing Methods (MOTM 2010.01)
Removing Methods (MOTM 2010.01)
 
Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7
 
Rails workshop for Java people (September 2015)
Rails workshop for Java people (September 2015)Rails workshop for Java people (September 2015)
Rails workshop for Java people (September 2015)
 
Ruby :: Training 1
Ruby :: Training 1Ruby :: Training 1
Ruby :: Training 1
 
Active Support Core Extensions (1)
Active Support Core Extensions (1)Active Support Core Extensions (1)
Active Support Core Extensions (1)
 

Último

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Último (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

Introduction to Ruby MagLev

  • 1. An introduction to Maglev Rudi Engelbrecht Ruby Conf - 17 June 2011 lautus
  • 2. MagLev Concepts lautus MiniRubyConf
  • 3. MagLev Concepts • Root Object lautus MiniRubyConf
  • 4. MagLev Concepts • Root Object • Persistency by Reachability lautus MiniRubyConf
  • 5. MagLev Concepts • Root Object • Persistency by Reachability • (transitive closure) lautus MiniRubyConf
  • 6. MagLev Concepts • Root Object • Persistency by Reachability • (transitive closure) • Repository (Stone) lautus MiniRubyConf
  • 7. MagLev Concepts • Root Object • Persistency by Reachability • (transitive closure) • Repository (Stone) • Virtual Machines (Gems) lautus MiniRubyConf
  • 8. MagLev Concepts • Root Object • Persistency by Reachability • (transitive closure) • Repository (Stone) • Virtual Machines (Gems) • local vs remote gems lautus MiniRubyConf
  • 9. MagLev Concepts • Root Object • Persistency by Reachability • (transitive closure) • Repository (Stone) • Virtual Machines (Gems) • local vs remote gems • Garbage Collector lautus MiniRubyConf
  • 10. Ruby VM Ruby VM Shared Page Repository Cache Ruby VM Ruby VM
  • 11.
  • 12. TwitterClone class Person def remove_follower(person) @followers.delete(person) attr_accessor :username, :followers end def initialize(username) def to_s @username = username result = "@#{@username} --> @followers = Array.new [#{@followers.size}]" end @followers.each {|f| result = result + " #{f.username}" } def add_follower(person) result @followers << person end end end lautus MiniRubyConf
  • 13. TwitterClone Maglev.persistent do require 'person' end Maglev::PERSISTENT_ROOT[:persons] = Array.new Maglev.commit_transaction lautus MiniRubyConf
  • 14.
  • 15.
  • 16.
  • 19. :persons Array person.rb person.rb
  • 20. :persons Array :persons Array person.rb person.rb person.rb
  • 21. TwitterClone require 'person' dhh = Person.new("dhh") persons = obie = Person.new("obie") Maglev::PERSISTENT_ROOT[:persons] unclebob = Person.new("unclebob") noob1 = Person.new("noob1") persons << dhh noob2 = Person.new("noob2") persons << obie persons << unclebob dhh.add_follower(obie) dhh.add_follower(unclebob) Maglev.commit_transaction obie.add_follower(unclebob) unclebob.add_follower(noob1) unclebob.add_follower(noob2) lautus MiniRubyConf
  • 22.
  • 23.
  • 24.
  • 25. :persons Array :persons Array
  • 26. :persons Array dhh :persons Array
  • 27. :persons Array dhh obie :persons Array
  • 28. :persons Array dhh obie :persons unclebob Array
  • 29. :persons Array dhh obie :persons unclebob Array
  • 30. :persons Array dhh obie :persons unclebob Array
  • 31. :persons Array dhh obie :persons unclebob Array
  • 32. :persons Array dhh obie :persons unclebob Array noob1
  • 33. :persons Array dhh obie :persons unclebob Array noob1 noob2
  • 34. :persons Array dhh obie :persons unclebob Array noob1 dhh obie noob2 unclebob noob1 noob2
  • 35. TwitterClone persons = Maglev::PERSISTENT_ROOT[:persons] persons.each {|p| puts p} lautus MiniRubyConf
  • 36. TwitterClone lautus MiniRubyConf
  • 37. TwitterClone • Multiple VM’s lautus MiniRubyConf
  • 38. TwitterClone • Multiple VM’s • Concurrent access - MVCC lautus MiniRubyConf
  • 39. TwitterClone • Multiple VM’s • Concurrent access - MVCC • First commit wins lautus MiniRubyConf
  • 40. TwitterClone2 def add_follower(person) class Person @followers << person attr_accessor :username, :email, :followers, :following end def initialize(username) def remove_follower(person) @username = username @followers.delete(person) @email = username + "@mail.com" end @followers = Array.new @following = Array.new def to_s end result = "@#{@username} --> [#{@following.size} : #{@followers.size}]" def follows(person) result = result + " following: {" @following << person @following.each {|f| result = result + " #{f.username}"} person.add_follower(self) result = result + " }" end result = result + " followed by: {" @followers.each {|f| result = result + " #{f.username}"} def unfollows(person) result = result + " }" @following.delete(person) result person.remove_follower(self) end end end lautus MiniRubyConf
  • 41. TwitterClone2 Maglev.persistent do require 'person' end Maglev::PERSISTENT_ROOT[:persons] = Array.new Maglev.commit_transaction lautus MiniRubyConf
  • 42. TwitterClone2 require 'person' dhh = Person.new("dhh") obie = Person.new("obie") unclebob = Person.new("unclebob") noob1 = Person.new("noob1") noob2 = Person.new("noob2") obie.follows(dhh) unclebob.follows(dhh) unclebob.follows(obie) noob1.follows(unclebob) noob2.follows(unclebob) persons = Maglev::PERSISTENT_ROOT[:persons] persons << dhh persons << obie persons << unclebob lautus MiniRubyConf
  • 43. TwitterClone2 persons = Maglev::PERSISTENT_ROOT[:persons] persons.each {|p| puts p} lautus MiniRubyConf
  • 44. MagLev lautus MiniRubyConf
  • 45. MagLev • Concurrent access to objects in distributed VM’s lautus MiniRubyConf
  • 46. MagLev • Concurrent access to objects in distributed VM’s • Rabbit in hat trick lautus MiniRubyConf
  • 47. MagLev • Concurrent access to objects in distributed VM’s • Rabbit in hat trick • Proc’s can be persisted lautus MiniRubyConf
  • 48. MagLev • Concurrent access to objects in distributed VM’s • Rabbit in hat trick • Proc’s can be persisted • references enclosing environment’s variables lautus MiniRubyConf
  • 49. Dinner lautus MiniRubyConf
  • 50. Dinner • Enjoy! lautus MiniRubyConf

Notas del editor

  1. \n
  2. gcgem\n
  3. gcgem\n
  4. gcgem\n
  5. gcgem\n
  6. gcgem\n
  7. gcgem\n
  8. gcgem\n
  9. Logical Architecture\n
  10. Demonstration architecture\nRoot object - carrot orange\n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  30. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  31. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  32. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  33. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  34. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  35. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  36. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  37. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  38. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  39. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  40. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  41. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  42. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  43. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  44. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  45. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  46. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  47. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  48. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  49. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  50. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  51. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  52. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  53. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  54. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  55. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  56. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  57. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  58. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  59. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  60. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  61. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  62. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  63. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  64. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  65. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  66. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1]\n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  76. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  77. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  78. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  79. \n