SlideShare a Scribd company logo
1 of 34
Download to read offline
Join the nanite cloud if you have OSX:
curl -O http://brainspl.at/ef.sh && sh ef.sh




You got ur Erlang in
     my Ruby
           Ezra Zygmuntowicz
Two Great tastes that go
    great together
curl -O http://brainspl.at/ef.sh && sh ef.sh

               Erlang
curl -O http://brainspl.at/ef.sh && sh ef.sh

                 Erlang
    PROS:
Fault Tolerant
  Distributed
 Actor Model
  Immutable
   Scalable
 Concurrency
   Let it Fail
Awesome VM
curl -O http://brainspl.at/ef.sh && sh ef.sh

                 Erlang
    PROS:
                                     CONS:
Fault Tolerant
                               Unfamiliar Syntax
  Distributed
                                   Primitive
 Actor Model
                                String handling
  Immutable
                                 Slow(ish) IO
   Scalable
                                Much harder to
 Concurrency
                                find developers
   Let it Fail
Awesome VM
curl -O http://brainspl.at/ef.sh && sh ef.sh

                 Ruby
curl -O http://brainspl.at/ef.sh && sh ef.sh

                    Ruby
    PROS:
     Rapid
 Development
Familiar Concise
    Syntax
Excellent String
   Handling
     Very
 Approachable
  Easy to find
  developers
curl -O http://brainspl.at/ef.sh && sh ef.sh

                    Ruby
    PROS:                             CONS:
     Rapid                        1024 open FD
 Development                           limit
Familiar Concise                  No Multi-Core
    Syntax                         Horrible GC
Excellent String                    No Native
   Handling                          Threads
     Very                        Primadonnas in
 Approachable                     community :P
  Easy to find                        Creaky
  developers                       Interpreter
What if we can combine
   the best of both?




curl -O http://brainspl.at/ef.sh && sh ef.sh
Use Erlang for its strengths
                 Messaging
                Networking
                 Scalability
                Distribution

  Use Ruby for its strengths
           Rapid Development
           DSL/concise Syntax
          Ease of use/installation


curl -O http://brainspl.at/ef.sh && sh ef.sh
Erlang VM
Nanite
 Looks a lot like an exploded Erlang VM




curl -O http://brainspl.at/ef.sh && sh ef.sh
curl -O http://brainspl.at/ef.sh && sh ef.sh

             RabbitMQ
   6kloc of beautiful erlang
 models queues as processes
replicates routing info across
        clustered VMs
Single queue live on single vm
    AMQP Protocol(win!)


curl -O http://brainspl.at/ef.sh && sh ef.sh
curl -O http://brainspl.at/ef.sh && sh ef.sh


   AMQP Basics

   The Trinity...
curl -O http://brainspl.at/ef.sh && sh ef.sh

     AMQP Basics
          Queues:



curl -O http://brainspl.at/ef.sh && sh ef.sh
curl -O http://brainspl.at/ef.sh && sh ef.sh

       AMQP Basics
            Queues:
     Queues are FIFO buffers of messages
 Messages consumed from the front of the queue
New messages are placed in the back of the queue
     Queues can be transient or persistent
curl -O http://brainspl.at/ef.sh && sh ef.sh

   AMQP Basics
  Exchanges:
curl -O http://brainspl.at/ef.sh && sh ef.sh

      AMQP Basics
     Exchanges:
Exchanges are where producers send messages
          Multiple exchange types:
            Direct, Fanout, Topic
  Exchanges are routers with routing tables
curl -O http://brainspl.at/ef.sh && sh ef.sh

   AMQP Basics
     Bindings:
curl -O http://brainspl.at/ef.sh && sh ef.sh

         AMQP Basics
           Bindings:
Bindings are the ‘glue’ between exchanges and queues
 Bindings take exchange routing rules, apply filters
    and push messages onto destination queues
curl -O http://brainspl.at/ef.sh && sh ef.sh

   AMQP Basics
Putting it all together




                             Source: Red Hat Messaging Tutorial: 1.3 Topic Exchange
curl -O http://brainspl.at/ef.sh && sh ef.sh

 Nanite AMQP overview




curl -O http://brainspl.at/ef.sh && sh ef.sh
curl -O http://brainspl.at/ef.sh && sh ef.sh

 Nanite Agents/Actors
Nanite Registration/
           Advertising
                                This actor will
                                   advertise
                                these services:
                                 /simple/echo
                                 /simple/time

                                And these tags:
                                 customer-42
                                   urmom
                                    urdad
You can route requests based on services and tags
curl -O http://brainspl.at/ef.sh && sh ef.sh

               Nanite State
 Agent state can be stored replicated in memory in
                   the mappers.

