O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Take your Azure Functions to the next level with Durable Functions - Serverless Computing London

351 visualizações

Publicada em

Slides of my presentation for Serverless Computing London at 13 Nov 2018.

Source code for the demos is located in this repo: https://github.com/marcduiker/demos-azure-durable-functions

Publicada em: Tecnologia
  • Entre para ver os comentários

  • Seja a primeira pessoa a gostar disto

Take your Azure Functions to the next level with Durable Functions - Serverless Computing London

  1. 1. Marc Duiker Lead Azure Consultant @ Xpirit
  2. 2. Marc Duiker Durable Functions
  3. 3. Marc Duiker Durable Functions
  4. 4. Marc Duiker Durable Functions CC BY-SA 3.0 Olga Tarkovskiy
  5. 5. Marc Duiker Durable Functions
  6. 6. Marc Duiker Durable Functions
  7. 7. Marc Duiker Durable Functions Multiple Functions & Control Flow
  8. 8. Marc Duiker Durable Functions
  9. 9. Marc Duiker Durable Functions
  10. 10. Marc Duiker Durable Functions
  11. 11. Marc Duiker Durable Functions
  12. 12. Marc Duiker Durable Functions
  13. 13. Marc Duiker Durable Functions
  14. 14. Marc Duiker Durable Functions
  15. 15. Marc Duiker Durable Functions Durable Functions is based on
  16. 16. Marc Duiker Durable Functions Function Roles
  17. 17. Marc Duiker Durable Functions Invocations, Checkpoints & Replay
  18. 18. Marc Duiker Durable Functions Storage Types used by Durable Functions
  19. 19. Marc Duiker Durable Functions State is Persisted in Table Storage
  20. 20. Marc Duiker Durable Functions New Trigger Bindings [OrchestrationClient] DurableOrchestrationClient(Base) Function Role: Orchestration Client (Starter Function)
  21. 21. Marc Duiker Durable Functions DurableOrchestrationClient
  22. 22. Marc Duiker Durable Functions New Trigger Bindings [OrchestrationTrigger] DurableOrchestrationContext(Base) Function Role: Orchestration Function
  23. 23. Marc Duiker Durable Functions DurableOrchestrationContext
  24. 24. Marc Duiker Durable Functions New Trigger Bindings [ActivityTrigger] DurableActivityContext Function Role: Activity Function
  25. 25. Marc Duiker Durable Functions DurableActivityContext
  26. 26. Marc Duiker Durable Functions
  27. 27. Marc Duiker Durable Functions • Visual Studio 2017 15.7+ • Azure Workload - Extension: Azure Functions & Web Jobs Tools - Azure Storage Emulator - Microsoft.Azure.Webjobs.Extensions.DurableTask Local development with VS2017
  28. 28. Marc Duiker Durable Functions Hello {name} Demo! HttpStart HelloName {name} HelloNameActivity {name}
  29. 29. Marc Duiker Durable Functions
  30. 30. Marc Duiker Durable Functions Function chaining
  31. 31. Marc Duiker Durable Functions Demo: Function Chaining Find a Star Wars character and their home planet. https://swapi.co/
  32. 32. Marc Duiker Durable Functions Demo: Function Chaining HttpStart GetPlanetGetCharacterInfo SearchCharacter
  33. 33. Marc Duiker Durable Functions
  34. 34. Marc Duiker Durable Functions Fan-out/fan-in FA1 returns a collection of items FA2 is called for each of the items from FA1
  35. 35. Marc Duiker Durable Functions Demo: Fan-out/Fan-in Find a Star Wars planet and their residents. https://swapi.co/
  36. 36. Marc Duiker Durable Functions Demo: Fan-out/Fan-in HttpStart GetCharacterGetPlanetResidents SearchPlanet
  37. 37. Marc Duiker Durable Functions
  38. 38. Marc Duiker Durable Functions Unit Testing Demo Testing the GetPlanetResidents orchestration using: • xUnit • Moq • AutoFixture • FluentAssertions
  39. 39. Marc Duiker Durable Functions Unit Testing • Use the context base classes. • Use simple or complex (serializable) types with [ActivityTrigger] for the activity input. • Because DurableActivityContext can’t be instantiated/mocked due to internal constructor .
  40. 40. Marc Duiker Durable Functions
  41. 41. Marc Duiker Durable Functions • In and output of functions should be serializable. • Orchestration Functions should be deterministic: - DateTime.Now, use CurrentUtcDateTime - Guid.NewGuid() - Random generated data Closing remarks I
  42. 42. Marc Duiker Durable Functions • Orchestration Functions can only call Activity Functions in the same Function App. • Keep your orchestrations small. • What changes together should be deployed together. Closing remarks II
  43. 43. Marc Duiker Durable Functions GitHub: demos-azure-durable-functions mduiker@xpirit.com blog.marcduiker.nl @marcduiker

×