Тема доклада
Тема доклада
Тема доклада
KYIV 2019
Stas Lebedenko
Practical serverless use cases in Azure.
.NET CONFERENCE #1 IN UKRAINE
The ultimate goal is to
minimize the lifetime cost of
the system and to maximize
programmer productivity.
@martinfowler
● Azure Functions
● Azure API Management
● Azure Logic Apps
● Azure SQL Serverless
● Azure Event Grid
● KEDA - Kubernetes-based
event-driven autoscale
Most popular use cases.
Functions cold start
Usage with classic
applications
The catch with legacy
01 | Cannot handle spike loads.
02 | Caching is a must.
03 | Rate limit via API Facades.
04 | Adjust outgoing throughput.
05 | Limit scalability.
06 | Tune connection pool of SQL Server.
Client applications
● Implement retry.
● Track connection issues.
● Handle 50x and 40x.
● Use additional responses
429 - Too many requests
420 - Enhance your calm
Serverless API facades
Azure Functions Proxy Azure API Management
VS
Serverless Web App
Serverless API
Stateless actors
Event-driven
applications
Durable functions
01 | Based on Durable Task Framework.
02 | Stateful coordination.
03 | Partially in preview.
04 | Orchestrator function.
05 | Entity function.
06 | Ideal for complex
Coordinated pipelines.
IoT Hub message pipelines
Event processing pipelines
ETL via Fan-in => Fan-out
Big Data pipelines
Durable orchestration
Serverless best
practices and pitfalls
Best practices
01 | Keep function small and stateless.
02 | Control connection limits.
03 | Design for failure and use throttling.
04 | Avoid long runs and direct chaining.
05 | Use HttpClient via static.
06 | Use scalable storages.
07 | Build communications via queues and hubs.
Pitfalls
01 | Consumption compute slow
02 | Scale-out have limits.
03 | Bad fit with legacy.
04 | Cold start.
06 | Cloud vendor lock-in.
07 | Failure at scale.
Know your limits
01 | Functions connections limits.
02 | Processing time limit.
03 | External rate limits.
04 | Scale-out limit.
05 | ACU per instance limit.
06 | Storage limit.
SECURITY ● Function code auth.
● 5 App Service options.
● No custom OIDC option.
● CSP, CORS settings.
● Azure Managed Identity.
● VNet only in Premium
plan.
Just a few tricks
Premium scaler
Massive scale increase
probability of the
massive failure.
● Consumption plan is cheap
● Billing estimation is
complicated.
● Cheapest possible ETL.
● Long running functions
with poor design will result
in excessive cost.
● Vulnerable for Denial-of-
wallet attacks.
Cloud-agnostic
serverless
Any platform, any cloud?
01 | Vendor lock-in problem.
02 | Multicloud is a tech debt.
03 | Consider local run option.
04 | Storage is the real problem.
05 | Think in terms of code.
06 | Estimate multi cloud.
Pulumi framework
Serverless framework
Wrap-up
Demo. Your rate prediction.
Ask Zoltar
Keep up with technology
Questions?
Linked IN Twitter

.NET Fest 2019. Stas Lebedenko. Practical serverless use cases in Azure with a trick or two

Editor's Notes

  • #16 Azure compute units
  • #25 Azure compute units https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale
  • #28 Why we
  • #36 https://github.com/Azure/azure-functions-durable-extension/issues/593 table.CreateIfNotExists() actually works (Azure Storage SDK), (it asks the Storage API for the table and makes the POST request to create it if 404).