Event Driven Architecture - MeshU - Ilya Grigorik

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

2 comments

Comments 1 - 2 of 2 previous next Post a comment

  • + temojin temojin 6 months ago
    Thanks for sharing Ilya!
  • + apizsa Andreas Pizsa 7 months ago
    Great slides & analogy, thank you for sharing! I’d be interested in the sources regarding Amazon & Google on slide 6, it’s yummie data :) Thank you!
Post a comment
Embed Video
Edit your comment Cancel

35 Favorites & 2 Groups

Event Driven Architecture - MeshU - Ilya Grigorik - Presentation Transcript

  1. Event-Driven Architectures Ilya Grigorik CTO / AideRSS Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  2. Apr 7th launch: Bestest Blog discovery! Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  3. • Request, Response Cycle • Event Driven Architectures • Cloud Computing • Real-time Web! Fully buzzword • XMPP & AMQP compliant! • Example Questions & The slides… My blog Comments Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  4. Elastic, Event-Driven, Real-time, Staged, Services Oriented Architecture (Ready, ready? Go.) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  5. GET /home GET /home GET /home Response Request, Response Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  6. Google: +200ms = -10% searches Amazon: +100ms = -5% purchases GET /home Response Response Time is Everything Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  7. Bottleneck Complexity and Time Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  8. “Rails, Django, Seaside, Grails…” cant scale. Myth: Slow Frameworks Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  9. Application server: 1-1000+ req/s “Fast Enough” Frameworks Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  10. 1. 5 ms: Process request 2. 30 ms: Authenticate user 3. 90 ms: Contact database & other services 4. 30 ms: Render response Total: 155 ms, 0.5 MB / conn OR 6.5 req / s Request, Response assembly Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  11. The Proxy Solution Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  12. The “More” Proxy Solution Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  13. This is madness. (after a certain point) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  14. 1. Receive 2. Verify 3. Dispatch 4. Aggregate 5. Handle errors 6. Render Throughput != Response Time Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  15. Buzzword: Event-Driven Architectures (aka, reinventing the wheel) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  16. Auto Manufacturing circa 1910 2-3 men, 1-2 days / car Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  17. More workers! Scaling the manufacturing process Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  18. Then Henry Ford came along… Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  19. And gave us the assembly line! Scaling the manufacturing process Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  20. Queuing theory Lean manufacturing Just in time Lower response time, higher throughput! 93 seconds / car 1M + cars / year Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  21. Event Driven Architecture (EDA) = Assembly line except, we’re not building cars here… Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  22. 1. 5 ms - Receive 2. 30 ms - Verify Total: 365 ms, ~ 3 req / s 3. 30 ms - Save 4. 200 ms – Generate PDF 5. 50 ms - Email 6. 50 ms - Render GET /purchase OK Monolith Order Processing (example) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  23. Can someone else do it? Total: 115 ms, ~ 3 req / s 1. 5 ms – Receive No ~ 70% improvement in 2. 30 ms - Verify No response time! 3. 30 ms – Save No 4. 200 ms – Generate PDF Yes 5. 50 ms – Email Yes 6. 50 ms – Render Yes GET /purchase OK Assembly Line Order Processing (example) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  24. 1. 5 ms - Receive 2. 30 ms - Verify 3. 30 ms - Save 1. Generate PDF 4. 10 ms – Dispatch 1. Email PDF 2. Dispatch 5. 50 ms – Render Total: 125 ms GET /purchase OK Assembly Line Order Processing (example) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  25. 1. 5 ms - Receive 2. 30 ms - Verify 3. 30 ms - Save 1. Generate PDF 4. 10 ms – Dispatch 1. Email PDF 2. Dispatch 5. 50 ms – Render Total: 125 ms GET /purchase OK Event-Driven Staged Architecture (SEDA) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  26. Don’t keep the client waiting! “Can I defer it?” Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  27. PDF service layer Email service layer GET /purchase OK Services Oriented Architecture (SOA) helps you maintain your sanity Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  28. Scalability of service layer GET /purchase OK SOA = Simple(r) Scalability Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  29. Elastic Computing EC2 & Virtualization Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  30. 3 servers (always): $216 / month $0.10 / hour 3 servers (elastic): $120 / month 0AM – 8AM 8AM – 24PM Elastic Computing (Pay by the sip) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  31. 100 computers * 1 hour = 1 computer * 100 hours Elastic Computing (Pay by the sip) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  32. Era of Parallelism Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  33. Elastic car manufacturing? High capital investment People & Unions Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  34. Elastic Computing = Assembly Line 2.0 EC2 & Virtualization Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  35. Elastic, Event-Driven, Staged, Services Oriented Architecture (that’s a mouthful) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  36. Phew. Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  37. Buzzword: Real-time web Scientific translation: really, really, really, fast Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  38. Ouch! Really fast Millions of response users time Real-time pain Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  39. HTTP? DB? … HTTP? Queue? … Real-time communication Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  40. Emerging Standards: XMPP & AMQP Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  41. From: A, To: B From: A, To: B Hello! Hello! Extensible Messaging and Presence Protocol (XMPP) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  42. Event-stream protocol Persistent connections Presence Identity and XMPP Features authentication Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  43. User Domain Resource ilya@aiderss.com/office Jabber Software Foundation JID: Federation, Identity & Authentication Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  44. <message from=\"ilya@aiderss.com/office\" type=\"chat\" to=\"ilya@igvita.com\" id=\"aae1a\"> <body>hello</body> <active xmlns=\"http://jabber.org/protocol/chatstates\"/> </message> Very verbose protocol (XML) Example: Message Routing with XMPP Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  45. XMPP in the wild: Google Talk Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  46. XMPP in the wild: Google Talk + Video Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  47. Psi: cross-platform Jabber/XMPP client Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  48. require \"rubygems\" require \"xmpp4r\" jid = Jabber::JID::new(\"ilya@aiderss.com\") client = Jabber::Client.new(jid) client.connect(\"talk.google.com\") client.auth(\"password\") to = \"ilya@aiderss.com\" subject = \"Jabber client\" message = \"Hello XMPP World!\" piclient.send Jabber::Message::new(to, message).set_subject(subject) # <message to='ilya@igvita.com'> # <body>Hello XMPP World!</body> # <subject>Jabber client</subject> XMPP4R (Ruby) Demo # </message> Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  49. require \"rubygems\" require \"xmpp4r\" jid = Jabber::JID::new(\"ilya@aiderss.com\") client = Jabber::Client.new(jid) client.connect(\"talk.google.com\") client.auth(\"password\") to = \"ilya@aiderss.com\" subject = \"Jabber client\" message = \"Hello XMPP World!\" piclient.send Jabber::Message::new(to, message).set_subject(subject) # <message to='ilya@igvita.com'> # <body>Hello XMPP World!</body> # <subject>Jabber client</subject> XMPP4R (Ruby) Demo # </message> Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  50. client.send(Jabber::Presence.new.set_type(:away)) # <presence from='daniel@aiderss.com/iMac8D2CB97D' to='ilya@aiderss.com/0EDD826C' xmlns='jabber:client'> # <show>away</show> # <priority>0</priority> # <x xmlns='http://www.apple.com/xmpp/idle'> # <idle-since>2009-04-01T21:48:15Z</idle-since> Client Idle… # </x> # </presence> client.add_message_callback do |m| puts \"#{m.from} -- #{m.body}\" end # > daniel@aiderss.com -- Hey! XMPP4R (Ruby) Demo Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  51. client.send(Jabber::Presence.new.set_type(:available)) # <presence from='daniel@aiderss.com/iMac8D2CB97D' to='ilya@aiderss.com/0EDD826C' xmlns='jabber:client'> # <show>away</show> # <priority>0</priority> # <x xmlns='http://www.apple.com/xmpp/idle'> # <idle-since>2009-04-01T21:48:15Z</idle-since> Client Idle… # </x> # </presence> client.add_message_callback do |m| puts \"#{m.from} -- #{m.body}\" end # > daniel@aiderss.com -- Hey! XMPP4R (Ruby) Demo Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  52. One-to-many distribution Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  53. XEP-0060: Publish-Subscribe (Pubsub) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  54. Many wasteful checks Data? No Data? No Data? Yes HTTP / SMTP Polling: painful, wasteful Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  55. Persistent connection Subscribe New message! Publish-Subscribe Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  56. <iq type='set‘ from='hamlet@denmark.lit/blogbot' to='pubsub.shakespeare.lit' id='pub1'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <publish node='princely_musings'> IQ Stanza <item> <entry xmlns='http://www.w3.org/2005/Atom'> <title>Soliloquy<title> <summary> To be, or not to be: that is the question! <summary> <link rel='alternate' type='text/html' href='http://denmark.lit/2003/12/13/atom03'/> <id>tag:denmark.lit,2003:entry-32397</id> <published>2003-12-13T18:30:02Z</published> <updated>2003-12-13T18:30:02Z</updated> </entry> </item> </publish> PubSub Protocol: Client XML </pubsub> </iq> Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  57. <iq type='set‘ from='hamlet@denmark.lit/blogbot' to='pubsub.shakespeare.lit' id='pub1'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <publish node='princely_musings'> <item> <entry xmlns='http://www.w3.org/2005/Atom'> <title>Soliloquy<title> <summary> To be, or not to be: that is the question! <summary> <link rel='alternate' type='text/html' AtomPub href='http://denmark.lit/2003/12/13/atom03'/> <id>tag:denmark.lit,2003:entry-32397</id> <published>2003-12-13T18:30:02Z</published> <updated>2003-12-13T18:30:02Z</updated> </entry> </item> </publish> PubSub Protocol: Client XML </pubsub> </iq> Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  58. Distribute Publish XEP-0060: Publish-Subscribe (Pubsub) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  59. <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'> <event xmlns='http://jabber.org/protocol/pubsub#event'> <items node='princely_musings'> <item id='ae890ac52d0df67ed7cfdf51b644e901'> [ ... ENTRY ... ] Subscriber A </item> </items> </event> </message> <message from='pubsub.shakespeare.lit' to='bernardo@denmark.lit' id='bar'> <event xmlns='http://jabber.org/protocol/pubsub#event'> <items node='princely_musings'> <item id='ae890ac52d0df67ed7cfdf51b644e901'> Subscriber B [ ... ENTRY ... ] </item> </items> </event> </message> XEP-0060: Publish-Subscribe (Pubsub) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  60. Seems neat, but so what? Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  61. XMPP XMPP Real-time communication Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  62. XMPP XMPP XMPP Real-time communication Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  63. Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  64. require 'fire_hydrant' require 'yaml' hydrant = FireHydrant.new(YAML.load(File.read(\"config.yml\"))) hydrant.on_location_update do |user| puts \"#{user.token} has moved to #{user.locations.first}.\" Push notifications end hydrant.run! Ruby + FireEagle via XMPP Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  65. Presence: available GET /purchase OK Elastic Computing + Presence Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  66. Ejabberd Erlang Defacto XMPP server Djabberd Perl OpenFire Java RPM, GUI, shiny Tigase Java XMPP / Jabber Servers Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  67. Advanced Message Queuing Protocol (AMQP) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  68. “AMQP is an open Internet Protocol for Business Messaging” AMQP Working Group (16 companies) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  69. Consumer AMQP Broker Publisher AMQP Architecture Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  70. Broker Clustering AMQP Clustering Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  71. Routing key: usd.stock.amz Message: I like AMZ! Direct Topic Fanout Exchange Exchange Exchange AMQP Broker Internals Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  72. Routing key: usd.stock.amz Message: I like AMZ! Direct Topic Fanout Exchange Exchange Exchange Name: amazon Queue Bind: usd.stock.amz AMQP Direct Exchange Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  73. Routing key: usd.stock.amz Message: I like AMZ! Direct Topic Fanout Exchange Exchange Exchange Queue Queue Message: I like AMZ! AMQP Direct Exchange Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  74. Routing key: usd.stock.msft Message: I like Microsoft! Direct Topic Fanout Exchange Exchange Exchange Name: stocks Queue Bind: usd.stock.* AMQP Topic Exchange Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  75. Routing key: usd.stock.msft Message: I like Microsoft! Direct Topic Fanout Exchange Exchange Exchange Queue Message: I like Microsoft! AMQP Topic Exchange Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  76. Routing key: usd.stock.msft Message: I like Microsoft! Direct Topic Fanout Exchange Exchange Exchange Queue Queue Name: stocks 1 2 Bind: “” AMQP Fanout Exchange Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  77. Routing key: usd.stock.msft Message: I like Microsoft! Direct Topic Fanout Exchange Exchange Exchange Queue Queue Message: I like Microsoft 1 2 AMQP Fanout Exchange Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  78. AMQP Kung-fu: Load-balancing Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  79. Routing key: usd.stock.amz Message: I like AMZ! Direct Topic Fanout Exchange Exchange Exchange Queue Only one client gets the message! AMQP Load Balancing Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  80. Bind: purchase.pdf GET /purchase OK Elastic AMQP Load-balancing Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  81. AMQP Kung-fu: Persistence & Durability Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  82. Routing key: usd.stock.amz Message: I like AMZ! Direct Topic Fanout Exchange Exchange Exchange Durable: True Queue Persistent: True AMQP Persistence & Durability Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  83. Almost there :) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  84. require 'mq' AMQP.start(:host => 'amqp-server.com') do Publisher mq = MQ.new mq.topic('stocks').publish(\"5.95\", :key => \"usd.amz\") end AMQP.start(:host => 'amqp-server.com') do mq = MQ.new mq.queue('amazon stock').bind(mq.topic('stocks'), :key => 'usd.amz').subscribe{ |price| print 'apple stock', price } end AMQP + Ruby Example Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  85. require 'mq' AMQP.start(:host => 'amqp-server.com') do mq = MQ.new mq.topic('stocks').publish(\"5.95\", :key => \"usd.amz\") end Consumer AMQP.start(:host => 'amqp-server.com') do mq = MQ.new mq.queue('amazon stock').bind(mq.topic('stocks'), :key => 'usd.amz').subscribe{ |price| print ‘amazon stock', price } end AMQP + Ruby Example Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  86. Elastic, Event-Driven, <Real-time>, Staged, Services Oriented Architecture (oi…) Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  87. XMPP / AMQP Publisher Elastic Architecture Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  88. XMPP / AMQP Subscribe Exposing Publish-Subscribe API Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda
  89. Thanks. Questions & The slides… My blog Comments Event-Driven Architectures http://bit.ly/eda-mesh @igrigorik #meshu #eda

