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 Slide

  2. Code is easy,
    state is hard

    View Slide

  3. POJOs as an
    (Anemic) Domain Model

    View Slide

  4. ‘Traditional’ application design

    View Slide

  5. Applying Domain Driven Design

    View Slide

  6. Persistent Data

    View Slide

  7. Strategy: One Database per Microservice

    View Slide

  8. Virtualization: where physical separation is hard

    View Slide

  9. Volatile data: caching and sharing state

    View Slide

  10. Reducing latency via caching

    View Slide

  11. Sharing state - replication and partitioning

    View Slide

  12. Propagating state change:
    Event Sourcing & CDC

    View Slide

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

    View Slide

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

    View Slide

  15. Change Data Capture

    View Slide

  16. CQS
    (Command-Query Separation)

    View Slide

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

    View Slide

  18. CQRS
    (Command Query
    Responsibility Segregation)

    View Slide

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

    View Slide

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

    View Slide

  21. CQRS & Event Sourcing

    View Slide

  22. Why CQRS?

    View Slide

  23. Performance

    View Slide

  24. Distribution
    Availability
    Integration
    Analytics

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  28. Different choices of
    technology depending on the
    requirements

    View Slide

  29. Latency
    Size
    Staleness
    Ownership
    Security
    Type?

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide