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 quot;^nanite.*quot; quot;.*quot; quot;.*quot;
   rabbitmqctl set_permissions -p /nanite mapper quot;.*quot; quot;.*quot; quot;.*quot;
             (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

Make Your Own Perl with Moops
Make Your Own Perl with MoopsMake Your Own Perl with Moops
Make Your Own Perl with MoopsMike Friedman
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATSKiwamu Okabe
 
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 Criticjoshua.mcadams
 
JRuby: What's Different (RORO Melbourne October 2011)
JRuby: What's Different (RORO Melbourne October 2011)JRuby: What's Different (RORO Melbourne October 2011)
JRuby: What's Different (RORO Melbourne October 2011)Charles Nutter
 
XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64The Linux Foundation
 
Embedded System Microcontroller Interactive Course using BASCOM-AVR - Lecture11
Embedded System Microcontroller Interactive Course using BASCOM-AVR - Lecture11Embedded System Microcontroller Interactive Course using BASCOM-AVR - Lecture11
Embedded System Microcontroller Interactive Course using BASCOM-AVR - Lecture11AL-AWAIL for Electronic Engineering
 

What's hot (10)

Make Your Own Perl with Moops
Make Your Own Perl with MoopsMake Your Own Perl with Moops
Make Your Own Perl with Moops
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATS
 
2011: Year of the fish
2011: Year of the fish2011: Year of the fish
2011: Year of the fish
 
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
 
Extending Perl Critic
Extending Perl CriticExtending Perl Critic
Extending Perl Critic
 
JRuby: What's Different (RORO Melbourne October 2011)
JRuby: What's Different (RORO Melbourne October 2011)JRuby: What's Different (RORO Melbourne October 2011)
JRuby: What's Different (RORO Melbourne October 2011)
 
XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64
 
Perl
PerlPerl
Perl
 
Embedded System Microcontroller Interactive Course using BASCOM-AVR - Lecture11
Embedded System Microcontroller Interactive Course using BASCOM-AVR - Lecture11Embedded System Microcontroller Interactive Course using BASCOM-AVR - Lecture11
Embedded System Microcontroller Interactive Course using BASCOM-AVR - Lecture11
 
Perl Moderno
Perl ModernoPerl Moderno
Perl Moderno
 

Viewers also liked (17)

Mayor Gordon Visits
Mayor Gordon VisitsMayor Gordon Visits
Mayor Gordon Visits
 
Where do I put this data? #lessql
Where do I put this data? #lessqlWhere do I put this data? #lessql
Where do I put this data? #lessql
 
Save the Northern Bog Turtle
Save the Northern Bog TurtleSave the Northern Bog Turtle
Save the Northern Bog Turtle
 
Presentacion jupabus
Presentacion jupabusPresentacion jupabus
Presentacion jupabus
 
imagenes del libro
imagenes del libroimagenes del libro
imagenes del libro
 
Merb Core
Merb CoreMerb Core
Merb Core
 
PA4Sight
PA4SightPA4Sight
PA4Sight
 
jupabus
 jupabus jupabus
jupabus
 
Rare Presentation To Iit B 11 Aug
Rare Presentation To Iit B   11 Aug Rare Presentation To Iit B   11 Aug
Rare Presentation To Iit B 11 Aug
 
Vertebra
VertebraVertebra
Vertebra
 
Redis: REmote DIctionary Server
Redis: REmote DIctionary ServerRedis: REmote DIctionary Server
Redis: REmote DIctionary Server
 
Merb + Nanite
Merb + NaniteMerb + Nanite
Merb + Nanite
 
Vertebra
VertebraVertebra
Vertebra
 
Career Day '07
Career Day '07Career Day '07
Career Day '07
 
United Streaming
United StreamingUnited Streaming
United Streaming
 
Custom Mongrel Handlers: Learning how to walk the dog
Custom Mongrel Handlers: Learning how to walk the dogCustom Mongrel Handlers: Learning how to walk the dog
Custom Mongrel Handlers: Learning how to walk the dog
 
Ruby Deployment
Ruby DeploymentRuby Deployment
Ruby Deployment
 

Similar to Join Erlang Cloud with Nanite

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 09Bhasker Kode
 
Graal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution PlatformGraal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution PlatformThomas Wuerthinger
 
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_uringScyllaDB
 
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 PulsarTimothy Spann
 
Katello on TorqueBox
Katello on TorqueBoxKatello on TorqueBox
Katello on TorqueBoxlzap
 
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 linersKirk Kimmel
 
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 WorldFrank Hunleth
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?Ronny
 
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...Claus Ibsen
 
07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W mattersAlexandre Moneger
 
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 testingVlatko Kosturjak
 
Infrastructure In The Cloud Era
Infrastructure In The Cloud EraInfrastructure In The Cloud Era
Infrastructure In The Cloud Eraelliando dias
 
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 ...Perforce
 
Unit 1-introduction to perl
Unit 1-introduction to perlUnit 1-introduction to perl
Unit 1-introduction to perlsana mateen
 
TEW4 Yatce deprecated slides
TEW4 Yatce deprecated slidesTEW4 Yatce deprecated slides
TEW4 Yatce deprecated slidesUENISHI Kota
 
FunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - StreamsFunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - Streamsdarach
 
Explore how to build dapp
Explore how to build dappExplore how to build dapp
Explore how to build dappCHUN-WEI CHIANG
 

Similar to Join Erlang Cloud with Nanite (20)

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
 
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
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
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
 
Katello on TorqueBox
Katello on TorqueBoxKatello on TorqueBox
Katello on TorqueBox
 
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
 
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
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?
 
linux-namespaces.pdf
linux-namespaces.pdflinux-namespaces.pdf
linux-namespaces.pdf
 
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...
 
Rest
RestRest
Rest
 
07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters
 
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
 
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 ...
 
Unit 1-introduction to perl
Unit 1-introduction to perlUnit 1-introduction to perl
Unit 1-introduction to perl
 
TEW4 Yatce deprecated slides
TEW4 Yatce deprecated slidesTEW4 Yatce deprecated slides
TEW4 Yatce deprecated slides
 
FunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - StreamsFunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - Streams
 
Explore how to build dapp
Explore how to build dappExplore how to build dapp
Explore how to build dapp
 

Recently uploaded

Emerging issues in migration policies.ppt
Emerging issues in migration policies.pptEmerging issues in migration policies.ppt
Emerging issues in migration policies.pptNandinituteja1
 
11042024_First India Newspaper Jaipur.pdf
11042024_First India Newspaper Jaipur.pdf11042024_First India Newspaper Jaipur.pdf
11042024_First India Newspaper Jaipur.pdfFIRST INDIA
 
Political-Ideologies-and-The-Movements.pptx
Political-Ideologies-and-The-Movements.pptxPolitical-Ideologies-and-The-Movements.pptx
Political-Ideologies-and-The-Movements.pptxSasikiranMarri
 
Power in International Relations (Pol 5)
Power in International Relations (Pol 5)Power in International Relations (Pol 5)
Power in International Relations (Pol 5)ssuser583c35
 
15042024_First India Newspaper Jaipur.pdf
15042024_First India Newspaper Jaipur.pdf15042024_First India Newspaper Jaipur.pdf
15042024_First India Newspaper Jaipur.pdfFIRST INDIA
 
12042024_First India Newspaper Jaipur.pdf
12042024_First India Newspaper Jaipur.pdf12042024_First India Newspaper Jaipur.pdf
12042024_First India Newspaper Jaipur.pdfFIRST INDIA
 
Mitochondrial Fusion Vital for Adult Brain Function and Disease Understanding...
Mitochondrial Fusion Vital for Adult Brain Function and Disease Understanding...Mitochondrial Fusion Vital for Adult Brain Function and Disease Understanding...
Mitochondrial Fusion Vital for Adult Brain Function and Disease Understanding...The Lifesciences Magazine
 
13042024_First India Newspaper Jaipur.pdf
13042024_First India Newspaper Jaipur.pdf13042024_First India Newspaper Jaipur.pdf
13042024_First India Newspaper Jaipur.pdfFIRST INDIA
 
lok sabha Elections in india- 2024 .pptx
lok sabha Elections in india- 2024 .pptxlok sabha Elections in india- 2024 .pptx
lok sabha Elections in india- 2024 .pptxdigiyvbmrkt
 
Geostrategic significance of South Asian countries.ppt
Geostrategic significance of South Asian countries.pptGeostrategic significance of South Asian countries.ppt
Geostrategic significance of South Asian countries.pptUsmanKaran
 

Recently uploaded (10)

Emerging issues in migration policies.ppt
Emerging issues in migration policies.pptEmerging issues in migration policies.ppt
Emerging issues in migration policies.ppt
 
11042024_First India Newspaper Jaipur.pdf
11042024_First India Newspaper Jaipur.pdf11042024_First India Newspaper Jaipur.pdf
11042024_First India Newspaper Jaipur.pdf
 
Political-Ideologies-and-The-Movements.pptx
Political-Ideologies-and-The-Movements.pptxPolitical-Ideologies-and-The-Movements.pptx
Political-Ideologies-and-The-Movements.pptx
 
Power in International Relations (Pol 5)
Power in International Relations (Pol 5)Power in International Relations (Pol 5)
Power in International Relations (Pol 5)
 
15042024_First India Newspaper Jaipur.pdf
15042024_First India Newspaper Jaipur.pdf15042024_First India Newspaper Jaipur.pdf
15042024_First India Newspaper Jaipur.pdf
 
12042024_First India Newspaper Jaipur.pdf
12042024_First India Newspaper Jaipur.pdf12042024_First India Newspaper Jaipur.pdf
12042024_First India Newspaper Jaipur.pdf
 
Mitochondrial Fusion Vital for Adult Brain Function and Disease Understanding...
Mitochondrial Fusion Vital for Adult Brain Function and Disease Understanding...Mitochondrial Fusion Vital for Adult Brain Function and Disease Understanding...
Mitochondrial Fusion Vital for Adult Brain Function and Disease Understanding...
 
13042024_First India Newspaper Jaipur.pdf
13042024_First India Newspaper Jaipur.pdf13042024_First India Newspaper Jaipur.pdf
13042024_First India Newspaper Jaipur.pdf
 
lok sabha Elections in india- 2024 .pptx
lok sabha Elections in india- 2024 .pptxlok sabha Elections in india- 2024 .pptx
lok sabha Elections in india- 2024 .pptx
 
Geostrategic significance of South Asian countries.ppt
Geostrategic significance of South Asian countries.pptGeostrategic significance of South Asian countries.ppt
Geostrategic significance of South Asian countries.ppt
 

Join Erlang Cloud with Nanite

  • 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 quot;^nanite.*quot; quot;.*quot; quot;.*quot; rabbitmqctl set_permissions -p /nanite mapper quot;.*quot; quot;.*quot; quot;.*quot; (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/