Entwickler haben schon Lust auf Serverwartung? Statt PowerShell, Bash & Co zu lernen, will man sich auf seine eigentliche Entwicklungsarbeit konzentrieren. Serverless Computing will genau das bieten. Statt sich um Server oder Container zu kümmern, nutzt man Platform-as-a-Service (PaaS) Angebote in der Cloud. Sie bieten automatische Skalierung, Hochverfügbarkeit, Updates u.v.m. In dieser Session stellt Rainer Stropek, langjähriger Azure MVP und MS Regional Director, die Grundideen von Serverless Computing vor. Welche Vorteile gibt es? Wo sind die Grenzen? Anschließend zeigt Rainer live Demos mit Node.js und C# in Azure App Services her und berichtet über seine Erfahrungen, die er in der Praxis in den letzten Jahren damit gesammelt hat.
Cloud is prerequisite See also Platform-as-a-Service (PaaS) Auto-scaling No explicit starting and stopping of VMs Done by the cloud provider automatically behind the scenes Billing not based on VM hours Abstract measures typically related to usage No usage no costs (aka scale down to zero) See also Wikipedia
editor or SCM integration Stateless (short-lived, ephemeral) Separate Auth service E.g. AAD, Google Auth API Gateway Routing, security Integration Hybrid solutions Event- or message-driven Webhooks (sync) Service bus, queues (async) Clients Auth Func 1 Func 2 Func … Gateway External System
(standard and custom) Don’t reinvent the wheel Examples: API Gateways, Search, RESTful web APIs from storage systems, etc. More logic on the client Especially compared to classical full-page-refresh web apps Higher-level functions using workflow engine Example: Azure Logic Apps Automate deployment using SCM integration Example: GitHub, VSTS
Develop smaller components Reduce Operational costs No usage no costs Designed for Microservices Handles fluctuating load Auto-scaling Support many languages/platforms Best tool for the specific job High degree of freedom for teams Deployment is harder Automation is a necessity Handling of breaking changes Troubleshooting is more difficult System-wide logging and telemetry is important Limited control over configuration Gets better with containers Proliferation Guidelines for practices and patterns necessary Economy of scope Not made for long-running tasks Startup latency Further readings: http://martinfowler.com/articles/serverless.html#benefits
Create Function SCM integration C#, Webhook Online Testing Function App settings Trigger, Inputs, Outputs C#, Node.js HTTP , Service Bus Queues Fundamentals For more details see my GitHub repository
request body var board = JSON.parse(req.body); // Make sure that body is a properly formed array if (Array.isArray(board) && board.length == 9) { // Body is ok -> send message to trigger analysis context.bindings.outputSbMsg = JSON.stringify({ Message: board }); // Send OK result to caller context.res = { status: 200 }; context.done(); } else { // Body is malformed -> send Bad Request to caller context.res = { status: 400, body: "No valid tic-tac-toe board" }; context.done(); } }; Node.js Example Multiple Outputs Service Bus Queue HTTP
too Price depends on: Memory Execution time Number of executions Quite high free grant Auto-scaling by Azure More about scaling: https://docs.microsoft.com/en- us/azure/azure-functions/functions-scale
for jobs that run infrequently huge cost saver App is stateless Other PaaS services for storing state are necessary We often use it together with App Service Hybrid Connections for on-prem data stores Should be part of an overall Microservice strategy Guidelines and practices are necessary Great to combine with other PaaS services Self-made or existing ones