Or for more scalable systems, state can be stored in a
                      Redis DHT

We build an inverted index so agent lookup based on
 tags and services is just one set intersection away
Nanite State
nanite-foobar: 0.72 # load average or 'status'

s-nanite-foobar: { /foo/bar, /foo/nik } # a SET of the
provided services

tg-nanite-foobar: { foo-42, some-tag } # a SET of the tags for
this agent

t-nanite-foobar: 123456789 # unix timestamp of the last
state update

# inverted indexes
/foo/bar: { nanite-foobar, nanite-nickelbag, nanite-
another } # redis SET
some-tag: { nanite-foobar, nanite-nickelbag, nanite-
another }
Security
rabbitmqctl set_permissions -p /nanite nanite "^nanite.*" ".*" ".*"
   rabbitmqctl set_permissions -p /nanite mapper ".*" ".*" ".*"
             (only available in rabbitmq hg HEAD)


                   Secure Serializer
   Packets are encrypted and signed with public/
              private keypairs(X.509)
Certs are tied to a Nanite’s identity and the mappers
 have a Cert Store where they can dynamically look
       up the proper keys to handle a packet

   (Thanks for Raphael from RightScale for the Security code)
Let’s see that demo

curl -O http://brainspl.at/ef.sh && sh ef.sh
What did I make nanite for?
Future Directions

• Use Rabbitmq patch(bug19230) to
  add ‘presence’ to the broker and get
  rid of ‘pings’
• Erlang agents/mappers
• Mappers have features that ‘should’
  be in the broker, integrate what
  makes sense directly
Future Directions


• Explore using Erlix for directly
  integrating ruby as an erlang node in
  the rabbit broker:

• http://github.com/KDr2/erlix
Future Directions


• Explore creating an AQMP -> Couchdb
  query interface using the erlang
  AMQP client and the new native
  erlang couchdb client
Get Involved

• http://github.com/ezmobius/nanite
• http://groups.google.com/group/
  nanite

• #nanite on irc.freenode.net
• http://www.rabbitmq.com/
• http://code.google.com/p/redis/
Questions?

More Related Content

What's hot

What's hot (10)

2011: Year of the fish
2011: Year of the fish2011: Year of the fish
2011: Year of the fish
 
Perl
PerlPerl
Perl
 
Redis at WRUG
Redis at WRUGRedis at WRUG
Redis at WRUG
 
Multibyte string handling in PHP
Multibyte string handling in PHPMultibyte string handling in PHP
Multibyte string handling in PHP
 
Handling multibyte CSV files in PHP
Handling multibyte CSV files in PHPHandling multibyte CSV files in PHP
Handling multibyte CSV files in PHP
 
Extending Perl Critic
Extending Perl CriticExtending Perl Critic
Extending Perl Critic
 
YAPC::NA 2007 - An Introduction To Perl Critic
YAPC::NA 2007 - An Introduction To Perl CriticYAPC::NA 2007 - An Introduction To Perl Critic
YAPC::NA 2007 - An Introduction To Perl Critic
 
Introduction to writing readable and maintainable Perl
Introduction to writing readable and maintainable PerlIntroduction to writing readable and maintainable Perl
Introduction to writing readable and maintainable Perl
 
Perl Moderno
Perl ModernoPerl Moderno
Perl Moderno
 
Building Custom PHP Extensions
Building Custom PHP ExtensionsBuilding Custom PHP Extensions
Building Custom PHP Extensions
 

Viewers also liked

Viewers also liked (9)

Scotty Cameron
Scotty CameronScotty Cameron
Scotty Cameron
 
Scotty Morrison Salesforce.com New HIre TED Talk: Behind the Brand
Scotty Morrison Salesforce.com New HIre TED Talk: Behind the BrandScotty Morrison Salesforce.com New HIre TED Talk: Behind the Brand
Scotty Morrison Salesforce.com New HIre TED Talk: Behind the Brand
 
Scotty, I need more speed - Koha tuning
Scotty, I need more speed - Koha tuningScotty, I need more speed - Koha tuning
Scotty, I need more speed - Koha tuning
 
Beam me up, Scotty
Beam me up, ScottyBeam me up, Scotty
Beam me up, Scotty
 
Scotty the Otter and his Adventure to You
Scotty the Otter and his Adventure to YouScotty the Otter and his Adventure to You
Scotty the Otter and his Adventure to You
 
Neo4j
Neo4jNeo4j
Neo4j
 
Building a website in Haskell coming from Node.js
Building a website in Haskell coming from Node.jsBuilding a website in Haskell coming from Node.js
Building a website in Haskell coming from Node.js
 
