SlideShare a Scribd company logo
1 of 45
Download to read offline
Achieving Scale with
                    Messaging & the Cloud
                        Tony Garnock-Jones <tonyg@lshift.net>




Thursday, 9 July 2009                                           1
Outline

                        • Messaging – what, why

                        • Cloud Messaging – some examples

                        • Achieving Scale – what, why, how

Thursday, 9 July 2009                                        2
Messaging



Thursday, 9 July 2009               3
Messaging Elements
       ...relaying, filtering, multicasting, forwarding, buffering,
     distribution/scheduling, subscription, topics, streaming, ...

                                                                                 Element
                         Element
       ...
                                             Element



                                                                 Element


                                   Element
                                                       Element
                                                                           ...
Thursday, 9 July 2009                                                                      4
What is it good for?
         Decoupling communication from behaviour, enabling:


                        •   debuggability      •   cross-language
                                                   integration
                        •   manageability
                                               •   fault-tolerance
                        •   monitorability
                                               •   store-and-forward
                        •   rolling upgrades
                                               •   ...
                        •   load-balancing

Thursday, 9 July 2009                                                  5
Messaging Elements
       ...relaying, filtering, multicasting, forwarding, buffering,
     distribution/scheduling, subscription, topics, streaming, ...


                                                        messages
           message
                                    Element



                            subscribe     unsubscribe

Thursday, 9 July 2009                                                6
Messaging Elements
        • Delivery:
              • deliver(target,   message);



        • Subscription:
              • bind(source, topic, target);
              • unbind(source, topic, target);

Thursday, 9 July 2009                            7
AMQP for Messaging
                                                                        C
                            P           X
                                                                        C
                            P           X
                                                                        C
                        •   Exchanges perform        •   Queues perform
                            relaying, copying, and       buffering and round-
                            filtering                     robin delivery

Thursday, 9 July 2009                                                           8
It’s Easy
                byte[] body = ...;
                ch.basicPublish(exchange, routingKey, null, body);



                ch.queueBind(queueName, exchange, routingKeyPattern);



                QueueingConsumer consumer = new QueueingConsumer(ch);
                ch.basicConsume(queueName, consumer);
                while (true) {
                    QueueingConsumer.Delivery delivery =
                      consumer.nextDelivery();
                    // ... use delivery.getBody(), etc ...
                    ch.basicAck(delivery.getEnvelope().getDeliveryTag(),
                                false);
                }



Thursday, 9 July 2009                                                      9
RabbitMQ Universe

                                          ...plus new
                                   developments like
                                     RabbitHub, BBC
                                   FeedsHub, Trixx, ...




Thursday, 9 July 2009                                     10
Cloud Messaging



Thursday, 9 July 2009                     11
Examples

                        • Soocial are using RabbitMQ + EC2 to
                          coordinate their contacts-database
                          synchronisation application
                        • The Ocean Observatories Initiative is using
                          RabbitMQ + relays + gateways for a global
                          sensing & data distribution network



Thursday, 9 July 2009                                                   12
Soocial.com




Thursday, 9 July 2009                 13
OOI – Ocean
                  Observatories Initiative




Thursday, 9 July 2009                        14
OOI – Ocean
                  Observatories Initiative
                                     Service.DomainName



                        Region Virtual IP




                         Cloud IPs




Thursday, 9 July 2009                                     15
Nanite
                        • Developed by Ezra Zygmuntowicz at
                          Engineyard
                        • Presence          (by pinging; we’re still working out the best way
                                            of putting presence into RabbitMQ itself)

                        • Self-assembling compute fabric
                        • Load-balancing & recovers from failure
                        • An easy way of deploying to the cloud
Thursday, 9 July 2009                                                                           16
VPN3             (VPN-cubed)
                        • A secure Virtual Private Network in the
                          cloud
                        • Uses RabbitMQ as a backend for IP
                          multicast (!) which otherwise doesn’t work in EC2
                        • Uses BGP to arrange routing between
                          nodes
                        • Can meld your datacentre(s) with EC2
Thursday, 9 July 2009                                                         17
Achieving Scale



Thursday, 9 July 2009                     18
Paul Baran, Introduction to Distributed Communications Networks, 1964



                        Paul Baran’s Networks




Thursday, 9 July 2009                                                                                19
Achieving Scale
                        • Capacity – throughput, latency,
                          responsiveness
                        • Synchronisation & Sharing
                        • Availability – uptime, data integrity
                        • Network Management – lots of devices,
                          lots of addresses, authentication &
                          authorisation


Thursday, 9 July 2009                                             20
Capacity

                        • Service capacity: bandwidth, throughput

                        • Service responsiveness: latency

                        • Data capacity: storage

