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 full-size slide

  2. Answers have
    changed

    View full-size 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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  7. Durable Entities
    Addressable
    Always
    there
    State
    Execute
    serially

    View full-size slide

  8. Glue code
    State

    View full-size slide

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

    View full-size slide

  10. Limitations?

    View full-size slide

  11. 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 full-size slide

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

    View full-size slide

  13. 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 full-size slide

  14. Limitations?

    View full-size slide

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

    View full-size slide

  16. 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 full-size slide

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

    View full-size slide