Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Event-driven architecture

Evandro Mohr
September 26, 2019

Event-driven architecture

Palestra apresentada no PHP community summit 2019 em SP

Evandro Mohr

September 26, 2019
Tweet

More Decks by Evandro Mohr

Other Decks in Programming

Transcript

  1. 1
    EVENT-DRIVEN
    ARCHITECTURE

    View full-size slide

  2. Evandro Mohr
    Developer
    Pilot
    Professor
    Photographer

    View full-size slide

  3. 1.
    The quest for
    scalability
    3
    A tale of a company...

    View full-size slide


  4. 4
    Scalability is the property of a
    system to handle a growing amount
    of work by adding resources to the
    system.

    View full-size slide

  5. 5
    Scalability Development
    ● New features
    ● Continuous Deployment
    ● New team members
    ● New technologies
    Software
    ● Usage
    ● Concurrency
    ● Stored data
    ● Availability

    View full-size slide

  6. Scalability
    cube
    6
    y-axis
    x-axis
    z-axis

    View full-size slide

  7. Monolithic
    Application
    7
    Monolithic Application Data Storage
    Database

    View full-size slide

  8. Monolithic
    Application
    8
    Shop Rich UI
    Shop UI UI Logic
    GUI
    Data Storage
    Shared database
    Shop Backend Application
    Search Facade
    Order DAO
    Customer DAO
    Order Facade
    Business Data
    Product DAO
    GUI Data
    Customer UI Customer BO
    Customer Fat Client App

    View full-size slide

  9. Business
    Entity
    Service
    Customer BAS
    SOAP
    Payment BAS
    SOAP
    Product BAS
    SOAP
    Order BAS
    SOAP
    Business
    Activity
    Service
    Custer BAS
    SOAP
    Search BAS
    SOAP
    Order BAS
    SOAP
    SOA
    Approach
    9
    Shop Rich UI
    Shop UI UI Logic
    GUI
    Shop UI App
    Shop UI UI Logic
    GUI
    Data
    Storage
    Customer
    Database
    Order and
    Product DB

    View full-size slide

  10. Virtualized
    SOA
    Approach
    10
    Shop UI
    App
    Shop
    UI
    UI
    Logic
    GUI
    Shop Web
    App
    Shop
    UI
    UI
    Logic
    GUI
    The raise of the
    Enterprise
    Service Bus
    (ESB)
    Service Virtualization Layer
    SOAP
    Custer
    BAS
    SOAP
    Search
    BAS
    SOAP
    Order
    BAS
    S
    O
    A
    P Customer
    BAS
    Business
    Activity
    Service
    S
    O
    A
    P Payment
    BES
    S
    O
    A
    P Product
    BES
    S
    O
    A
    P Order BES
    Business
    Entity Service
    Data
    Storage
    Order and
    Product DB
    Customer
    Database
    Service Bus

    View full-size slide

  11. Orchestrated
    &
    Virtualized
    SOA
    Approach
    11
    Service Bus
    Shop UI
    App
    Shop
    UI
    UI
    Logic
    GUI
    Shop Web
    App
    Shop
    UI
    UI
    Logic
    GUI
    The raise of
    orchestration
    engines
    (BPEL &
    BPMN)
    Service Virtualization Layer
    SOAP
    Custer
    BAS
    SOAP
    Search
    BAS
    SOAP
    Order
    BAS
    S
    O
    A
    P Customer
    BAS
    Business
    Activity
    Service
    S
    O
    A
    P Payment
    BES
    S
    O
    A
    P Product
    BES
    S
    O
    A
    P Order BES
    Business
    Entity Service
    Data
    Storage
    Order and
    Product DB
    Customer
    Database
    Orchestration

    View full-size slide

  12. 2.
    Microservices
    12
    The silver bullet...

    View full-size slide

  13. Customer Logic Customer
    Customer API
    REST
    Order Logic Order
    Order API
    REST
    Order Microservice
    Stock Logic Stock
    Stock API
    REST
    Stock Microservice
    Product Logic Product
    Product API
    REST
    Product Microservice
    Microservices
    Approach
    13
    Shop Web App
    GUI
    UI Logic
    Shop UI

    View full-size slide

  14. Microservices
    &
    API Gateway
    Approach
    14
    Shop Web App
    GUI
    UI Logic
    Shop UI
    Customer Logic Customer
    Customer API
    REST
    Order Logic Order
    Order API
    REST
    Order Microservice
    Stock Logic Stock
    Stock API
    REST
    Stock Microservice
    Product Logic Product
    Product API
    REST
    Product Microservice
    14

    View full-size slide

  15. Microservices
    &
    API Gateway
    Approach
    15

    View full-size slide

  16. EVENT SOURCING
    16

    View full-size slide


  17. 17
    Event Sourcing ensures that all changes to
    application state are stored as a sequence of
    events. Not just can we query these events, we can
    also use the event log to reconstruct past states,
    and as a foundation to automatically adjust the
    state to cope with retroactive changes.
    - Martin Fowler

    View full-size slide

  18. Log-
    Structured
    Approach
    18

    View full-size slide

  19. Event-Driven
    Architecture
    21
    ▪ 100% accurate audit logging
    ▪ Easy temporal queries
    ▪ Asynchronous communication
    ▪ Data Consistency
    ▪ Data recovery
    ▪ Horizontal scaling
    ▪ Loosely coupled services
    ▪ Act as Message Broker
    ▪ Idempotence

    View full-size slide

  20. Event-Driven
    Architecture
    22

    View full-size slide

  21. Microservices
    &
    Event
    Sourcing
    Approach
    23

    View full-size slide

  22. Event
    Sourcing
    &
    Data streams
    Approach
    24

    View full-size slide

  23. Integrate
    Legacy
    Applications
    25

    View full-size slide

  24. A better
    Microservices
    Approach
    26

    View full-size slide

  25. Questions?
    27

    View full-size slide

  26. References
    28
    ● https://guidoschmutz.wordpress.com/
    ● http://microservices.io
    ● https://kafka.apache.org/
    ● https://martinfowler.com/eaaDev/EventSourcing.html
    https://www.confluent.io/blog/data-dichotomy-rethinking-the-way-we
    -treat-data-and-services/
    ● https://engineering.linkedin.com/distributed-systems/log-what-every-s
    oftware-engineer-should-know-about-real-time-datas-unifying
    ● https://medium.com/@hugo.oliveira.rocha/what-they-dont-tell-you-abo
    ut-event-sourcing-6afc23c69e9a

    View full-size slide

  27. Thank you very much
    for your time
    29

    View full-size slide