Thursday, 9 July 2009                                               21
Simple load-balancing
                                                Request Queue



                                         (Private)
                                         Reply
                                         Queue




                        •   Shared queue mediates       •   Load-balancing, live
                            access to service               upgrades, fault-tolerance
                            instances

Thursday, 9 July 2009                                                                   22
Clustering




Thursday, 9 July 2009                23
Clustering




Thursday, 9 July 2009                24
Clustering
                                                Physical
                                                Machine
                        Erlang Node
                                                           Listening
                                                            Socket

                         Message              Erlang’s inter-node
                          Store                message routing




                               Virtual Host
Thursday, 9 July 2009                                                  25
Divide and Conquer

                        • By record – parallelisable data lets separate
                          broker clusters handle separate shards of
                          your data
                        • By component – each independent part of
                          your application can use separate brokers;
                          “federation of distributed systems”



Thursday, 9 July 2009                                                     26
WAN Cluster
            The WAN cluster has local
            queues but global exchanges
            Apps decide
            which broker-
            cluster to
            publish to




Thursday, 9 July 2009                     27
Overfeeding the server
                        • Message backlogs can cause catastrophe
                        • Goal: O(0) RAM cost per message
                        • Spool out to disk when memory pressure
                          gets high
                        • Testing and tuning: should land for
                          RabbitMQ 1.7


Thursday, 9 July 2009                                              28
Synchronisation
          When clustering might
          not be right:
              • huge networks
              • intermittent
                        connectivity
              •         ruling bandwidth
                        with an iron fist
              •         different
                        administrative
                        domains
Thursday, 9 July 2009                           29
Synchronisation




Thursday, 9 July 2009                     30
Ring
         Pass it on to your
         neighbour if your
         neighbour’s name
         isn’t in the list yet




Thursday, 9 July 2009            31
Complete
   Graph
         Pass it on to your
         neighbour if it
         hasn’t been
         labelled at all yet




Thursday, 9 July 2009          32
Multicast
         Pass it on to your
         neighbour if it
         hasn’t been
         labelled at all yet




Thursday, 9 July 2009          33
Availability

                        • Broker Availability

                        • Application/Service Availability

                        • Data Availability

Thursday, 9 July 2009                                        34
Responsibility transfer
                         Consumer                   Broker

                                    basic.deliver

                                    basic.deliver

                                    basic.deliver


                                        ...

                                      basic.ack




Thursday, 9 July 2009                                        35
Responsibility transfer
                         Producer                   Broker

                                    basic.publish

                                    basic.publish

                                    basic.publish

                                        ...
                                      tx.commit
                                    tx.commit-ok




Thursday, 9 July 2009                                        36
Responsibility transfer
                         Producer         Broker         Consumer




                                                   ...
                                    ...




Thursday, 9 July 2009                                               37
Responsibility transfer
                         Producer   Broker   Consumer




Thursday, 9 July 2009                                   38
Redundancy for HA

                        Pfailure = (Ploss) n




                                   (assuming independence)
Thursday, 9 July 2009                                        39
Redundancy for HA

                        Pfailure = (Ploss) n
         Uptime           Ploss   n      Pfailure   Overall Uptime
             99%           0.01   2      0.0001         99.99%
             99%           0.01   3     0.000001       99.9999%
            99.9%         0.001   2     0.000001       99.9999%
            99.9%         0.001   3   0.000000001    99.9999999%

                                        (assuming independence)
Thursday, 9 July 2009                                                39
Redundancy for HA
                          P           P


      One                 X       X   X       X      Two
     broker,                                       brokers,
   two nodes                                      one node
      each                                           each



                              C           C


Thursday, 9 July 2009                                         40
Deduplication
                                (“Idempotency Barrier”)


                              id=123            id=123


                              id=123


                              id=123




                        many messages              one message
                            enter                     leaves

Thursday, 9 July 2009                                            41
Network Management
                        • Small systems can be managed by hand
                        • Large systems need automation:
                         • Naming & address management
                         • Service directories
                         • Authentication & authorization
                         • Logging, monitoring & alerting
Thursday, 9 July 2009                                            42
The Future




Thursday, 9 July 2009                43
Questions?
                        http://www.rabbitmq.com/how




Thursday, 9 July 2009                                 44

More Related Content

Similar to Achieving Scale With Messaging And The Cloud 20090709

The Mobile Experience Ecosystem - Towards Personal Mobile Information Archite...
The Mobile Experience Ecosystem - Towards Personal Mobile Information Archite...The Mobile Experience Ecosystem - Towards Personal Mobile Information Archite...
The Mobile Experience Ecosystem - Towards Personal Mobile Information Archite...Rod Farmer
 
