The document discusses Event-driven architecture (EDA) and the SAPO Broker messaging system. It provides an overview of key concepts of EDA including how it allows for loosely coupled systems that are easy to scale. It then describes the SAPO Broker, a distributed, peer-to-peer messaging broker that has been in production at SAPO for 2-3 years. SAPO Broker supports pub/sub and queue-based messaging over topics and queues and includes language bindings for Perl, Python, Ruby and others. It provides a basic but stable platform for building event-driven systems in Perl.
3. EDA
• Everything is about events: generation,
consumption, processing
• Works great with loosely coupled systems
• Very asynchronous in nature, someone
triggers an event, eventually someone
process the event
4. Make Money Fast
• Loosely couple systems means you don’t
have to say you’re sorry
• A new system does not usually require
touching older systems
• Need more power? add more consumers/
processors
5. SAPO Broker
• Keyword Bingo: a MOM using P2P Agents,
providing basic PubSub and Queueing
• Key fact n.1: distributed - no single point of
failure, no “head” nodes, no “ultra-peers”
• Key fact n. 2: in production for the last 2/3
years at SAPO
6. SAPO Broker
• Implemented in Java, but bindings for Perl,
Python, Ruby, PHP, C out of the box
• SAPO::Broker module included in the SVN
• Soon Net::SAPO::Broker and
AnyEvent::SAPO::Broker at CPAN
• Basic publishing also possible with HTTP
POST or file system (UDP since today)
13. Queues
• Processes queue requests
• Several workers consume requests
• Each requests goes to one worker
• System does not provide return channel for
response, make up your own
14. Topic as Queues
• Twist on normal Topics
• Several worker processes subscribe “as
one” to a topic
• Notifications will be delivered over all
workers, each event goes to only one
worker
• Excellent for heavy processing on busy
15. Topics are just strings
• No hidden magic, no hierarchical
organization
• But you can add your own
• SAPO uses /sapo/<system>/<other>/
<levels>/<here>
• You can subscribe with RegExp though :)
16. Wrap up
• EDA systems are easier to scale
• Loosely coupled systems are easier to
manage
• SAPO Broker is a stable MOM for building
EDA with Perl
• The distributed nature of SAPO Broker
makes it better at using all your cores