SlideShare una empresa de Scribd logo
1 de 28
Scalable Persistent Message Brokering
with WSO2 Message Broker
Srinath Perera
Senior Software Architect
WSO2 Inc.
Outline
     • Understanding Messaging
     • Scalable Messaging
     • WSO2 MB Architecture
            •     Distributed Pub/Sub architecture
            •     Distributed Queues architecture
     • Usecases
     • Conclusion




photo by John Trainoron Flickr http://www.flickr.com/photos/trainor/2902023575/, Licensed under CC
What is Messaging ?
• We often program and design
  distributed systems with RPC
  style communication (E.g. Web
  Services, Thrift, REST)
• RPC communication is
   •   Request/Response (there is
       always a response)
   •   Synchronous (client waits for
       response)
   •   Non-persistent (message is lost if
       something failed)
• But there are other 7 possibilities
Messaging Systems in Real World
• Sensor networks
• Monitoring/
  Surveillance
• Business Activity
  Monitoring
• Job Scheduling
  Systems
• Social Networks

  http://www.flickr.com/photos/imuttoo/4257813689/ by Ian Muttoo, http://www.flickr.com/photos/eastcapital/4554220770/,
   http://www.flickr.com/photos/patdavid/4619331472/ by Pat David copyright CC, http://www.fotopedia.com/items/flickr-
                                                      2548697541
Why Messaging?




            WSO2 Inc.   5
Messaging Systems

    • Message Broker(s) as
      the middlemen
    • There are two main
      models
          •    Queues
          •    Publish/Subscribe




http://www.geograph.org.uk/photo/2639458 and http://www.geograph.org.uk/photo/1138150
Distributed Queues



• A queue in the “Network”
• API Operations
   •   Put(M) – put a message
   •   Get() – get a message (dqueue)
   •   Subscribe() – send me a message when there is one
• E.g. SQS (Amazon Queuing Service)
• Use cases:- Job Queues, Store and process
                                                     7
Publish/ Subscribe




• There is a topic space based on interest groups
• Publishers send messages to brokers
• Subscribers register their interest
• Brokers matches events (messages) and deliver to all
  interested parties
• Usecases: Surveillance, Monitoring
                              WSO2 Inc.         8
Messaging APIs and Message Formats and
               Standards




             WSO2 Inc.    9
Scaling Message Brokers
   There are several dimensions of
    Scale
     Number of messages
     Number of Queues
     Size of messages
 Scaling Pub/Sub is relatively easy
     E.g. Narada Broker, Padres
 Scaling Distributed Queues is
  harder



                                   WSO2 Inc.   10
Scaling Distributed Queues
Scaling Distributed Queues (Contd.)
Topology                Pros                       Cons                        Supporting Systems


Master Salve            Support HA                 No Scalability              Qpid, ActiveMQ,
                                                                               RabbitMQ
Queue Distribution      Scale to large number of   Does not scale for large    RabbitMQ
                        Queues                     number of messages for
                                                   a queue

Cluster Connections     Support HA                 Might not support in-       HorentMQ
                                                   order delivery Logic runs
                                                   in the client side takes
                                                   local decisions.

Broker/Queue Networks   Load balancing and         Fair load balancing is      ActiveMQ
                        distribution               hard

                                             WSO2 Inc.                        12
MB2 Messaging Architecture




       WSO2 Inc.     13
WSO2 MB




          WSO2 Inc.   14
Cassandra and Zookeeper
• Cassandra
  •   NoSQL Highly scalable new data model (column family)
  •   Highly scalable (multiple Nodes), available and no Single Point of
      Failure.
  •   SQL like query language (from 0.8) and support search through
      secondary indexes (well no JOINs, Group By etc. ..).
  •   Tunable consistency and replication
  •   Very high write throughput and good read throughput. It is pretty
      fast.
• Zookeeper
  •   Scalable, fault tolerant distributed coordination framework
How Distributed Queues Works ?
How Distributed Queues Works (Contd..)
How Distributed Queues Works (Contd.)
   Users can publish to any node (to a topic)
   When published, the node writes the message to queue in
    Cassandra called “global queue”
   Each node have a queue in Cassandra called the node queue
   A worker running in a node reads message from global queue
    and writes messages to a node queue that has a subscription for
    that topic.
   A worker in each node reads messages from node queue and
    delivers to subscriber for that queue.
   Node deletes messages only when subscriber has acked the
    delivery