Open Source Tools For Freelancers
Open Source Tools For FreelancersOpen Source Tools For Freelancers
Open Source Tools For FreelancersChristie Koehler
 
SAM SIG: Hadoop architecture, MapReduce patterns, and best practices with Cas...
SAM SIG: Hadoop architecture, MapReduce patterns, and best practices with Cas...SAM SIG: Hadoop architecture, MapReduce patterns, and best practices with Cas...
SAM SIG: Hadoop architecture, MapReduce patterns, and best practices with Cas...cwensel
 
Intro to Laravel PHP Framework
Intro to Laravel PHP FrameworkIntro to Laravel PHP Framework
Intro to Laravel PHP FrameworkBill Condo
 
Building Scale Free Applications with Hadoop and Cascading
Building Scale Free Applications with Hadoop and CascadingBuilding Scale Free Applications with Hadoop and Cascading
Building Scale Free Applications with Hadoop and Cascadingcwensel
 
Accelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action CachingAccelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action Cachingelliando dias
 
How OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your HairHow OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your HairBruce Elgort
 
Eclipse RT projects Gemini web and Virgo par Steve Powell
Eclipse RT projects Gemini web and Virgo par Steve PowellEclipse RT projects Gemini web and Virgo par Steve Powell
Eclipse RT projects Gemini web and Virgo par Steve PowellEclipseDayParis
 
Karonis Rom Telecom
Karonis Rom TelecomKaronis Rom Telecom
Karonis Rom Telecomknowhowgr
 
ATA 2009 LT-10 Why You Want To Translate On The Mac
ATA 2009 LT-10 Why You Want To Translate On The MacATA 2009 LT-10 Why You Want To Translate On The Mac
ATA 2009 LT-10 Why You Want To Translate On The MacDierk Seeburg
 
AWS Customer Presentation - The Server Labs
AWS Customer Presentation - The Server Labs AWS Customer Presentation - The Server Labs
AWS Customer Presentation - The Server Labs Amazon Web Services
 
BDW: How To Pitch Your Ideas
BDW: How To Pitch Your IdeasBDW: How To Pitch Your Ideas
BDW: How To Pitch Your IdeasDavid Cohen
 
W3C Geolocation API - Making Websites Location-aware
W3C Geolocation API - Making Websites Location-awareW3C Geolocation API - Making Websites Location-aware
W3C Geolocation API - Making Websites Location-awareRyan Sarver
 
Atlassian - A Different Kind Of Software Company
Atlassian - A Different Kind Of Software CompanyAtlassian - A Different Kind Of Software Company
Atlassian - A Different Kind Of Software CompanyMike Cannon-Brookes
 
Infrastructure In The Cloud Era
Infrastructure In The Cloud EraInfrastructure In The Cloud Era
Infrastructure In The Cloud Eraelliando dias
 
The State of Puppet
The State of PuppetThe State of Puppet
The State of PuppetPuppet
 
Post globe 2010 fifthlight
Post globe 2010 fifthlightPost globe 2010 fifthlight
Post globe 2010 fifthlightONEIA
 
Ruby World
Ruby WorldRuby World
Ruby Worldevanphx
 

Similar to Achieving Scale With Messaging And The Cloud 20090709 (20)

The Mobile Experience Ecosystem - Towards Personal Mobile Information Archite...
The Mobile Experience Ecosystem - Towards Personal Mobile Information Archite...The Mobile Experience Ecosystem - Towards Personal Mobile Information Archite...
The Mobile Experience Ecosystem - Towards Personal Mobile Information Archite...
 
Open Source Tools For Freelancers
Open Source Tools For FreelancersOpen Source Tools For Freelancers
Open Source Tools For Freelancers
 
SAM SIG: Hadoop architecture, MapReduce patterns, and best practices with Cas...
SAM SIG: Hadoop architecture, MapReduce patterns, and best practices with Cas...SAM SIG: Hadoop architecture, MapReduce patterns, and best practices with Cas...
SAM SIG: Hadoop architecture, MapReduce patterns, and best practices with Cas...
 
Intro to Laravel PHP Framework
Intro to Laravel PHP FrameworkIntro to Laravel PHP Framework
Intro to Laravel PHP Framework
 
Building Scale Free Applications with Hadoop and Cascading
Building Scale Free Applications with Hadoop and CascadingBuilding Scale Free Applications with Hadoop and Cascading
Building Scale Free Applications with Hadoop and Cascading
 
Accelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action CachingAccelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action Caching
 
How OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your HairHow OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
 
