Slide 1

Slide 1 text

Serverless-Architekturen: Event-basierte Microservices mit Azure Functions & Co. Christian Weyer @christianweyer CTO

Slide 2

Slide 2 text

2 § Founder & CTO at Thinktecture AG § Personal focus on § Mobile & web-based application architectures § Interoperability, cross-device § Pragmatic end-to-end solutions § Cloud-native & serverless architectures § Independent Microsoft Regional Director § Microsoft MVP for ASP.NET (Architecture) ASPInsider, AzureInsider § Google GDE for Web Technologies § [email protected] § ! @christianweyer Christian Weyer Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen

Slide 3

Slide 3 text

3 § Microservices, Nanoservices § Serverless in Azure § Azure Functions § Azure Cosmos DB § Azure SignalR Service Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Topics

Slide 4

Slide 4 text

4 How ‘large’ is ‘small’? Microservices Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen

Slide 5

Slide 5 text

5 § Modern business architectures: we strive for isolating functional services § Using any technology, any communication § Microservice: unit of independent deployment for a business domain-specific service § Nanoservice: like Microservice, but more focused & lightweight; can be replaced easier § Functions as the mental model Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Microservices – or rather: Nanoservices !

Slide 6

Slide 6 text

6 A different approach Serverless Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen

Slide 7

Slide 7 text

7 § We can choose from a continuum § VM ➔ § Containers ➔ § Orchestrators ➔ § PaaS ➔ § Serverless Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Evolution to Cloud Compute Continuum PaaS IaaS On-Premises Serverless

Slide 8

Slide 8 text

8 What is Serverless, anyway? Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen

Slide 9

Slide 9 text

9 § Serverless Compute → Azure Functions § Serverless Database → Azure Cosmos DB § Serverless Realtime → Azure SignalR Service § Serverless Events → Azure Event Grid § Serverless Messaging → Azure Service Bus § Serverless Workflows → Azure Logic Apps Azure Durable Functions § Serverless IoT → Azure IoT Hub § Serverless Analytics → Azure Application Insights § Serverless Containers → Azure Container Instances Moderne Anwendungen Serverless in Azure Die WebAssembly & Serverless Revolutionen

Slide 10

Slide 10 text

10 Azure Functions Serverless Code / Compute Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen

Slide 11

Slide 11 text

11 § Azure Functions is code being triggered by an event § Focused code + events § Basic principles enable powerful use cases § Events § Triggers § Bindings § Two ways of operation § Cost-optimized, automatic scale (aka Consumption Plan) § Always-on, via Azure App Service § V2 Runtime built on .NET Core § Available for self-hosting Event-basierte Microservices mit Azure Functions und Co. Azure Functions: Functions-as-a-Service Serverless-Architekturen

Slide 12

Slide 12 text

12 § In portal, via CLI, or in IDE § Visual Studio wizards for pre-compiled Functions § Local tooling & runtime available § Debugging locally or remote § Multiple language bindings supported § C# & C# Script § F# § JavaScript, TypeScript (node.js) § Java (preview) Event-basierte Microservices mit Azure Functions und Co. Developing Functions Serverless-Architekturen

Slide 13

Slide 13 text

13 § Incoming event triggers function § Input bindings enable easy access to data from various data sources § Output bindings offer easy access to outbound data sinks § Custom triggers and bindings can be implemented Event-basierte Microservices mit Azure Functions und Co. Triggers & Bindings Serverless-Architekturen Your code logic Runtime Azure Function HTTP Trigger Storage Input Binding Push Notification Output Binding Database Output Binding Email Output Binding

Slide 14

Slide 14 text

14 Event-basierte Microservices mit Azure Functions und Co. Triggers & Bindings in Code Serverless-Architekturen

Slide 15

Slide 15 text

15 Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings Triggers & Bindings

Slide 16

Slide 16 text

16 Azure Cosmos DB Serverless Database Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen

Slide 17

Slide 17 text

17 § Globally distributed, elastically scalable § Fully managed by Azure § But not yet fully automatically scaling § Multi-model database § Key-value, document, graph ➔ NoSQL § Multiple APIs § DocumentDB, with SQL & JS APIs § MongoDB API § Cassandra API § Table Storage API § Graph Database with Gremlin API Event-basierte Microservices mit Azure Functions und Co. Cosmos DB: A Database with Many Faces Serverless-Architekturen

Slide 18

Slide 18 text

18 § Building event-driven architectures with Cosmos DB § Listening to Azure Cosmos DB collection for any changes § Inserts, updates, soft-deletes § Subscribe to collection changes § Can be used as a trigger for Functions Event-basierte Microservices mit Azure Functions und Co. Cosmos DB Change Feed Serverless-Architekturen

Slide 19

Slide 19 text

19 Serverless Realtime Azure SignalR Service Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen

Slide 20

Slide 20 text

20 § Realtime is a wanted feature nowadays § Dashboards and monitoring apps § Collaborative apps § Apps that require notifications § ASP.NET Core SignalR provides programming model for bi-directional ‘method invocation’ – via WebSockets, SSE or Long Polling § Wanted: “SignalR messaging & scale-out”-as-a-Service ➔ Azure SignalR Service Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Azure SignalR Service

Slide 21

Slide 21 text

21 Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Azure SignalR Service & Azure Functions

Slide 22

Slide 22 text

22 Azure Event Grid Serverless Eventing Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen

Slide 23

Slide 23 text

23 § Fully-managed centralized event routing service § Simplifies development of event-based applications § Simplifies creation of serverless workflows § Manages all routing of events § From any source, to any destination, for any application § Eventing, not enterprise messaging § Same underlying model for different use-cases § System-provided events § Custom application-specific events Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Event Grid

Slide 24

Slide 24 text

24 Event Grid Reliability & Performance Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen

Slide 25

Slide 25 text

25 § Nanoservices pattern as a more lightweight but more granular approach to Microservices § Serverless is just one option in the Cloud Continuum § Always think about the use cases and requirements § Event-driven thinking & modeling of services & interfaces feels like a natural approach to systems design § Serverless Azure tries to offer solutions in the Continuum § Functions § Cosmos DB § SignalR Service § Event Grid … & more § Azure Functions is way more than just a Web API framework Summary Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen

Slide 26

Slide 26 text

26 § Processing 100,000 Events Per Second on Azure Functions § https://blogs.msdn.microsoft.com/appserviceteam/2017/09/19/processing- 100000-events-per-second-on-azure-functions/ § Azure Functions – Significant Improvements in HTTP Trigger Scaling § https://www.azurefromthetrenches.com/azure-functions-significant- improvements-in-http-trigger-scaling/ § Azure Functions: Cold Starts in Numbers § https://mikhail.io/2018/04/azure-functions-cold-starts-in-numbers/ Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Interesting reading

Slide 27

Slide 27 text

27 § Azure Functions Dependency Injection (with AutoFac) § https://github.com/introtocomputerscience/azure-function-autofac- dependency-injection Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Resources