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

Serverless Azure: Event-basierte Microservices ...

Serverless Azure: Event-basierte Microservices - effizient & effektiv

Wie bitte? Ohne Server? Ähm... Ja, in der Tat. Der Serverless-Ansatz für Microservices verspricht eine niedrige Hürde, um den Einstieg zu finden und auch um ans Ziel zu kommen. Dabei ist Serverless jedoch nicht für jeden und alles geeignet. In diesem Vortrag zeigt Christian Weyer die Grundlagen von Serverless mit Azure und .NET Core anhand eines realistischen Anwendungsbeispiels aus dem Kundenprojektumfeld. Auf Basis erprobter Design Patterns können Sie mit Azure Functions, Azure Event Grid, Azure Cosmos DB, Azure Storage & Co. in kurzer Zeit einfache & komplexe Anwendungen designen und implementieren - lokal und in der Cloud. Einer der Schlüssel ist hierbei das Denken in Events, über die Daten übertragen, verarbeitet und weitergeleitet werden. Wohnen Sie dieser Session bei und bilden Sie sich Ihre Meinung - eventuell lernen Sie die Basis Ihrer neuen Business-Software hier kennen.

Christian Weyer

June 25, 2018
Tweet

More Decks by Christian Weyer

Other Decks in Programming

Transcript

  1. 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 - effizient & effektiv Serverless Azure
  2. 3 § Microservices, Nanoservices § Serverless in Azure § Azure

    Functions § Azure Cosmos DB § Azure SignalR Service Serverless Azure Event-basierte Microservices - effizient & effektiv Topics
  3. 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 Azure Event-basierte Microservices - effizient & effektiv Microservices – or rather: Nanoservices
  4. 7 § We can choose from a continuum § VM

    ➔ § Containers ➔ § Orchestrators ➔ § PaaS ➔ § Serverless Serverless Azure Event-basierte Microservices - effizient & effektiv Evolution to Cloud Compute Continuum PaaS IaaS On-Premises Serverless
  5. 9 § Serverless Compute → Azure Functions § Serverless Database

    → Azure Cosmos DB § Serverless Realtime → Azure SignalR Service § Serverless Events → Azure Event Grid § Serverless Workflows → Azure Logic Apps Azure Durable Functions § Serverless IoT → Azure IoT Hub § Serverless Analytics → Azure Application Insights § Serverless Containers → Azure Container Instances § ... and more ... https://azure.microsoft.com/en-us/overview/serverless-computing/ Event-basierte Microservices - effizient & effektiv Serverless in Azure (Serverless != FaaS-only) Serverless Azure
  6. 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 - effizient & effektiv Azure Functions: Functions-as-a-Service Serverless Azure
  7. 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 (CSX) § F# § JavaScript, TypeScript (node.js) § Java (preview) Event-basierte Microservices - effizient & effektiv Developing Functions Serverless Azure
  8. 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 - effizient & effektiv Triggers & Bindings Serverless Azure Your codelogic Runtime Azure Function HTTP Trigger Storage Input Binding Push Notification Output Binding Database Output Binding Email Output Binding
  9. 15 Event-basierte Microservices - effizient & effektiv Serverless Azure https://docs.m

    icrosoft.com /en-us/azure/azure-functions/functions-triggers-bindings Triggers & Bindings
  10. 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 - effizient & effektiv Cosmos DB: A Database with Many Faces Serverless Azure
  11. 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 - effizient & effektiv Cosmos DB Change Feed Serverless Azure
  12. 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 § Scaling SignalR § On-prem with SQL Server, Azure Service Bus, or Redis Cache § Azure SignalR Service: update unit count for your service. Each service unit supports up to 1000 client connections Serverless Azure Event-basierte Microservices - effizient & effektiv Azure SignalR Service
  13. 23 § Nanoservices pattern as 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 § Serverless Azure tries to offer solutions in the Continuum § Functions § Cosmos DB § SignalR Service § Event Grid § … & more § Event-driven approach, with any technology & programming language Summary Event-basierte Microservices - effizient & effektiv Serverless Azure
  14. 24 § 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 Azure Event-basierte Microservices - effizient & effektiv Interesting reading
  15. 25 § Azure Functions Dependency Injection (with AutoFac) § https://github.com/introtocomputerscience/azure-function-autofac-

    dependency-injection Serverless Azure Event-basierte Microservices - effizient & effektiv Resources