How Pub/Sub Works ?
How Pub/Sub Works (Contd.) ?
Fault Tolerance
                                         • We write the message to
                                           Cassandra once we receive the
                                           message
                                         • We always read, process and
                                           then only delete messages (e.g.
                                           at client delivery after receiving
                                           the Ack)
                                         • In case of a failure of nodes, then
                                           worse case there will be
                                           duplicates

Copy right , http://www.fotopedia.com/items/flickr-6206406047:CC license
JMS support for MB2

      Feature                          Yes
     Pub / Sub                         Yes
Durable Subscriptions                  Yes
 Hierarchical Topics                   Yes
      Queues                           Yes
 Message Selectors              No, planned for 3.0
    Transactions                No, planned for 3.0



                    WSO2 Inc.          22
How does MB2 Make a difference?
                                                      • Scale up in all 3 dimensions
                                                      • Create only one copy of
                                                        message while delivery
                                                      • High Availability and Fault
                                                        Tolerance
                                                      • Large message transfers in
                                                        pub/sub (asynchronous style)
                                                      • Let users choose between strict
                                                        and best effort message delivery
                                                      • Replication of stored messages
http://www.flickr.com/photos/flickcoolpix/356684845
              8/sizes/m/in/photostream/                 in the storage
Usecase 1: Store and Process
Usecase 2: Message Bus
Future Work and Roadmap
                                              • WSO2 MB (2013 Q4)
                                                 •   Support for in-memory delivery
                                                     through hazelcast
                                                     (www.hazelcast.com)
                                                 •   AMQP 1.0 support
                                                 •   Transaction support
                                              • If you have thoughts, please
                                                chat with me or join us at
                                                architecture@wso2.org

http://www.flickr.com/photos/24071429@N08/2
                   314391179/
Conclusion
• Provides an alternative architecture for
  scalable message brokers using
  Cassandra and Zookeeper
• It provides
    •    A publish/subscribe model that does not
         need any coordination between broker nodes
    •    A strict mode for distributed queues that
         provides in order delivery
    •    A best-effort mode for distributed queue



http://ambr0.deviantart.com/art/Looking-Back-Wolf-
                    310857819
Questions?

Más contenido relacionado

La actualidad más candente

JMS Providers Overview
JMS Providers OverviewJMS Providers Overview
JMS Providers Overview
Vadym Lotar
 
Towards Improved Data Dissemination of Publish-Subscribe Systems
Towards Improved Data Dissemination of Publish-Subscribe SystemsTowards Improved Data Dissemination of Publish-Subscribe Systems
Towards Improved Data Dissemination of Publish-Subscribe Systems
Srinath Perera
 
Mom those things v1
Mom those things v1 Mom those things v1
Mom those things v1
von gosling
 
Reliable Messaging /Guaranteed delivery
Reliable Messaging /Guaranteed deliveryReliable Messaging /Guaranteed delivery
Reliable Messaging /Guaranteed delivery
WSO2
 

La actualidad más candente (20)

Mini-Training: Message Brokers
Mini-Training: Message BrokersMini-Training: Message Brokers
Mini-Training: Message Brokers
 
JMS Providers Overview
JMS Providers OverviewJMS Providers Overview
JMS Providers Overview
 
Towards Improved Data Dissemination of Publish-Subscribe Systems
Towards Improved Data Dissemination of Publish-Subscribe SystemsTowards Improved Data Dissemination of Publish-Subscribe Systems
Towards Improved Data Dissemination of Publish-Subscribe Systems
 
NServiceBus - building a distributed system based on a messaging infrastructure
NServiceBus - building a distributed system based on a messaging infrastructureNServiceBus - building a distributed system based on a messaging infrastructure
NServiceBus - building a distributed system based on a messaging infrastructure
 
Mom those things v1
Mom those things v1 Mom those things v1
Mom those things v1
 
Reliable Messaging /Guaranteed delivery
Reliable Messaging /Guaranteed deliveryReliable Messaging /Guaranteed delivery
Reliable Messaging /Guaranteed delivery
 
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/SubscribeIBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
 
Differences between JMS and AMQP
Differences between JMS and AMQPDifferences between JMS and AMQP
Differences between JMS and AMQP
 
AMQP 1.0 introduction
AMQP 1.0 introductionAMQP 1.0 introduction
AMQP 1.0 introduction
 
