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

Serverless-Architekturen: Event-basierte Microservices mit Azure Functions & Co.

Serverless-Architekturen: Event-basierte Microservices mit Azure Functions & Co.

Wie bitte? Ohne Server? Ähm… Ja, in der Tat. Der Serverless-Ansatz verspricht eine niedrige Hürde, um den Einstieg in Microservices zu finden. In diesem Vortrag zeigt Christian Weyer die Grundlagen von Serverless mit Azure und .NET Core anhand praktischer Anwendungsfälle. Auf Basis erprobter Designpatterns können Sie mit Azure Functions, Azure Service Bus und Co. in kurzer Zeit sowohl einfache als auch komplexe Services-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. Kommen Sie vorbei – eventuell lernen Sie die Basis für Ihr neues Businesssoftware-Backend kennen.

Christian Weyer

February 26, 2019
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 https://www.thinktecture.com Christian Weyer Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen
  2. 3 § Microservices, Nanoservices § Serverless in Azure § Azure

    Functions § Azure Service Bus Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Topics
  3. Single Responsibility § Focused around business domain § ‘Small’ Isolation

    § Choice of technology § Well-defined technology- agnostic API § Mobility Autonomy § Exclusive state (data storage) Decoupling § Asynchronous communication § Really, always? Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. (Some) Principles of Microservices 5
  4. 8 § Microservice: unit of independent deployment for a business

    domain-specific service § Nanoservice: like Microservice, but more focused & lightweight; can be coded, deployed & replaced easier § Functions as the mental model § Make things easier, get productive earlier Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Microservices – or rather: Nanoservices?
  5. 10 § 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
  6. 11 Serverless Sweet Spot Programming Model (FaaS) § Event-driven §

    Stateless § Service-full Operational Model § Fully managed § Automatically scaling § Usage priced Event-basierte Microservices mit Azure Functions und Co. Serverless-Architekturen
  7. 12 § Serverless Compute → Azure Functions § Serverless Database

    → Azure Cosmos DB § Serverless Storage → Azure Storage § 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 Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Serverless in Azure
  8. 14 § Azure Functions: code being triggered by an event

    § Basic principles enable powerful use cases § Events ➔ Triggers § Bindings § Two ways of operation § Cost-optimized, automatic scale (aka Consumption Plan) § Always-on § V2 Runtime built on .NET Core § Available for e.g. self-hosting § Local tooling & runtime § Multiple language bindings supported Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Azure Functions: Functions-as-a-Service
  9. 15 § Incoming event triggers function § Input bindings enable

    easy access to data from various data sources § Output bindings offer easy access to outbound data sinks Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Functions Triggers & Bindings Your code logic Runtime Azure Function HTTP Trigg er Storage Input Binding Push Notification Output Binding Database Output Binding Email Output Binding Example
  10. 16 Functions Triggers & Bindings in Code Event-basierte Microservices mit

    Azure Functions und Co. Serverless-Architekturen
  11. 18 § Asynchronous communication for decoupling Microservices § Different messaging

    services in Azure § Events, data points, messages § Event Grid § Reactive programming § Event Hubs § Big data streams § Service Bus § Enterprise-grade messaging Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Communication is Key to Cloud Architectures
  12. 19 § Queues & Topics § Reliable asynchronous communication §

    Rich features for temporal control § Routing and filtering § Transactions § Convoys & Sessions (related messages with state) § Bindings for Azure Functions available Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Service Bus: Messaging-as-a-Service
  13. 20 Sender § Sender sends message to queue § Queue

    ACKs receipt § Receiver connects to queue & retrieves message § Receiver ACKs complete (or other action) Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Service Bus Queues Receiver
  14. 21 § Sender only knows about Topic § Receivers only

    know about Subscriptions § Filters and Actions exist on Subscriptions Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Service Bus Topics & Subscriptions Type == ‘order‘ Sender type=quote type=order Topic Type == ‘quote‘ Filter Filter Subscrip- tion 1 Subscrip- tion 2
  15. Single Responsibility § Focused around business domain § ‘Small’ unit

    ➡ Dedicated Azure Functions App Isolation § Choice of technology ➡ .NET, Java, node.js, Python supported § Well-defined technology-agnostic API (event-triggered) ➡ HTTPS, AMQP, MQTT, custom § Mobility ➡ Portable runtime ➡ Can use Docker with Functions Autonomy § Exclusive state (data storage) ➡ Use separate Azure Storage, Azure SQL, Azure CosmosDB instances Decoupling § Asynchronous communication (Really, always?) ➡ Azure Service Bus with queues or topics & subscriptions Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. (Some) Principles of Microservices – with Serverless Azure 24
  16. 25 § Serverless (as FaaS) is just one option in

    the Cloud Continuum § Always think about the use cases and requirements § Serverless hosting model will be pre-dominant on the ‘server’ in a couple of years for many use cases § Serverless Azure tries to offer solutions in the Serverless space § Storage § Functions § Service Bus § SignalR Service & more § Azure Functions is way more than just a Web API framework – preferred for async processing Serverless-Architekturen Event-basierte Microservices mit Azure Functions und Co. Summary – Serverless-all-the-things?