Haskell for data science
Haskell for data scienceHaskell for data science
Haskell for data science
 
Functional programming with haskell
Functional programming with haskellFunctional programming with haskell
Functional programming with haskell
 

Similar to You got ur Erlang in my Ruby

High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
ScyllaDB
 
Infrastructure In The Cloud Era
Infrastructure In The Cloud EraInfrastructure In The Cloud Era
Infrastructure In The Cloud Era
elliando dias
 
Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - Routers
Logicaltrust pl
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routers
Yury Chemerkin
 

Similar to You got ur Erlang in my Ruby (20)

High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
 
OSS EU: Deep Dive into Building Streaming Applications with Apache Pulsar
OSS EU:  Deep Dive into Building Streaming Applications with Apache PulsarOSS EU:  Deep Dive into Building Streaming Applications with Apache Pulsar
OSS EU: Deep Dive into Building Streaming Applications with Apache Pulsar
 
erlang at hover.in , Devcamp Blr 09
erlang at hover.in , Devcamp Blr 09erlang at hover.in , Devcamp Blr 09
erlang at hover.in , Devcamp Blr 09
 
Graal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution PlatformGraal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution Platform
 
Perl Myths 200802 with notes (OUTDATED, see 200909)
Perl Myths 200802 with notes (OUTDATED, see 200909)Perl Myths 200802 with notes (OUTDATED, see 200909)
Perl Myths 200802 with notes (OUTDATED, see 200909)
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?
 
Using Erlang in an Embedded and Cross-Compiled World
Using Erlang in an Embedded and Cross-Compiled WorldUsing Erlang in an Embedded and Cross-Compiled World
Using Erlang in an Embedded and Cross-Compiled World
 
Explore how to build dapp
Explore how to build dappExplore how to build dapp
Explore how to build dapp
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
Infrastructure In The Cloud Era
Infrastructure In The Cloud EraInfrastructure In The Cloud Era
Infrastructure In The Cloud Era
 
White Paper: Perforce Administration Optimization, Scalability, Availability ...
White Paper: Perforce Administration Optimization, Scalability, Availability ...White Paper: Perforce Administration Optimization, Scalability, Availability ...
White Paper: Perforce Administration Optimization, Scalability, Availability ...
 
Katello on TorqueBox
Katello on TorqueBoxKatello on TorqueBox
Katello on TorqueBox
 
Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - Routers
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routers
 
Erlang - Concurrent Language for Concurrent World
Erlang - Concurrent Language for Concurrent WorldErlang - Concurrent Language for Concurrent World
Erlang - Concurrent Language for Concurrent World
 
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
 
Back to the CORE
Back to the COREBack to the CORE
Back to the CORE
 
Perl Usage In Security and Penetration testing
Perl Usage In Security and Penetration testingPerl Usage In Security and Penetration testing
Perl Usage In Security and Penetration testing
 
Perl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersPerl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one liners
 
Perl Myths 200909
Perl Myths 200909Perl Myths 200909
Perl Myths 200909
 

More from elliando dias

Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
elliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
elliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
elliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
elliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
elliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
elliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
elliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
elliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
elliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
elliando dias
 

More from elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