Rabbitmq basics
Rabbitmq basicsRabbitmq basics
Rabbitmq basics
 
XMPP Academy #1
XMPP Academy #1XMPP Academy #1
XMPP Academy #1
 
RabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryRabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client library
 
Improvements in Failover Clustering in Windows Server 2012
Improvements in Failover Clustering in Windows Server 2012Improvements in Failover Clustering in Windows Server 2012
Improvements in Failover Clustering in Windows Server 2012
 
Rabbitmq an amqp message broker
Rabbitmq an amqp message brokerRabbitmq an amqp message broker
Rabbitmq an amqp message broker
 
RabbitMQ - message broker
RabbitMQ - message brokerRabbitMQ - message broker
RabbitMQ - message broker
 
NServiceBus workshop presentation
NServiceBus workshop presentationNServiceBus workshop presentation
NServiceBus workshop presentation
 
A Closer Look at RabbitMQ
A Closer Look at RabbitMQA Closer Look at RabbitMQ
A Closer Look at RabbitMQ
 
Message Queue (MQ) Testing
Message Queue (MQ) TestingMessage Queue (MQ) Testing
Message Queue (MQ) Testing
 
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure FunctionsMessaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
 
Implementing CloudStack's VPC feature
Implementing CloudStack's VPC featureImplementing CloudStack's VPC feature
Implementing CloudStack's VPC feature
 

Similar a Scalable Persistent Message Brokering with WSO2 Message Broker

WSO2 Product Release Webinar Introducing the WSO2 Message Broker
WSO2 Product Release Webinar   Introducing the WSO2 Message BrokerWSO2 Product Release Webinar   Introducing the WSO2 Message Broker
WSO2 Product Release Webinar Introducing the WSO2 Message Broker
WSO2
 
apachekafka-160907180205.pdf
apachekafka-160907180205.pdfapachekafka-160907180205.pdf
apachekafka-160907180205.pdf
TarekHamdi8
 
Adjust Carbon Topology to Match High Availability Scenario Requirements
Adjust Carbon Topology to Match High Availability Scenario Requirements   Adjust Carbon Topology to Match High Availability Scenario Requirements
Adjust Carbon Topology to Match High Availability Scenario Requirements
WSO2
 
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Erik Onnen
 
Glassfish Metro - Java Web Services Stack
Glassfish Metro - Java Web Services StackGlassfish Metro - Java Web Services Stack
Glassfish Metro - Java Web Services Stack
Dmitry Buzdin
 

Similar a Scalable Persistent Message Brokering with WSO2 Message Broker (20)

WSO2 Product Release Webinar Introducing the WSO2 Message Broker
WSO2 Product Release Webinar   Introducing the WSO2 Message BrokerWSO2 Product Release Webinar   Introducing the WSO2 Message Broker
WSO2 Product Release Webinar Introducing the WSO2 Message Broker
 
Architectures with Windows Azure
Architectures with Windows AzureArchitectures with Windows Azure
Architectures with Windows Azure
 
Kafka tutorial
Kafka tutorialKafka tutorial
Kafka tutorial
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
apachekafka-160907180205.pdf
apachekafka-160907180205.pdfapachekafka-160907180205.pdf
apachekafka-160907180205.pdf
 
Modern Distributed Messaging and RPC
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPC
 
Adjusting carbon topology to match high availability scenario requirements
Adjusting carbon topology to match high availability scenario requirements   Adjusting carbon topology to match high availability scenario requirements
Adjusting carbon topology to match high availability scenario requirements
 
Adjust Carbon Topology to Match High Availability Scenario Requirements
Adjust Carbon Topology to Match High Availability Scenario Requirements   Adjust Carbon Topology to Match High Availability Scenario Requirements
Adjust Carbon Topology to Match High Availability Scenario Requirements
 
Distributed messaging with Apache Kafka
Distributed messaging with Apache KafkaDistributed messaging with Apache Kafka
Distributed messaging with Apache Kafka
 
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
 
Apache Kafka Introduction
Apache Kafka IntroductionApache Kafka Introduction
Apache Kafka Introduction
 
Fundamentals of Apache Kafka
Fundamentals of Apache KafkaFundamentals of Apache Kafka
Fundamentals of Apache Kafka
 