Eclipse RT projects Gemini web and Virgo par Steve Powell
Eclipse RT projects Gemini web and Virgo par Steve PowellEclipse RT projects Gemini web and Virgo par Steve Powell
Eclipse RT projects Gemini web and Virgo par Steve Powell
 
Karonis Rom Telecom
Karonis Rom TelecomKaronis Rom Telecom
Karonis Rom Telecom
 
ATA 2009 LT-10 Why You Want To Translate On The Mac
ATA 2009 LT-10 Why You Want To Translate On The MacATA 2009 LT-10 Why You Want To Translate On The Mac
ATA 2009 LT-10 Why You Want To Translate On The Mac
 
AWS Customer Presentation - The Server Labs
AWS Customer Presentation - The Server Labs AWS Customer Presentation - The Server Labs
AWS Customer Presentation - The Server Labs
 
BDW: How To Pitch Your Ideas
BDW: How To Pitch Your IdeasBDW: How To Pitch Your Ideas
BDW: How To Pitch Your Ideas
 
Scaling Django Dc09
Scaling Django Dc09Scaling Django Dc09
Scaling Django Dc09
 
W3C Geolocation API - Making Websites Location-aware
W3C Geolocation API - Making Websites Location-awareW3C Geolocation API - Making Websites Location-aware
W3C Geolocation API - Making Websites Location-aware
 
Atlassian - A Different Kind Of Software Company
Atlassian - A Different Kind Of Software CompanyAtlassian - A Different Kind Of Software Company
Atlassian - A Different Kind Of Software Company
 
Infrastructure In The Cloud Era
Infrastructure In The Cloud EraInfrastructure In The Cloud Era
Infrastructure In The Cloud Era
 
The State of Puppet
The State of PuppetThe State of Puppet
The State of Puppet
 
Post globe 2010 fifthlight
Post globe 2010 fifthlightPost globe 2010 fifthlight
Post globe 2010 fifthlight
 
Ruby World
Ruby WorldRuby World
Ruby World
 
Plone on Amazon EC2
Plone on Amazon EC2Plone on Amazon EC2
Plone on Amazon EC2
 

