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

What comes after your first function in Serverless?

What comes after your first function in Serverless?

This is a presentation I delivered for the Serverlessdays Conference in Istanbul. Sample codes used during the presentation are shared on GitHub; https://drn.fyi/2nTbb3y

Daron Yondem

October 03, 2019
Tweet

More Decks by Daron Yondem

Other Decks in Programming

Transcript

  1. Daron Yöndem
    http://daron.me
    @daronyondem

    View Slide

  2. • How to create a function in Azure Functions
    • How to create HTTP APIs in Azure Functions
    • How to create timer jobs in Azure Functions
    • How to use Function bindings

    View Slide

  3. • The functions runtime on your laptop is the same as the one
    in Azure.
    • You can have your own Azure Functions environment on-
    premise and use it without Public Azure Cloud.
    • Azure Functions runs on Linux as well as Windows.

    View Slide

  4. Azure Functions on Kubernetes with KEDA
    • https://drn.fyi/2ppbVxN
    Create a function on Linux using a custom image
    • https://drn.fyi/2nQwd2E

    View Slide

  5. • API Routing, Versioning, Caching, Throttling
    • Managing state across multiple functions.
    • Eventing
    • Function Orchestration for you and for dummies!

    View Slide

  6. • Have multiple function apps under a single API surface.
    • Mock APIs for developers!
    • Request/Response overrides
    • Routing
    • Can run locally on your machine #justfyi
    .

    View Slide

  7. Using function proxies to hijack 3rd party APIs.
    Don’t try this at home!

    View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. View Slide

  12. {request.method}
    {request.headers.}
    {request.querystring.}

    View Slide

  13. {backend.response.statusCode}
    {backend.response.statusReason}
    {backend.response.headers.}

    View Slide

  14. https://%ORDER_PROCESSING_HOST%/api/orders

    View Slide

  15. • Rate limiting
    • Access Policies
    • Caching
    • Subscriptions
    • Licensing
    • Analytics
    • Developer Portal
    • and so on…

    View Slide

  16. Throttling!

    View Slide

  17. View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. Azure Proxies Official Documentation
    • https://aka.ms/ProxiesDocs
    OpenAPI (Swagger) export from Azure Functions
    • https://goo.gl/LWbFmH

    View Slide

  24. • Stateful functions
    • Managed state, checkpoints, and restarts when needed.
    • Define stateful workflows in orchestrator functions.
    • Actor like Durable Entities in Durable 2.0
    .

    View Slide

  25. • No visualization to show relationship between functions and queues.
    • Middle queues are an implementation detail – conceptual overhead.
    • Error handling adds a lot more complexity.

    View Slide

  26. • Fanning-out is easy, but fanning-in is more complicated.
    • Functions offers no help with this scenario today
    • All the same problems of the previous pattern

    View Slide

  27. • Long running processes
    • Built-in state management
    • orchestrationClient or built-in webhooks can be used.

    View Slide

  28. • Actor like scenarios.
    • Long-running (possibly endless), stateful, reliable, single-
    threaded, location-transparent, and globally addressable.

    View Slide

  29. Consuming 3rd party throttled APIs with ease.

    View Slide

  30. • Service Bus: Async Enterprise Messaging
    • Azure Event Hubs: Distributed Data Streaming
    • Relay: Secure two way communication without changes to
    your network
    • Event Grid: Cross cloud reactive eventing

    View Slide

  31. View Slide

  32. • Pay per event.
    • Sub-second end-to-end latency in the 99th percentile
    • 10.000.000 events per second per region
    • 24 hour retry with exponential back off

    View Slide

  33. 1. Events: what happened
    2. Event Publishers: where it took place
    3. Topics: where publishers send events
    4. Event Subscriptions: how you receive
    events
    5. Event Handlers: the app or service
    reacting to the event

    View Slide

  34. View Slide

  35. View Slide

  36. View Slide

  37. View Slide

  38. • Event Hub is an “event ingestor” that accepts and stores event
    data, Azure Event Grid is the distribution fabric for discrete
    “business logic activity” events.
    • Fast and highly parallelized processing of the individual
    streams instead of a filtered subscriber model.

    View Slide

  39. View Slide

  40. View Slide

  41. View Slide

  42. View Slide

  43. Event Grid Extension for Azure Functions
    • https://goo.gl/7z88G3
    Choosing the right Azure messaging service for your data
    • https://goo.gl/19YPDZ

    View Slide

  44. • Saving time by designing complex processes using easy to
    understand design tools
    • Implementing patterns and workflows seamlessly, that would
    otherwise be difficult to implement in code
    • Rich Managed Connectors

    View Slide

  45. View Slide

  46. View Slide

  47. View Slide

  48. View Slide

  49. View Slide

  50. Sample project used during presentation
    • https://drn.fyi/2nTbb3y
    OpenAPI (Swagger) export from Azure Functions
    • https://goo.gl/LWbFmH

    View Slide

  51. http://daron.me | @daronyondem
    Download slides here;
    http://decks.daron.me

    View Slide