Building an Event Bus at Scale
Building an Event Bus at ScaleBuilding an Event Bus at Scale
Building an Event Bus at Scale
 
Unleashing Real-time Power with Kafka.pptx
Unleashing Real-time Power with Kafka.pptxUnleashing Real-time Power with Kafka.pptx
Unleashing Real-time Power with Kafka.pptx
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
 
Message queues
Message queuesMessage queues
Message queues
 
Glassfish Metro - Java Web Services Stack
Glassfish Metro - Java Web Services StackGlassfish Metro - Java Web Services Stack
Glassfish Metro - Java Web Services Stack
 
Fundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache KafkaFundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache Kafka
 
An Introduction to the Message Queuing Technology & IBM WebSphere MQ
An Introduction to the Message Queuing Technology & IBM WebSphere MQAn Introduction to the Message Queuing Technology & IBM WebSphere MQ
An Introduction to the Message Queuing Technology & IBM WebSphere MQ
 
Kafka 0.8.0 Presentation to Atlanta Java User's Group March 2013
Kafka 0.8.0 Presentation to Atlanta Java User's Group March 2013Kafka 0.8.0 Presentation to Atlanta Java User's Group March 2013
Kafka 0.8.0 Presentation to Atlanta Java User's Group March 2013
 

Más de Srinath Perera

Más de Srinath Perera (20)

Book: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingBook: Software Architecture and Decision-Making
Book: Software Architecture and Decision-Making
 
Data science Applications in the Enterprise
Data science Applications in the EnterpriseData science Applications in the Enterprise
Data science Applications in the Enterprise
 
An Introduction to APIs
An Introduction to APIs An Introduction to APIs
An Introduction to APIs
 
An Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance ProfessionalsAn Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance Professionals
 
AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?
 
Healthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesHealthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & Challenges
 
How would AI shape Future Integrations?
How would AI shape Future Integrations?How would AI shape Future Integrations?
How would AI shape Future Integrations?
 
The Role of Blockchain in Future Integrations
The Role of Blockchain in Future IntegrationsThe Role of Blockchain in Future Integrations
The Role of Blockchain in Future Integrations
 
Future of Serverless
Future of ServerlessFuture of Serverless
Future of Serverless
 
Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going? Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going?
 
Few thoughts about Future of Blockchain
Few thoughts about Future of BlockchainFew thoughts about Future of Blockchain
Few thoughts about Future of Blockchain
 
A Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New TechnologiesA Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New Technologies
 
Privacy in Bigdata Era
Privacy in Bigdata  EraPrivacy in Bigdata  Era
Privacy in Bigdata Era
 
Blockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksBlockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and Risks
 
Today's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology LandscapeToday's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology Landscape
 
An Emerging Technologies Timeline
An Emerging Technologies TimelineAn Emerging Technologies Timeline
An Emerging Technologies Timeline
 
The Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming ApplicationsThe Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming Applications
 
Analytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the UglyAnalytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the Ugly
 
Transforming a Business Through Analytics
Transforming a Business Through AnalyticsTransforming a Business Through Analytics
Transforming a Business Through Analytics
 
SoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration TechnologySoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration Technology
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Scalable Persistent Message Brokering with WSO2 Message Broker

  • 1. Scalable Persistent Message Brokering with WSO2 Message Broker Srinath Perera Senior Software Architect WSO2 Inc.
  • 2. Outline • Understanding Messaging • Scalable Messaging • WSO2 MB Architecture • Distributed Pub/Sub architecture • Distributed Queues architecture • Usecases • Conclusion photo by John Trainoron Flickr http://www.flickr.com/photos/trainor/2902023575/, Licensed under CC
  • 3. What is Messaging ? • We often program and design distributed systems with RPC style communication (E.g. Web Services, Thrift, REST) • RPC communication is • Request/Response (there is always a response) • Synchronous (client waits for response) • Non-persistent (message is lost if something failed) • But there are other 7 possibilities
  • 4. Messaging Systems in Real World • Sensor networks • Monitoring/ Surveillance • Business Activity Monitoring • Job Scheduling Systems • Social Networks http://www.flickr.com/photos/imuttoo/4257813689/ by Ian Muttoo, http://www.flickr.com/photos/eastcapital/4554220770/, http://www.flickr.com/photos/patdavid/4619331472/ by Pat David copyright CC, http://www.fotopedia.com/items/flickr- 2548697541
  • 5. Why Messaging? WSO2 Inc. 5
  • 6. Messaging Systems • Message Broker(s) as the middlemen • There are two main models • Queues • Publish/Subscribe http://www.geograph.org.uk/photo/2639458 and http://www.geograph.org.uk/photo/1138150
  • 7. Distributed Queues • A queue in the “Network” • API Operations • Put(M) – put a message • Get() – get a message (dqueue) • Subscribe() – send me a message when there is one • E.g. SQS (Amazon Queuing Service) • Use cases:- Job Queues, Store and process 7
  • 8. Publish/ Subscribe • There is a topic space based on interest groups • Publishers send messages to brokers • Subscribers register their interest • Brokers matches events (messages) and deliver to all interested parties • Usecases: Surveillance, Monitoring WSO2 Inc. 8
  • 9. Messaging APIs and Message Formats and Standards WSO2 Inc. 9
  • 10. Scaling Message Brokers  There are several dimensions of Scale  Number of messages  Number of Queues  Size of messages  Scaling Pub/Sub is relatively easy  E.g. Narada Broker, Padres  Scaling Distributed Queues is harder WSO2 Inc. 10
  • 12. Scaling Distributed Queues (Contd.) Topology Pros Cons Supporting Systems Master Salve Support HA No Scalability Qpid, ActiveMQ, RabbitMQ Queue Distribution Scale to large number of Does not scale for large RabbitMQ Queues number of messages for a queue Cluster Connections Support HA Might not support in- HorentMQ order delivery Logic runs in the client side takes local decisions. Broker/Queue Networks Load balancing and Fair load balancing is ActiveMQ distribution hard WSO2 Inc. 12
  • 14. WSO2 MB WSO2 Inc. 14
  • 15. Cassandra and Zookeeper • Cassandra • NoSQL Highly scalable new data model (column family) • Highly scalable (multiple Nodes), available and no Single Point of Failure. • SQL like query language (from 0.8) and support search through secondary indexes (well no JOINs, Group By etc. ..). • Tunable consistency and replication • Very high write throughput and good read throughput. It is pretty fast. • Zookeeper • Scalable, fault tolerant distributed coordination framework
  • 17. How Distributed Queues Works (Contd..)
  • 18. How Distributed Queues Works (Contd.)  Users can publish to any node (to a topic)  When published, the node writes the message to queue in Cassandra called “global queue”  Each node have a queue in Cassandra called the node queue  A worker running in a node reads message from global queue and writes messages to a node queue that has a subscription for that topic.  A worker in each node reads messages from node queue and delivers to subscriber for that queue.  Node deletes messages only when subscriber has acked the delivery
  • 20. How Pub/Sub Works (Contd.) ?
  • 21. Fault Tolerance • We write the message to Cassandra once we receive the message • We always read, process and then only delete messages (e.g. at client delivery after receiving the Ack) • In case of a failure of nodes, then worse case there will be duplicates Copy right , http://www.fotopedia.com/items/flickr-6206406047:CC license
  • 22. JMS support for MB2 Feature Yes Pub / Sub Yes Durable Subscriptions Yes Hierarchical Topics Yes Queues Yes Message Selectors No, planned for 3.0 Transactions No, planned for 3.0 WSO2 Inc. 22
  • 23. How does MB2 Make a difference? • Scale up in all 3 dimensions • Create only one copy of message while delivery • High Availability and Fault Tolerance • Large message transfers in pub/sub (asynchronous style) • Let users choose between strict and best effort message delivery • Replication of stored messages http://www.flickr.com/photos/flickcoolpix/356684845 8/sizes/m/in/photostream/ in the storage
  • 24. Usecase 1: Store and Process
  • 26. Future Work and Roadmap • WSO2 MB (2013 Q4) • Support for in-memory delivery through hazelcast (www.hazelcast.com) • AMQP 1.0 support • Transaction support • If you have thoughts, please chat with me or join us at architecture@wso2.org http://www.flickr.com/photos/24071429@N08/2 314391179/
  • 27. Conclusion • Provides an alternative architecture for scalable message brokers using Cassandra and Zookeeper • It provides • A publish/subscribe model that does not need any coordination between broker nodes • A strict mode for distributed queues that provides in order delivery • A best-effort mode for distributed queue http://ambr0.deviantart.com/art/Looking-Back-Wolf- 310857819