Recently uploaded

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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 SolutionsEnterprise Knowledge
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Achieving Scale With Messaging And The Cloud 20090709

  • 1. Achieving Scale with Messaging & the Cloud Tony Garnock-Jones <tonyg@lshift.net> Thursday, 9 July 2009 1
  • 2. Outline • Messaging – what, why • Cloud Messaging – some examples • Achieving Scale – what, why, how Thursday, 9 July 2009 2
  • 4. Messaging Elements ...relaying, filtering, multicasting, forwarding, buffering, distribution/scheduling, subscription, topics, streaming, ... Element Element ... Element Element Element Element ... Thursday, 9 July 2009 4
  • 5. What is it good for? Decoupling communication from behaviour, enabling: • debuggability • cross-language integration • manageability • fault-tolerance • monitorability • store-and-forward • rolling upgrades • ... • load-balancing Thursday, 9 July 2009 5
  • 6. Messaging Elements ...relaying, filtering, multicasting, forwarding, buffering, distribution/scheduling, subscription, topics, streaming, ... messages message Element subscribe unsubscribe Thursday, 9 July 2009 6
  • 7. Messaging Elements • Delivery: • deliver(target, message); • Subscription: • bind(source, topic, target); • unbind(source, topic, target); Thursday, 9 July 2009 7
  • 8. AMQP for Messaging C P X C P X C • Exchanges perform • Queues perform relaying, copying, and buffering and round- filtering robin delivery Thursday, 9 July 2009 8
  • 9. It’s Easy byte[] body = ...; ch.basicPublish(exchange, routingKey, null, body); ch.queueBind(queueName, exchange, routingKeyPattern); QueueingConsumer consumer = new QueueingConsumer(ch); ch.basicConsume(queueName, consumer); while (true) { QueueingConsumer.Delivery delivery = consumer.nextDelivery(); // ... use delivery.getBody(), etc ... ch.basicAck(delivery.getEnvelope().getDeliveryTag(), false); } Thursday, 9 July 2009 9
  • 10. RabbitMQ Universe ...plus new developments like RabbitHub, BBC FeedsHub, Trixx, ... Thursday, 9 July 2009 10
  • 12. Examples • Soocial are using RabbitMQ + EC2 to coordinate their contacts-database synchronisation application • The Ocean Observatories Initiative is using RabbitMQ + relays + gateways for a global sensing & data distribution network Thursday, 9 July 2009 12
  • 14. OOI – Ocean Observatories Initiative Thursday, 9 July 2009 14
  • 15. OOI – Ocean Observatories Initiative Service.DomainName Region Virtual IP Cloud IPs Thursday, 9 July 2009 15
  • 16. Nanite • Developed by Ezra Zygmuntowicz at Engineyard • Presence (by pinging; we’re still working out the best way of putting presence into RabbitMQ itself) • Self-assembling compute fabric • Load-balancing & recovers from failure • An easy way of deploying to the cloud Thursday, 9 July 2009 16
  • 17. VPN3 (VPN-cubed) • A secure Virtual Private Network in the cloud • Uses RabbitMQ as a backend for IP multicast (!) which otherwise doesn’t work in EC2 • Uses BGP to arrange routing between nodes • Can meld your datacentre(s) with EC2 Thursday, 9 July 2009 17
  • 19. Paul Baran, Introduction to Distributed Communications Networks, 1964 Paul Baran’s Networks Thursday, 9 July 2009 19
  • 20. Achieving Scale • Capacity – throughput, latency, responsiveness • Synchronisation & Sharing • Availability – uptime, data integrity • Network Management – lots of devices, lots of addresses, authentication & authorisation Thursday, 9 July 2009 20
  • 21. Capacity • Service capacity: bandwidth, throughput • Service responsiveness: latency • Data capacity: storage Thursday, 9 July 2009 21
  • 22. Simple load-balancing Request Queue (Private) Reply Queue • Shared queue mediates • Load-balancing, live access to service upgrades, fault-tolerance instances Thursday, 9 July 2009 22
  • 25. Clustering Physical Machine Erlang Node Listening Socket Message Erlang’s inter-node Store message routing Virtual Host Thursday, 9 July 2009 25
  • 26. Divide and Conquer • By record – parallelisable data lets separate broker clusters handle separate shards of your data • By component – each independent part of your application can use separate brokers; “federation of distributed systems” Thursday, 9 July 2009 26
  • 27. WAN Cluster The WAN cluster has local queues but global exchanges Apps decide which broker- cluster to publish to Thursday, 9 July 2009 27
  • 28. Overfeeding the server • Message backlogs can cause catastrophe • Goal: O(0) RAM cost per message • Spool out to disk when memory pressure gets high • Testing and tuning: should land for RabbitMQ 1.7 Thursday, 9 July 2009 28
  • 29. Synchronisation When clustering might not be right: • huge networks • intermittent connectivity • ruling bandwidth with an iron fist • different administrative domains Thursday, 9 July 2009 29
  • 31. Ring Pass it on to your neighbour if your neighbour’s name isn’t in the list yet Thursday, 9 July 2009 31
  • 32. Complete Graph Pass it on to your neighbour if it hasn’t been labelled at all yet Thursday, 9 July 2009 32
  • 33. Multicast Pass it on to your neighbour if it hasn’t been labelled at all yet Thursday, 9 July 2009 33
  • 34. Availability • Broker Availability • Application/Service Availability • Data Availability Thursday, 9 July 2009 34
  • 35. Responsibility transfer Consumer Broker basic.deliver basic.deliver basic.deliver ... basic.ack Thursday, 9 July 2009 35
  • 36. Responsibility transfer Producer Broker basic.publish basic.publish basic.publish ... tx.commit tx.commit-ok Thursday, 9 July 2009 36
  • 37. Responsibility transfer Producer Broker Consumer ... ... Thursday, 9 July 2009 37
  • 38. Responsibility transfer Producer Broker Consumer Thursday, 9 July 2009 38
  • 39. Redundancy for HA Pfailure = (Ploss) n (assuming independence) Thursday, 9 July 2009 39
  • 40. Redundancy for HA Pfailure = (Ploss) n Uptime Ploss n Pfailure Overall Uptime 99% 0.01 2 0.0001 99.99% 99% 0.01 3 0.000001 99.9999% 99.9% 0.001 2 0.000001 99.9999% 99.9% 0.001 3 0.000000001 99.9999999% (assuming independence) Thursday, 9 July 2009 39
  • 41. Redundancy for HA P P One X X X X Two broker, brokers, two nodes one node each each C C Thursday, 9 July 2009 40
  • 42. Deduplication (“Idempotency Barrier”) id=123 id=123 id=123 id=123 many messages one message enter leaves Thursday, 9 July 2009 41
  • 43. Network Management • Small systems can be managed by hand • Large systems need automation: • Naming & address management • Service directories • Authentication & authorization • Logging, monitoring & alerting Thursday, 9 July 2009 42
  • 44. The Future Thursday, 9 July 2009 43
  • 45. Questions? http://www.rabbitmq.com/how Thursday, 9 July 2009 44