+ Ilya GrigorikIlya Grigorik, 7 months ago

custom

4215 views, 35 favs, 16 embeds more stats

A look at the technologies and the architecture beh more

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 4215
    • 2329 on SlideShare
    • 1886 from embeds
  • Comments 2
  • Favorites 35
  • Downloads 0
Most viewed embeds
  • 1815 views on http://www.igvita.com
  • 33 views on http://00f.net
  • 19 views on http://leonardoeloy.com
  • 4 views on http://www.techvibes.com
  • 2 views on http://www.iweb34.com

more

All embeds
  • 1815 views on http://www.igvita.com
  • 33 views on http://00f.net
  • 19 views on http://leonardoeloy.com
  • 4 views on http://www.techvibes.com
  • 2 views on http://www.iweb34.com
  • 2 views on http://www.redcanary.ca
  • 2 views on http://static.slidesharecdn.com
  • 1 views on http://74.125.155.132
  • 1 views on http://209.85.229.132
  • 1 views on http://www.00f.net
  • 1 views on http://feeds.feedburner.com
  • 1 views on http://127.0.0.1:8795
  • 1 views on http://conversation.ecairn.com
  • 1 views on http://www.hanrss.com
  • 1 views on http://feeds.igvita.com
  • 1 views on http://74.125.113.132

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories

Groups / Events