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

Data Strategies for Microservice Architectures

Data Strategies for Microservice Architectures

[ Presented together with Edson Yanaga at Microservices Day Atlanta, January 23, 2018
https://www.redhat.com/en/events/red-hat-microservices-day-atlanta#event-tab-1 ]

Marius Bogoevici

January 23, 2018
Tweet

More Decks by Marius Bogoevici

Other Decks in Programming

Transcript

  1. Data Strategies for Microservice
    Architectures
    Edson Yanaga
    Director of Developer Experience
    @yanaga
    Marius Bogoevici
    Chief Architect, Data Streaming
    @mariusbogoevici

    View full-size slide

  2. Code is easy,
    state is hard

    View full-size slide

  3. POJOs as an
    (Anemic) Domain Model

    View full-size slide

  4. ‘Traditional’ application design

    View full-size slide

  5. Applying Domain Driven Design

    View full-size slide

  6. Persistent Data

    View full-size slide

  7. Strategy: One Database per Microservice

    View full-size slide

  8. Virtualization: where physical separation is hard

    View full-size slide

  9. Volatile data: caching and sharing state

    View full-size slide

  10. Reducing latency via caching

    View full-size slide

  11. Sharing state - replication and partitioning

    View full-size slide

  12. Propagating state change:
    Event Sourcing & CDC

    View full-size slide

  13. Communication: synchronous/asynchronous
    1: ship
    2: update state
    3: update state update state update state
    OrderCreated

    View full-size slide

  14. Event Sourcing
    OrderCreated
    Id: 1
    OrderUpdated
    Id: 1
    OrderCreated
    Id: 2

    View full-size slide

  15. Change Data Capture

    View full-size slide

  16. CQS
    (Command-Query Separation)

    View full-size slide

  17. “Asking a question should not
    change the answer”
    (Bertrand Meyer)

    View full-size slide

  18. CQRS
    (Command Query
    Responsibility Segregation)

    View full-size slide

  19. Join developers.redhat.com
    19
    CQRS (Command Query Responsibility Segregation)

    View full-size slide

  20. Join developers.redhat.com
    2
    0
    CQRS with separate data stores

    View full-size slide

  21. CQRS & Event Sourcing

    View full-size slide

  22. Distribution
    Availability
    Integration
    Analytics

    View full-size slide

  23. Join developers.redhat.com
    2
    5
    Canonical Source of Information
    (Write Data Store)

    View full-size slide

  24. Join developers.redhat.com
    26
    Canonical Source of Information
    (Write Data Store)
    Read Data Store Read Data Store

    View full-size slide

  25. Join developers.redhat.com
    27
    Canonical Source of Information
    (Write Data Store)
    Read Data Store Read Data Store
    Events Events

    View full-size slide

  26. Different choices of
    technology depending on the
    requirements

    View full-size slide

  27. Latency
    Size
    Staleness
    Ownership
    Security
    Type?

    View full-size slide

  28. Join developers.redhat.com
    30
    http://infinispan.org/
    In-memory Data Grids

    View full-size slide

  29. Join developers.redhat.com
    31
    http://teiid.jboss.org/
    Data Virtualization

    View full-size slide

  30. Join developers.redhat.com
    32
    http://debezium.io/
    Change Data Capture

    View full-size slide

  31. Join
    developers.redhat.com
    Feedback welcome!
    @mariusbogoevici
    @yanaga

    View full-size slide

  32. plus.google.com/+RedHat
    linkedin.com/company/red-hat
    youtube.com/user/RedHatVideos
    facebook.com/redhatinc
    twitter.com/RedHatNews
    Thank you!

    View full-size slide