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

When Stateful Serverless met Planet-scale Event-sourcing

When Stateful Serverless met Planet-scale Event-sourcing

You are convinced your business requires Event-Sourcing, due to strict audit log requirements, traceability, easy anomaly & fraud detection, and who doesn't like time-traveling queries on their data after all. In today's world where everything is in the Cloud, You also want to utilize the true power of Cloud-Native components in Azure and design a highly scalable, secure and cost-effective solution.

Muhammad Sajid

February 21, 2020
Tweet

More Decks by Muhammad Sajid

Other Decks in Programming

Transcript

  1. When Stateful Serverless met
    Planet-scale Event sourcing
    Based on true “Events”
    +

    View Slide

  2. Answers have
    changed

    View Slide

  3. Muhammad Sajid
    Cloud Solutions Architect with a passion for
    designing and developing cloud-native solutions.
    Interested in DDD, Distributed Event-Driven
    systems, BIG data, and IoT.
    @sajid_nazeer
    www.linkedin.com/in/musa

    View Slide

  4. View Slide

  5. Event sourcing is an approach
    in which changes to application
    state are saved as stream of
    events.

    View Slide

  6. View Slide

  7. ● A complete log of changes
    ● Traceability
    ● Death of cannot reproduce
    ● Scalability (with CQRS)

    View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. View Slide

  12. Entities are tiny services that
    communicate via messages and
    can have some state.

    View Slide

  13. View Slide

  14. View Slide

  15. View Slide

  16. View Slide

  17. Durable Entities
    Addressable
    Always
    there
    State
    Execute
    serially

    View Slide

  18. Glue code
    State

    View Slide

  19. GET http(s):///runtime/webhooks/durabletask/entities/Toggle/1
    POST http(s):///runtime/webhooks/durabletask/entities/Toggle/1

    View Slide

  20. Limitations?

    View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. Entity-Entity
    communication
    happens via
    Signaling
    Beware of State
    mutation gotcha
    Not ideal for
    applications that
    require strict
    latency
    Request/
    Response
    pattern is only
    possible via
    Orchestrations

    View Slide

  25. What is a
    Transactional
    Batch?
    Transactional Batch
    describes a group of
    operations that need
    to either succeed or
    fail as a batch

    View Slide

  26. View Slide

  27. View Slide

  28. View Slide

  29. If you talk to a man in a
    language he understands, that
    goes to his head.
    If you talk to him in his
    language, that goes to his heart
    - Nelson Mandela

    View Slide

  30. Limitations?

    View Slide

  31. Maximum
    operations per
    batch are 100
    Maximum
    payload size is
    2 MB
    Maximum
    Execution time is
    5 Seconds
    No Server-side
    Id generation

    View Slide

  32. Demo

    View Slide

  33. Takeaways
    ● Choose right partition key
    ● Beware of limitations of both Durable Entities and
    Transactional batch.
    ● Don’t settle for the right solutions . Find new ones, and
    keep learning.
    ● https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-fun
    ctions-entities?tabs=csharp
    ● https://devblogs.microsoft.com/cosmosdb/introducing-transactionalbatch-in-
    the-net-sdk/

    View Slide

  34. Questions?

    View Slide

  35. @sajid_nazeer
    www.linkedin.com/in/musa
    Molte grazie

    View Slide