SlideShare ist ein Scribd-Unternehmen logo
1 von 66
Downloaden Sie, um offline zu lesen
Domain
Event Driven Architecture
             Stefan Norberg,
    Head of Architecture at Unibet.com
                    twitter: @stnor
          email: stefan.norberg@unibet.com
           blog: http://stnor.wordpress.com
@stnor
• 17 years as an IT professional
• Has worked with most aspects of IT
 •   Operations & infrastructure
 •   IT security
 •   Systems development
 •   Software architecture
 •   Enterprise architecture


• Head of Architecture at Unibet
Agenda

• Basics and EDA intro
• The SOA problem
• How Domain EDA completes SOA
• Implementation notes from Unibet
• What to tell your manager
The three styles of
    interaction
Type of interaction   Initiator        Participants



  Time-driven          Time       The specified systems



 Request-driven       Client       Client and Server



  Event-driven         Event          Open-ended
Time driven

      Fruit
     system
     run inventory
    check every 60
          mins
Request driven

                                   Fruit
Tarzan                            system
         Me want three bananas!
Event driven

      Fruit
     system
                “Tarzan took three
                     bananas”

              “Fruit system is low on
                      bananas”
5 Principles of EDA
• “Real-time” events as they happen at the
  producer
• Push notifications
• One-way “fire-and-forget”
• Immediate action at the consumers
• Informational (“someone logged in”), not
  commands (“audit this”)
Typical EDA architecture

  Event
            system    system     system
Producers


  Event              Event Bus
Transport


  Event
            system    system     system
Consumers
Main benefits of EDA

• Supports the business demands for better
  service (no batch, less waiting)
• No point-to-point integrations (fire &
  forget)
• Enables high performance, highly scalable
  systems
The birth of a system


              Inventory

         Customer

             Shop
The monolith


               Shop
 Payment
         Customer Newsletter
 Reporting
           Inventory
SOA architecture #1
  Divide the problem domains into separate systems




          Shop               Payment            Newsletter




                            Customer
        Inventory                                Reporting
                               DB
SOA architecture #1
    A lot of point to point integration...




      Shop                 Payment           Newsletter




                         Customer
    Inventory                                Reporting
                            DB
SOA architecture #2

              Shop       Payment      Newsletter




Monolith?               Service Bus



                        Customer
            Inventory                 Reporting
                           DB
Let’s add fraud checks

                        fraud
         Shop     Payment       Newsletter
     fraud




                 Service Bus



                 Customer
     Inventory                  Reporting
                    DB
Let’s add a loyalty
            system
                             fraud
              Shop     Payment       Newsletter
          fraud




                      Service Bus



                      Customer
Loyalty   Inventory                  Reporting
                         DB
Integration ripple effect

                             fraud
              Shop     Payment       Newsletter
          fraud




                      Service Bus



                      Customer
Loyalty   Inventory                  Reporting
                         DB
Problem summary
• SOA is all about dividing domain logic into
  separate systems and exposing it as
  services
• Some domain logic will, by its very nature,
  be spread out over many systems
• The result is domain pollution and bloat in
  the SOA systems
“It's really become clear to me in the last couple
of years that we need a new building block and
that is the Domain Events”
                -- Eric Evans, QCon 2009
Domain Events and
       SOA
• A Domain Event is something that
  happened that the domain expert cares
  about
• A SOA system’s primary focus should be
  on the domain and domain logic
Domain EDA


• By exposing relevant Domain Events on a
  shared event bus we can isolate cross
  cutting functions to separate systems
Domain EDA + SOA
Reporting


 Loyalty              Shop      Payment    Newsletter
            Event
             Bus
                    Inventory   Customer
Domain EDA + SOA
Reporting


 Loyalty              Shop      Payment    Newsletter
            Event
             Bus
  BAM               Inventory   Customer


  Fraud
“You complete me”


Domain EDA          SOA
Example how Domain
   EDA decouples
Coupled integration


   Trading   Reporting
   system     system

   model      model
Coupled integration


   Trading   Reporting
   system     system

  model v2    model
Domain EDA
           integration
                           I’m interested in
                          buy, sell and market
                             status events




Trading   domain events
                             subscribe       Reporting
system                                        system

model                                            model
Domain EDA
            integration
                            I’m interested in
                           buy, sell and market
                              status events




Trading    domain events
                              subscribe       Reporting
system                                         system

model v2                                          model
- “So what? I can do that with SOA...”

- “Yes, but can you do THIS?” (drumroll)
Domain EDA
             integration
                                      I’m interested in
                                     buy, sell and market
                                        status events




 Trading    domain events
                                        subscribe       Reporting
 system                                                  system

model v2                                                    model


  Trading            domain events


system NG

  model
Domain EDA
             integration
                               I’m interested in
                              buy, sell and market
                                 status events




 Trading                         subscribe       Reporting
 system                                           system

model v2                                             model


  Trading     domain events


system NG

  model
Example how EDA
     scales
Traditional SOA
scalability issue
      200 tx/s
        Order
      processing
Traditional SOA
scalability issue
      200 tx/s
        Order
      processing

            request/response



       Loyalty
       system
Traditional SOA
scalability issue
      200 tx/s
        Order
      processing

            request/response



       Loyalty
       system

      100 tx/s
SOA: Weakest link dictates the
      peak throughput
       of the system

           100 tx/s
             Order
           processing

                 request/response



            Loyalty
            system

           100 tx/s
EDA: Weakest link dictates the
  sustained throughput
       of the system

           200 tx/s
             Order
           processing

                 event



            Loyalty
            system

           100 tx/s
Implementation notes
    from Unibet
    hans.hall@unibet.com
MQ considerations

• Ordering
• Durability
• Performance
• Once and only once delivery
Our requirements


• 1000 messages / second sustained
• Guaranteed delivery
• Easy to use client
Brokers tested
• Lots of brokers tested
 • ActiveMQ, OpenMQ, HornetQ,
    Websphere, Fiorano, RabbitMQ, QPID
• Second round
 • ActiveMQ, OpenMQ and RabbitMQ
• Finally went for ActiveMQ - fitted our
  requirements/use case the best
Testing brokers

• Killing brokers
• Flow control
• Slow consumers
• Durable / non-durable
• Small configuration change can have huge
  impact on throughput
Payload considerations
The smorgasbord
                                    Schema
     Name            Standardized             Binary   Easy to use   X-platform      Std API
                                    support

     ASN.1              Yes          Yes      Yes         No           Yes            No

      CSV             Partial        No        No         No?          Yes            No

                                                                                    DOM, SAX,
      XML               Yes          Yes       No         Yes          Yes        XQUERY, XPATH


     JSON               Yes          No        No         Yes          Yes            No

Java serialization       No         Partial   Yes         Yes           No            No

    Hessian              No         Partial   Yes         Yes          Yes            No

Protocol Buffers         No          Yes      Yes         Yes          Yes            No

     BSON                No          No       Yes         Yes          Yes            No
Domain events need
           schema support
                                     Schema
      Name            Standardized             Binary   Easy to use   X-platform      Std API
                                     support

     ASN.1                Yes         Yes       Yes        No            Yes           No

       CSV              Partial       No        No         No?           Yes           No

                                                                                     DOM, SAX,
      XML                 Yes         Yes       No         Yes           Yes       XQUERY, XPATH


      JSON                Yes         No        No         Yes           Yes           No

 Java serialization       No         Partial    Yes        Yes           No            No

     Hessian              No         Partial    Yes        Yes           Yes           No

Protocol Buffers          No          Yes       Yes        Yes           Yes           No

      BSON                No          No        Yes        Yes           Yes           No
+ Efficient, x-platform and
           easy to use
                                  Schema
     Name          Standardized             Binary   Easy to use   X-platform      Std API
                                  support




     ASN.1             Yes         Yes       No         No           Yes            No




                                                                                  DOM, SAX,
     XML               Yes         Yes       No         Yes          Yes        XQUERY, XPATH




Protocol Buffers       No          Yes      Yes         Yes          Yes            No
Protocol Buffers
• Flexible, efficient, automated mechanism for
  serializing (binary)
• Schema support (.proto files)
• Language neutral
• Invented and used by Google Open
  Sourced in July 2008
Example
newuserevent.proto:
     option java_package = "com.example.foo";
     message NewUserEvent {
       required string name = 1;
       required int32 id = 2;
       optional string email = 3;

        enum PhoneType {
          MOBILE = 0;
          HOME = 1;
          WORK = 2;
        }

        message PhoneNumber {
          required string number = 1;
          optional PhoneType type = 2 [default = HOME];
        }

        repeated PhoneNumber phone = 4;
    }
Generating Java Source

$ protoc --proto_path=IMPORT_PATH 
         --java_out=DST_DIR 
         path/to/file.proto
IMPORT_PATH specifies a directory in which to look for .proto
files when resolving import directives.

If the DST_DIR ends in .zip or .jar, the compiler will write the
output to a single ZIP-format archive file with the given name.
Builders vs messages
• Messages classes are immutable
• Use builders to construct
     NewUserEvent stefan =
       NewUserEvent.newBuilder()
         .setId(1337)
         .setName("Stefan Norberg")
         .setEmail(“stefan@norberg.org")
         .addPhone(
           NewUserEvent.PhoneNumber.newBuilder()
             .setNumber("+46 70 99 66 547")
             .setType(NewUserEvent.PhoneType.WORK))
         .build();
Evolving messages
• You cannot remove required fields
• New fields that you add should be optional
  or repeated
• New fields should have sensible defaults
• Prefix deprecated non-required fields with
  OBSOLETE_ (convention)
Sample EDA producer
@Autowired
DomainEventPublisher publisher;

NewUserEvent stefan =
  NewUserEvent.newBuilder()
    .setId(1337)
    .setName("Stefan Norberg")
    .setEmail(“stefan@norberg.org")
    .addPhone(
      NewUserEvent.PhoneNumber.newBuilder()
        .setNumber("+46 70 99 66 547")
        .setType(NewUserEvent.PhoneType.WORK))
    .build();

publisher.publish(stefan);
Sample EDA consumer
       public class YourDomainListenerPOJO {
           public void receive(LoginEvent loginEvent) {
             // do something
           }

           @Durable(clientId=”com.example.foo.bar”)
           public void receive(NewUserEvent newUserEvent) {
             // do something
           }
       }


<import resource=”classpath:spring-domain-events.xml />

<bean id=”domainEventListener”
      class=”com.foo.YourDomainListenerPOJO”/>

<domain-events:subscribe id=”eventSubscriber”
                         subscriber=”domainEventListener”/>
What to tell your
   manager
What to tell your
        manager

• SOA+EDA will reduce time-to-market for
  new functionality
• SOA+EDA will enable a layer of high-value
  services that have a visible impact on the
  bottom line of the business
Game changing
  value-add
Complex Event
      Processing (CEP)
• 100% Event-driven
• Receives domain events
• Performs event correlation using a QL
• Fires domain events (“findings”)
CEP Examples
                                                request/response
                                                    “action”


events               Correlation                   events “findings”

                       (CEP)

if there are no Mastercard deposits from France in 5 minutes during
business hours,
send NoDespositsEvent

if there are >30 failed logins using >5 accounts from the same ip
within 2 minutes,
block the ip for 24 hours

if customer with loyalty >= gold and puts goods in shopping cart for
more than €200,
send VIPShoppingEvent

if customer loses €2000 in the casino within 30 minutes and
customer != highroller
send PotentialHighrollerEvent AND grant €200 casino premium
Business Process
    Management (BPM)
• Business control over definition and
  automation of business processes
• SOA services “orchestration”
• Processes can/should be started by domain
  events
BPM example
                                                                                              Customer
                                                                                               System
                           Evaluate
                                        Get Customer        Profit >
                           Highroller
                                             Info           €5000
                             Start




                                           Manual
                                        investigation /
PotentialHighrollerEvent                   decision


                                                          Profit >
                               Stop       decision?                   Set VIP Status   Stop
                                                          €1000



                                                          Manager
                                                                        approved?
                                                          approval



                                                                          Stop
Business Activity
     Monitoring (BAM)
• Aggregation, analysis, and presentation of real
  time information about activities inside
  organizations and involving customers and
  partners
• BAM attempts to do for business processing
  what network management tools do for
  network operations
The real-time business
               eco system
                                          Monitoring
                             events        (BAM)                  events                Great business
 Business Value

                  Correlation                   events               Processes
                    (CEP)                                              (BPM)
                                      request/response

                                                         events
                        events                                             request/response


                   Domain Event Driven                    Service Oriented
                   Architecture (D-EDA)                  Architecture (SOA)
IT enhancements
                                                                                      Great architecture

                                           IT systems
Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

Managing State With JBoss Seam
Managing State With JBoss SeamManaging State With JBoss Seam
Managing State With JBoss Seamguest74ef29
 
Open Standards Enabling Digital Transformation
Open Standards Enabling Digital TransformationOpen Standards Enabling Digital Transformation
Open Standards Enabling Digital TransformationSolace
 
Microservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applicationsMicroservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applicationsStijn Van Den Enden
 
Deep Dive on Case Management in RedHat JBoss BPM Suite 7 - RedHat Summit 2017
Deep Dive on Case Management in RedHat JBoss BPM Suite 7 - RedHat Summit 2017Deep Dive on Case Management in RedHat JBoss BPM Suite 7 - RedHat Summit 2017
Deep Dive on Case Management in RedHat JBoss BPM Suite 7 - RedHat Summit 2017Maciej Swiderski
 
WSO2Con2011: Delivering the Goods? Integrated Order Management & Billing with...
WSO2Con2011: Delivering the Goods? Integrated Order Management & Billing with...WSO2Con2011: Delivering the Goods? Integrated Order Management & Billing with...
WSO2Con2011: Delivering the Goods? Integrated Order Management & Billing with...WSO2
 
Nats meetup sf 20150826
Nats meetup sf   20150826Nats meetup sf   20150826
Nats meetup sf 20150826Apcera
 
Modeling microservices using DDD
Modeling microservices using DDDModeling microservices using DDD
Modeling microservices using DDDMasashi Narumoto
 
Decomposing applications for deployability and scalability #springone2gx #s12gx
Decomposing applications for deployability and scalability #springone2gx #s12gxDecomposing applications for deployability and scalability #springone2gx #s12gx
Decomposing applications for deployability and scalability #springone2gx #s12gxChris Richardson
 
Summer School Delivering On-Demand Shared Middleware Services
Summer School   Delivering On-Demand Shared Middleware ServicesSummer School   Delivering On-Demand Shared Middleware Services
Summer School Delivering On-Demand Shared Middleware ServicesWSO2
 
Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Richard Banks
 
#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architecture#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architectureChris Richardson
 
Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018
Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018
Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018Starling Bank
 
My Presentation On Ajax
My Presentation On AjaxMy Presentation On Ajax
My Presentation On AjaxGhaffar Khan
 

Was ist angesagt? (14)

Managing State With JBoss Seam
Managing State With JBoss SeamManaging State With JBoss Seam
Managing State With JBoss Seam
 
Open Standards Enabling Digital Transformation
Open Standards Enabling Digital TransformationOpen Standards Enabling Digital Transformation
Open Standards Enabling Digital Transformation
 
Microservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applicationsMicroservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applications
 
Deep Dive on Case Management in RedHat JBoss BPM Suite 7 - RedHat Summit 2017
Deep Dive on Case Management in RedHat JBoss BPM Suite 7 - RedHat Summit 2017Deep Dive on Case Management in RedHat JBoss BPM Suite 7 - RedHat Summit 2017
Deep Dive on Case Management in RedHat JBoss BPM Suite 7 - RedHat Summit 2017
 
Micro service architecture
Micro service architectureMicro service architecture
Micro service architecture
 
WSO2Con2011: Delivering the Goods? Integrated Order Management & Billing with...
WSO2Con2011: Delivering the Goods? Integrated Order Management & Billing with...WSO2Con2011: Delivering the Goods? Integrated Order Management & Billing with...
WSO2Con2011: Delivering the Goods? Integrated Order Management & Billing with...
 
Nats meetup sf 20150826
Nats meetup sf   20150826Nats meetup sf   20150826
Nats meetup sf 20150826
 
Modeling microservices using DDD
Modeling microservices using DDDModeling microservices using DDD
Modeling microservices using DDD
 
Decomposing applications for deployability and scalability #springone2gx #s12gx
Decomposing applications for deployability and scalability #springone2gx #s12gxDecomposing applications for deployability and scalability #springone2gx #s12gx
Decomposing applications for deployability and scalability #springone2gx #s12gx
 
Summer School Delivering On-Demand Shared Middleware Services
Summer School   Delivering On-Demand Shared Middleware ServicesSummer School   Delivering On-Demand Shared Middleware Services
Summer School Delivering On-Demand Shared Middleware Services
 
Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016
 
#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architecture#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architecture
 
Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018
Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018
Building a Reliable Cloud Bank in Java | Starling Bank | QCon 2018
 
My Presentation On Ajax
My Presentation On AjaxMy Presentation On Ajax
My Presentation On Ajax
 

Andere mochten auch

program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdfHiroshi Ono
 
Gamecenter概説
Gamecenter概説Gamecenter概説
Gamecenter概説Hiroshi Ono
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdfHiroshi Ono
 
Voltdb - wikipedia
Voltdb - wikipediaVoltdb - wikipedia
Voltdb - wikipediaHiroshi Ono
 
Solving the C20K problem: Raising the bar in PHP Performance and Scalability
Solving the C20K problem: Raising the bar in PHP Performance and ScalabilitySolving the C20K problem: Raising the bar in PHP Performance and Scalability
Solving the C20K problem: Raising the bar in PHP Performance and ScalabilityZendCon
 
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009Hiroshi Ono
 
A Curious Course on Coroutines and Concurrency
A Curious Course on Coroutines and ConcurrencyA Curious Course on Coroutines and Concurrency
A Curious Course on Coroutines and ConcurrencyHiroshi Ono
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfHiroshi Ono
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfHiroshi Ono
 

Andere mochten auch (9)

program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdf
 
Gamecenter概説
Gamecenter概説Gamecenter概説
Gamecenter概説
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdf
 
Voltdb - wikipedia
Voltdb - wikipediaVoltdb - wikipedia
Voltdb - wikipedia
 
Solving the C20K problem: Raising the bar in PHP Performance and Scalability
Solving the C20K problem: Raising the bar in PHP Performance and ScalabilitySolving the C20K problem: Raising the bar in PHP Performance and Scalability
Solving the C20K problem: Raising the bar in PHP Performance and Scalability
 
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009
 
A Curious Course on Coroutines and Concurrency
A Curious Course on Coroutines and ConcurrencyA Curious Course on Coroutines and Concurrency
A Curious Course on Coroutines and Concurrency
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdf
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdf
 

Ähnlich wie EventDrivenArchitecture

BAM CEP / Business Activity Monitoring , Complex Event Processingomplex
BAM CEP / Business Activity Monitoring , Complex Event Processingomplex BAM CEP / Business Activity Monitoring , Complex Event Processingomplex
BAM CEP / Business Activity Monitoring , Complex Event Processingomplex Liviu Claudiu Cismaru
 
Bookstore neagoe george-danut 343 c4
Bookstore   neagoe george-danut 343 c4Bookstore   neagoe george-danut 343 c4
Bookstore neagoe george-danut 343 c4gneagoe
 
A Guide to the SOA Galaxy: Strategy, Design and Best Practices
A Guide to the SOA Galaxy: Strategy, Design and Best PracticesA Guide to the SOA Galaxy: Strategy, Design and Best Practices
A Guide to the SOA Galaxy: Strategy, Design and Best PracticesDmitri Shiryaev
 
5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWS5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWSChristian Beedgen
 
Make Your Business More Flexible with Scalable Business Process Management So...
Make Your Business More Flexible with Scalable Business Process Management So...Make Your Business More Flexible with Scalable Business Process Management So...
Make Your Business More Flexible with Scalable Business Process Management So...Perficient, Inc.
 
Selling Stuff on the Web in Style with Microsoft Commerce Server
Selling Stuff on the Web in Style with Microsoft Commerce ServerSelling Stuff on the Web in Style with Microsoft Commerce Server
Selling Stuff on the Web in Style with Microsoft Commerce Servergoodfriday
 
TH e-GIF on SOA Using Open Enterprise Architecture
TH e-GIF on SOA Using Open Enterprise ArchitectureTH e-GIF on SOA Using Open Enterprise Architecture
TH e-GIF on SOA Using Open Enterprise ArchitectureThanachart Numnonda
 
Integration in Retail - Presentation for 2 ME Retail IT Summit in Dubai
Integration in Retail - Presentation for 2 ME Retail IT Summit in DubaiIntegration in Retail - Presentation for 2 ME Retail IT Summit in Dubai
Integration in Retail - Presentation for 2 ME Retail IT Summit in DubaiDarko Pavic
 
WAS Support & Monitoring Tools
WAS Support & Monitoring ToolsWAS Support & Monitoring Tools
WAS Support & Monitoring ToolsRoyal Cyber Inc.
 
Webcast: Inovis-Dell Case Study (B2B Cloud Integration Platforms)
Webcast: Inovis-Dell Case Study (B2B Cloud Integration Platforms)Webcast: Inovis-Dell Case Study (B2B Cloud Integration Platforms)
Webcast: Inovis-Dell Case Study (B2B Cloud Integration Platforms)Doug Kern
 
21st Century Service Oriented Architecture
21st Century Service Oriented Architecture21st Century Service Oriented Architecture
21st Century Service Oriented ArchitectureBob Rhubart
 
Sybase Complex Event Processing
Sybase Complex Event ProcessingSybase Complex Event Processing
Sybase Complex Event ProcessingSybase Türkiye
 
Data & analytics challenges in a microservice architecture
Data & analytics challenges in a microservice architectureData & analytics challenges in a microservice architecture
Data & analytics challenges in a microservice architectureNiels Naglé
 
Composite Applications with SOA, BPEL and Java EE
Composite  Applications with SOA, BPEL and Java EEComposite  Applications with SOA, BPEL and Java EE
Composite Applications with SOA, BPEL and Java EEDmitri Shiryaev
 
Vortrag OnCommerce zur ITmitte.de Ring Vorlesung, Master Informatik, Universi...
Vortrag OnCommerce zur ITmitte.de Ring Vorlesung, Master Informatik, Universi...Vortrag OnCommerce zur ITmitte.de Ring Vorlesung, Master Informatik, Universi...
Vortrag OnCommerce zur ITmitte.de Ring Vorlesung, Master Informatik, Universi...Community ITmitte.de
 

Ähnlich wie EventDrivenArchitecture (20)

BAM CEP / Business Activity Monitoring , Complex Event Processingomplex
BAM CEP / Business Activity Monitoring , Complex Event Processingomplex BAM CEP / Business Activity Monitoring , Complex Event Processingomplex
BAM CEP / Business Activity Monitoring , Complex Event Processingomplex
 
Bookstore neagoe george-danut 343 c4
Bookstore   neagoe george-danut 343 c4Bookstore   neagoe george-danut 343 c4
Bookstore neagoe george-danut 343 c4
 
A Guide to the SOA Galaxy: Strategy, Design and Best Practices
A Guide to the SOA Galaxy: Strategy, Design and Best PracticesA Guide to the SOA Galaxy: Strategy, Design and Best Practices
A Guide to the SOA Galaxy: Strategy, Design and Best Practices
 
5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWS5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWS
 
Make Your Business More Flexible with Scalable Business Process Management So...
Make Your Business More Flexible with Scalable Business Process Management So...Make Your Business More Flexible with Scalable Business Process Management So...
Make Your Business More Flexible with Scalable Business Process Management So...
 
Selling Stuff on the Web in Style with Microsoft Commerce Server
Selling Stuff on the Web in Style with Microsoft Commerce ServerSelling Stuff on the Web in Style with Microsoft Commerce Server
Selling Stuff on the Web in Style with Microsoft Commerce Server
 
TH e-GIF on SOA Using Open Enterprise Architecture
TH e-GIF on SOA Using Open Enterprise ArchitectureTH e-GIF on SOA Using Open Enterprise Architecture
TH e-GIF on SOA Using Open Enterprise Architecture
 
Ecom
EcomEcom
Ecom
 
Integration in Retail - Presentation for 2 ME Retail IT Summit in Dubai
Integration in Retail - Presentation for 2 ME Retail IT Summit in DubaiIntegration in Retail - Presentation for 2 ME Retail IT Summit in Dubai
Integration in Retail - Presentation for 2 ME Retail IT Summit in Dubai
 
Enterprise Enabler- Presentation
Enterprise Enabler- PresentationEnterprise Enabler- Presentation
Enterprise Enabler- Presentation
 
WAS Support & Monitoring Tools
WAS Support & Monitoring ToolsWAS Support & Monitoring Tools
WAS Support & Monitoring Tools
 
Webcast: Inovis-Dell Case Study (B2B Cloud Integration Platforms)
Webcast: Inovis-Dell Case Study (B2B Cloud Integration Platforms)Webcast: Inovis-Dell Case Study (B2B Cloud Integration Platforms)
Webcast: Inovis-Dell Case Study (B2B Cloud Integration Platforms)
 
21st Century Service Oriented Architecture
21st Century Service Oriented Architecture21st Century Service Oriented Architecture
21st Century Service Oriented Architecture
 
Sybase Complex Event Processing
Sybase Complex Event ProcessingSybase Complex Event Processing
Sybase Complex Event Processing
 
Data & analytics challenges in a microservice architecture
Data & analytics challenges in a microservice architectureData & analytics challenges in a microservice architecture
Data & analytics challenges in a microservice architecture
 
Composite Applications with SOA, BPEL and Java EE
Composite  Applications with SOA, BPEL and Java EEComposite  Applications with SOA, BPEL and Java EE
Composite Applications with SOA, BPEL and Java EE
 
Edge-to-Enterprise Real-Time SOA
Edge-to-Enterprise Real-Time SOAEdge-to-Enterprise Real-Time SOA
Edge-to-Enterprise Real-Time SOA
 
Websoftex profile
Websoftex profileWebsoftex profile
Websoftex profile
 
Vortrag OnCommerce zur ITmitte.de Ring Vorlesung, Master Informatik, Universi...
Vortrag OnCommerce zur ITmitte.de Ring Vorlesung, Master Informatik, Universi...Vortrag OnCommerce zur ITmitte.de Ring Vorlesung, Master Informatik, Universi...
Vortrag OnCommerce zur ITmitte.de Ring Vorlesung, Master Informatik, Universi...
 
E commerce
E commerceE commerce
E commerce
 

Mehr von Hiroshi Ono

pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdfHiroshi Ono
 
BOF1-Scala02.pdf
BOF1-Scala02.pdfBOF1-Scala02.pdf
BOF1-Scala02.pdfHiroshi Ono
 
TwitterOct2008.pdf
TwitterOct2008.pdfTwitterOct2008.pdf
TwitterOct2008.pdfHiroshi Ono
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfHiroshi Ono
 
SACSIS2009_TCP.pdf
SACSIS2009_TCP.pdfSACSIS2009_TCP.pdf
SACSIS2009_TCP.pdfHiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfHiroshi Ono
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdfHiroshi Ono
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdfHiroshi Ono
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfHiroshi Ono
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdfHiroshi Ono
 
BOF1-Scala02.pdf
BOF1-Scala02.pdfBOF1-Scala02.pdf
BOF1-Scala02.pdfHiroshi Ono
 
TwitterOct2008.pdf
TwitterOct2008.pdfTwitterOct2008.pdf
TwitterOct2008.pdfHiroshi Ono
 
pamphlet_honsyou.pdf
pamphlet_honsyou.pdfpamphlet_honsyou.pdf
pamphlet_honsyou.pdfHiroshi Ono
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdfHiroshi Ono
 

Mehr von Hiroshi Ono (20)

pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdf
 
BOF1-Scala02.pdf
BOF1-Scala02.pdfBOF1-Scala02.pdf
BOF1-Scala02.pdf
 
TwitterOct2008.pdf
TwitterOct2008.pdfTwitterOct2008.pdf
TwitterOct2008.pdf
 
camel-scala.pdf
camel-scala.pdfcamel-scala.pdf
camel-scala.pdf
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
 
SACSIS2009_TCP.pdf
SACSIS2009_TCP.pdfSACSIS2009_TCP.pdf
SACSIS2009_TCP.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdf
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdf
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdf
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdf
 
BOF1-Scala02.pdf
BOF1-Scala02.pdfBOF1-Scala02.pdf
BOF1-Scala02.pdf
 
TwitterOct2008.pdf
TwitterOct2008.pdfTwitterOct2008.pdf
TwitterOct2008.pdf
 
pamphlet_honsyou.pdf
pamphlet_honsyou.pdfpamphlet_honsyou.pdf
pamphlet_honsyou.pdf
 
camel-scala.pdf
camel-scala.pdfcamel-scala.pdf
camel-scala.pdf
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdf
 

EventDrivenArchitecture

  • 1. Domain Event Driven Architecture Stefan Norberg, Head of Architecture at Unibet.com twitter: @stnor email: stefan.norberg@unibet.com blog: http://stnor.wordpress.com
  • 2. @stnor • 17 years as an IT professional • Has worked with most aspects of IT • Operations & infrastructure • IT security • Systems development • Software architecture • Enterprise architecture • Head of Architecture at Unibet
  • 3. Agenda • Basics and EDA intro • The SOA problem • How Domain EDA completes SOA • Implementation notes from Unibet • What to tell your manager
  • 4. The three styles of interaction Type of interaction Initiator Participants Time-driven Time The specified systems Request-driven Client Client and Server Event-driven Event Open-ended
  • 5. Time driven Fruit system run inventory check every 60 mins
  • 6. Request driven Fruit Tarzan system Me want three bananas!
  • 7. Event driven Fruit system “Tarzan took three bananas” “Fruit system is low on bananas”
  • 8. 5 Principles of EDA • “Real-time” events as they happen at the producer • Push notifications • One-way “fire-and-forget” • Immediate action at the consumers • Informational (“someone logged in”), not commands (“audit this”)
  • 9. Typical EDA architecture Event system system system Producers Event Event Bus Transport Event system system system Consumers
  • 10. Main benefits of EDA • Supports the business demands for better service (no batch, less waiting) • No point-to-point integrations (fire & forget) • Enables high performance, highly scalable systems
  • 11. The birth of a system Inventory Customer Shop
  • 12. The monolith Shop Payment Customer Newsletter Reporting Inventory
  • 13. SOA architecture #1 Divide the problem domains into separate systems Shop Payment Newsletter Customer Inventory Reporting DB
  • 14. SOA architecture #1 A lot of point to point integration... Shop Payment Newsletter Customer Inventory Reporting DB
  • 15. SOA architecture #2 Shop Payment Newsletter Monolith? Service Bus Customer Inventory Reporting DB
  • 16. Let’s add fraud checks fraud Shop Payment Newsletter fraud Service Bus Customer Inventory Reporting DB
  • 17. Let’s add a loyalty system fraud Shop Payment Newsletter fraud Service Bus Customer Loyalty Inventory Reporting DB
  • 18. Integration ripple effect fraud Shop Payment Newsletter fraud Service Bus Customer Loyalty Inventory Reporting DB
  • 19. Problem summary • SOA is all about dividing domain logic into separate systems and exposing it as services • Some domain logic will, by its very nature, be spread out over many systems • The result is domain pollution and bloat in the SOA systems
  • 20. “It's really become clear to me in the last couple of years that we need a new building block and that is the Domain Events” -- Eric Evans, QCon 2009
  • 21. Domain Events and SOA • A Domain Event is something that happened that the domain expert cares about • A SOA system’s primary focus should be on the domain and domain logic
  • 22. Domain EDA • By exposing relevant Domain Events on a shared event bus we can isolate cross cutting functions to separate systems
  • 23. Domain EDA + SOA Reporting Loyalty Shop Payment Newsletter Event Bus Inventory Customer
  • 24. Domain EDA + SOA Reporting Loyalty Shop Payment Newsletter Event Bus BAM Inventory Customer Fraud
  • 26. Example how Domain EDA decouples
  • 27. Coupled integration Trading Reporting system system model model
  • 28. Coupled integration Trading Reporting system system model v2 model
  • 29. Domain EDA integration I’m interested in buy, sell and market status events Trading domain events subscribe Reporting system system model model
  • 30. Domain EDA integration I’m interested in buy, sell and market status events Trading domain events subscribe Reporting system system model v2 model
  • 31. - “So what? I can do that with SOA...” - “Yes, but can you do THIS?” (drumroll)
  • 32. Domain EDA integration I’m interested in buy, sell and market status events Trading domain events subscribe Reporting system system model v2 model Trading domain events system NG model
  • 33. Domain EDA integration I’m interested in buy, sell and market status events Trading subscribe Reporting system system model v2 model Trading domain events system NG model
  • 34. Example how EDA scales
  • 35. Traditional SOA scalability issue 200 tx/s Order processing
  • 36. Traditional SOA scalability issue 200 tx/s Order processing request/response Loyalty system
  • 37. Traditional SOA scalability issue 200 tx/s Order processing request/response Loyalty system 100 tx/s
  • 38. SOA: Weakest link dictates the peak throughput of the system 100 tx/s Order processing request/response Loyalty system 100 tx/s
  • 39. EDA: Weakest link dictates the sustained throughput of the system 200 tx/s Order processing event Loyalty system 100 tx/s
  • 40. Implementation notes from Unibet hans.hall@unibet.com
  • 41. MQ considerations • Ordering • Durability • Performance • Once and only once delivery
  • 42. Our requirements • 1000 messages / second sustained • Guaranteed delivery • Easy to use client
  • 43. Brokers tested • Lots of brokers tested • ActiveMQ, OpenMQ, HornetQ, Websphere, Fiorano, RabbitMQ, QPID • Second round • ActiveMQ, OpenMQ and RabbitMQ • Finally went for ActiveMQ - fitted our requirements/use case the best
  • 44. Testing brokers • Killing brokers • Flow control • Slow consumers • Durable / non-durable • Small configuration change can have huge impact on throughput
  • 46. The smorgasbord Schema Name Standardized Binary Easy to use X-platform Std API support ASN.1 Yes Yes Yes No Yes No CSV Partial No No No? Yes No DOM, SAX, XML Yes Yes No Yes Yes XQUERY, XPATH JSON Yes No No Yes Yes No Java serialization No Partial Yes Yes No No Hessian No Partial Yes Yes Yes No Protocol Buffers No Yes Yes Yes Yes No BSON No No Yes Yes Yes No
  • 47. Domain events need schema support Schema Name Standardized Binary Easy to use X-platform Std API support ASN.1 Yes Yes Yes No Yes No CSV Partial No No No? Yes No DOM, SAX, XML Yes Yes No Yes Yes XQUERY, XPATH JSON Yes No No Yes Yes No Java serialization No Partial Yes Yes No No Hessian No Partial Yes Yes Yes No Protocol Buffers No Yes Yes Yes Yes No BSON No No Yes Yes Yes No
  • 48. + Efficient, x-platform and easy to use Schema Name Standardized Binary Easy to use X-platform Std API support ASN.1 Yes Yes No No Yes No DOM, SAX, XML Yes Yes No Yes Yes XQUERY, XPATH Protocol Buffers No Yes Yes Yes Yes No
  • 49. Protocol Buffers • Flexible, efficient, automated mechanism for serializing (binary) • Schema support (.proto files) • Language neutral • Invented and used by Google Open Sourced in July 2008
  • 50. Example newuserevent.proto: option java_package = "com.example.foo"; message NewUserEvent { required string name = 1; required int32 id = 2; optional string email = 3; enum PhoneType { MOBILE = 0; HOME = 1; WORK = 2; } message PhoneNumber { required string number = 1; optional PhoneType type = 2 [default = HOME]; } repeated PhoneNumber phone = 4; }
  • 51. Generating Java Source $ protoc --proto_path=IMPORT_PATH --java_out=DST_DIR path/to/file.proto IMPORT_PATH specifies a directory in which to look for .proto files when resolving import directives. If the DST_DIR ends in .zip or .jar, the compiler will write the output to a single ZIP-format archive file with the given name.
  • 52. Builders vs messages • Messages classes are immutable • Use builders to construct NewUserEvent stefan = NewUserEvent.newBuilder() .setId(1337) .setName("Stefan Norberg") .setEmail(“stefan@norberg.org") .addPhone( NewUserEvent.PhoneNumber.newBuilder() .setNumber("+46 70 99 66 547") .setType(NewUserEvent.PhoneType.WORK)) .build();
  • 53. Evolving messages • You cannot remove required fields • New fields that you add should be optional or repeated • New fields should have sensible defaults • Prefix deprecated non-required fields with OBSOLETE_ (convention)
  • 54. Sample EDA producer @Autowired DomainEventPublisher publisher; NewUserEvent stefan = NewUserEvent.newBuilder() .setId(1337) .setName("Stefan Norberg") .setEmail(“stefan@norberg.org") .addPhone( NewUserEvent.PhoneNumber.newBuilder() .setNumber("+46 70 99 66 547") .setType(NewUserEvent.PhoneType.WORK)) .build(); publisher.publish(stefan);
  • 55. Sample EDA consumer public class YourDomainListenerPOJO { public void receive(LoginEvent loginEvent) { // do something } @Durable(clientId=”com.example.foo.bar”) public void receive(NewUserEvent newUserEvent) { // do something } } <import resource=”classpath:spring-domain-events.xml /> <bean id=”domainEventListener” class=”com.foo.YourDomainListenerPOJO”/> <domain-events:subscribe id=”eventSubscriber” subscriber=”domainEventListener”/>
  • 56. What to tell your manager
  • 57. What to tell your manager • SOA+EDA will reduce time-to-market for new functionality • SOA+EDA will enable a layer of high-value services that have a visible impact on the bottom line of the business
  • 58. Game changing value-add
  • 59. Complex Event Processing (CEP) • 100% Event-driven • Receives domain events • Performs event correlation using a QL • Fires domain events (“findings”)
  • 60. CEP Examples request/response “action” events Correlation events “findings” (CEP) if there are no Mastercard deposits from France in 5 minutes during business hours, send NoDespositsEvent if there are >30 failed logins using >5 accounts from the same ip within 2 minutes, block the ip for 24 hours if customer with loyalty >= gold and puts goods in shopping cart for more than €200, send VIPShoppingEvent if customer loses €2000 in the casino within 30 minutes and customer != highroller send PotentialHighrollerEvent AND grant €200 casino premium
  • 61. Business Process Management (BPM) • Business control over definition and automation of business processes • SOA services “orchestration” • Processes can/should be started by domain events
  • 62. BPM example Customer System Evaluate Get Customer Profit > Highroller Info €5000 Start Manual investigation / PotentialHighrollerEvent decision Profit > Stop decision? Set VIP Status Stop €1000 Manager approved? approval Stop
  • 63. Business Activity Monitoring (BAM) • Aggregation, analysis, and presentation of real time information about activities inside organizations and involving customers and partners • BAM attempts to do for business processing what network management tools do for network operations
  • 64.
  • 65. The real-time business eco system Monitoring events (BAM) events Great business Business Value Correlation events Processes (CEP) (BPM) request/response events events request/response Domain Event Driven Service Oriented Architecture (D-EDA) Architecture (SOA) IT enhancements Great architecture IT systems