Erlangfactory
Upcoming SlideShare
Loading in...5
×
 

Erlangfactory

on

  • 24,884 views

My talk on ruby, erlang, nanite, amqp and redis at the Erlang Factory conference

My talk on ruby, erlang, nanite, amqp and redis at the Erlang Factory conference

Statistics

Views

Total Views
24,884
Views on SlideShare
11,873
Embed Views
13,011

Actions

Likes
37
Downloads
252
Comments
3

32 Embeds 13,011

http://brainspl.at 12513
http://www.brainspl.at 327
http://www.slideshare.net 30
http://webcache.googleusercontent.com 27
http://syntaxritual.tumblr.com 26
http://theoldreader.com 23
http://www.merboverheard.com 12
http://merboverheard.com 9
http://web.archive.org 5
http://www.newsblur.com 4
http://127.0.0.1 3
http://translate.googleusercontent.com 3
http://sexydev.soup.io 3
http://localhost 3
http://static.slidesharecdn.com 2
http://merboverheard.bradlyfeeley.com 2
http://bgror.com 2
http://planetrubyonrails.net 2
http://www.hanrss.com 2
http://norswell.appspot.com 1
http://fanyi.youdao.com 1
http://brainspl.at. 1
http://localhost:3000 1
http://cache.baidu.com 1
http://www.techgig.com 1
http://74.125.95.132 1
http://74.125.155.132 1
http://209.85.129.132 1
http://209.85.173.132 1
http://planet.caboo.se 1
http://www.iweb34.com 1
http://ff.mkmood.com 1
More...

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…

  • amen
    Are you sure you want to
    Your message goes here
    Processing…
  • Must see this one today!

    http://www.slideshare.net/jeanabailey/could-h...
    Are you sure you want to
    Your message goes here
    Processing…
  • Must see this before Mothers Day.


    http://www.slideshare.net/jeanabailey/could-h... y.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Erlangfactory Erlangfactory Presentation Transcript

  • 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?