You got ur Erlang in my Ruby

  • 1. Join the nanite cloud if you have OSX: curl -O http://brainspl.at/ef.sh && sh ef.sh You got ur Erlang in my Ruby Ezra Zygmuntowicz
  • 2. Two Great tastes that go great together
  • 3. curl -O http://brainspl.at/ef.sh && sh ef.sh Erlang
  • 4. curl -O http://brainspl.at/ef.sh && sh ef.sh Erlang PROS: Fault Tolerant Distributed Actor Model Immutable Scalable Concurrency Let it Fail Awesome VM
  • 5. curl -O http://brainspl.at/ef.sh && sh ef.sh Erlang PROS: CONS: Fault Tolerant Unfamiliar Syntax Distributed Primitive Actor Model String handling Immutable Slow(ish) IO Scalable Much harder to Concurrency find developers Let it Fail Awesome VM
  • 7. curl -O http://brainspl.at/ef.sh && sh ef.sh Ruby PROS: Rapid Development Familiar Concise Syntax Excellent String Handling Very Approachable Easy to find developers
  • 8. curl -O http://brainspl.at/ef.sh && sh ef.sh Ruby PROS: CONS: Rapid 1024 open FD Development limit Familiar Concise No Multi-Core Syntax Horrible GC Excellent String No Native Handling Threads Very Primadonnas in Approachable community :P Easy to find Creaky developers Interpreter
  • 9. What if we can combine the best of both? curl -O http://brainspl.at/ef.sh && sh ef.sh
  • 10. Use Erlang for its strengths Messaging Networking Scalability Distribution Use Ruby for its strengths Rapid Development DSL/concise Syntax Ease of use/installation curl -O http://brainspl.at/ef.sh && sh ef.sh
  • 12. Nanite Looks a lot like an exploded Erlang VM curl -O http://brainspl.at/ef.sh && sh ef.sh
  • 13. curl -O http://brainspl.at/ef.sh && sh ef.sh RabbitMQ 6kloc of beautiful erlang models queues as processes replicates routing info across clustered VMs Single queue live on single vm AMQP Protocol(win!) curl -O http://brainspl.at/ef.sh && sh ef.sh
  • 14. curl -O http://brainspl.at/ef.sh && sh ef.sh AMQP Basics The Trinity...
  • 15. curl -O http://brainspl.at/ef.sh && sh ef.sh AMQP Basics Queues: curl -O http://brainspl.at/ef.sh && sh ef.sh
  • 16. curl -O http://brainspl.at/ef.sh && sh ef.sh AMQP Basics Queues: Queues are FIFO buffers of messages Messages consumed from the front of the queue New messages are placed in the back of the queue Queues can be transient or persistent
  • 17. curl -O http://brainspl.at/ef.sh && sh ef.sh AMQP Basics Exchanges:
  • 18. curl -O http://brainspl.at/ef.sh && sh ef.sh AMQP Basics Exchanges: Exchanges are where producers send messages Multiple exchange types: Direct, Fanout, Topic Exchanges are routers with routing tables
  • 19. curl -O http://brainspl.at/ef.sh && sh ef.sh AMQP Basics Bindings:
  • 20. curl -O http://brainspl.at/ef.sh && sh ef.sh AMQP Basics Bindings: Bindings are the ‘glue’ between exchanges and queues Bindings take exchange routing rules, apply filters and push messages onto destination queues
  • 21. curl -O http://brainspl.at/ef.sh && sh ef.sh AMQP Basics Putting it all together Source: Red Hat Messaging Tutorial: 1.3 Topic Exchange
  • 22. curl -O http://brainspl.at/ef.sh && sh ef.sh Nanite AMQP overview curl -O http://brainspl.at/ef.sh && sh ef.sh
  • 23. curl -O http://brainspl.at/ef.sh && sh ef.sh Nanite Agents/Actors
  • 24. Nanite Registration/ Advertising This actor will advertise these services: /simple/echo /simple/time And these tags: customer-42 urmom urdad You can route requests based on services and tags
  • 25. curl -O http://brainspl.at/ef.sh && sh ef.sh Nanite State Agent state can be stored replicated in memory in the mappers. Or for more scalable systems, state can be stored in a Redis DHT We build an inverted index so agent lookup based on tags and services is just one set intersection away
  • 26. Nanite State nanite-foobar: 0.72 # load average or 'status' s-nanite-foobar: { /foo/bar, /foo/nik } # a SET of the provided services tg-nanite-foobar: { foo-42, some-tag } # a SET of the tags for this agent t-nanite-foobar: 123456789 # unix timestamp of the last state update # inverted indexes /foo/bar: { nanite-foobar, nanite-nickelbag, nanite- another } # redis SET some-tag: { nanite-foobar, nanite-nickelbag, nanite- another }
  • 27. Security rabbitmqctl set_permissions -p /nanite nanite "^nanite.*" ".*" ".*" rabbitmqctl set_permissions -p /nanite mapper ".*" ".*" ".*" (only available in rabbitmq hg HEAD) Secure Serializer Packets are encrypted and signed with public/ private keypairs(X.509) Certs are tied to a Nanite’s identity and the mappers have a Cert Store where they can dynamically look up the proper keys to handle a packet (Thanks for Raphael from RightScale for the Security code)
  • 28. Let’s see that demo curl -O http://brainspl.at/ef.sh && sh ef.sh
  • 29. What did I make nanite for?
  • 30. Future Directions • Use Rabbitmq patch(bug19230) to add ‘presence’ to the broker and get rid of ‘pings’ • Erlang agents/mappers • Mappers have features that ‘should’ be in the broker, integrate what makes sense directly
  • 31. Future Directions • Explore using Erlix for directly integrating ruby as an erlang node in the rabbit broker: • http://github.com/KDr2/erlix
  • 32. Future Directions • Explore creating an AQMP -> Couchdb query interface using the erlang AMQP client and the new native erlang couchdb client
  • 33. Get Involved • http://github.com/ezmobius/nanite • http://groups.google.com/group/ nanite • #nanite on irc.freenode.net • http://www.rabbitmq.com/ • http://code.google.com/p/redis/