serverless azure

35
Serverless Azure Mark Allan (@MarkXA)

Upload: mark-allan

Post on 22-Mar-2017

57 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Serverless Azure

Serverless Azure

Mark Allan (@MarkXA)

Page 2: Serverless Azure
Page 3: Serverless Azure

Server evolution VMs PaaS Containers Functions

Page 4: Serverless Azure

“Serverless” computing Servers abstracted away Still your code and data Elastic scale Elastic price Minimal admin

Page 5: Serverless Azure

Serverless on Azure Code: Azure Functions Data: Azure Storage, DocumentDB Workflow: Logic Apps APIs: Cognitive Services

Page 6: Serverless Azure

DocumentDB

Page 7: Serverless Azure

Document databases NoSQL Keyed and partitioned documents Schema-free – JSON (or XML) Scalable No need for ORMs See also: AWS DynamoDB, Apache

CouchDB, MongoDB (PostgreSQL), etc

Page 8: Serverless Azure

DocumentDB Developed cloud-first by SQL Server team Database As A Service Fully managed “Web scale” storage and throughput SSD storage SQL query syntax Emulator available for dev/test

Page 9: Serverless Azure

DEMOCreating a database

Page 10: Serverless Azure

Resource hierarchy

Regions

Page 11: Serverless Azure

Partitioning Single partition collection• Keyed on ID• Max 10GB (hard)• 400 - 10,000 RU/s (hard)

Partitioned collection• Keyed on ID and partition key• Max 250GB (soft)• 2,500 - 250,000 RU/s (soft)

Page 12: Serverless Azure

Querying SQL-based query syntax Extensions such as IS_DEFINED,

IS_ARRAY, IS_NUMBER, ARRAY_CONTAINS, ARRAY_SLICE, ST_DISTANCE

SPs, UDFs and triggers in JS Transactions LINQ-style filter(), map(), flatten(),

sortBy()

Page 13: Serverless Azure

DEMOQuery Playground

Page 14: Serverless Azure

Consistency levels Strong Bounded staleness Session (default) EventualSet at collection level, can be relaxed

Page 15: Serverless Azure

Indexing Everything indexable by default Intelligent indexing based on usage Opt in/out for paths and documents Hash, range, spatial indexes (with precision) GeoJSON points, polygons etc Consistent and lazy policies (and none) Indexes do add to cost

Page 16: Serverless Azure

Security Full access via master keys (or read-

only) Users restricted to specified

resources User-level access via 1-5hr resource

tokens

Page 17: Serverless Azure

APIs RESTful HTTP .NET (traditional, Core, Xamarin) Java, Python, Node, C++ APIs wrap HTTP, add e.g. retry logic

Page 18: Serverless Azure

DEMODocumentDB APIs

Page 19: Serverless Azure

Integration HDInsight Azure Search Azure Data Factory (backups) Data Migration Tool Power BI Change feed

Page 20: Serverless Azure

Pricing Storage – by usage Throughput – reserved capacity 1 RU = GET by ID of 1KB doc Capacity planner + pricing calculator

Page 21: Serverless Azure

Useful resources Homepage:

https://azure.microsoft.com/en-us/services/documentdb/

Query Playground: https://www.documentdb.com/sql/demo

Capacity Planner: https://www.documentdb.com/capacityplanner

Pricing Calculator: https://azure.microsoft.com/en-us/pricing/calculator/?service=documentdb

.NET API samples: https://github.com/Azure/azure-documentdb-dotnet

Page 22: Serverless Azure
Page 23: Serverless Azure

Azure Functions

Page 24: Serverless Azure

Azure Functions “Functions as a Service” Async functions triggered by events Evolution of App Service webjobs New: Consumption plans See also: AWS Lambda, Google Cloud

Functions, Apache OpenWhisk

Page 25: Serverless Azure

A function

AzureFunction

Trigger

Inputs

Outputs

Page 26: Serverless Azure

More functions

Poll feed

Create thumbnails

API request

Page 27: Serverless Azure

Triggers Schedule HTTP (API or webhooks) Storage Queue Storage Blob Service Bus Queue / Topic Event Hub

Page 28: Serverless Azure

Inputs Storage Table Storage Blob Mobile Apps Table DocumentDB

Page 29: Serverless Azure

Outputs HTTP response (for HTTP trigger) Storage Queue / Blob / Table Service Bus: Queue / Topic Mobile Apps Table DocumentDB Event Hub Notification Hub Twilio

Page 30: Serverless Azure

Integrations Flow PowerApps

Page 31: Serverless Azure

Languages First-class: NodeJS, C#, F# “Experimental”: Python, PHP, Bash,

Powershell, Batch (!) Future: Java

Page 32: Serverless Azure

DEMOCreating functions

Page 33: Serverless Azure

Tooling Azure Functions CLI Visual Studio .funproj Serverless Framework Soon: full VS - proper unit testing etc

Page 34: Serverless Azure

Challenges Latency Stateless – caching etc Non-scalable components (e.g. SQL) Bugs can be expensive Vendor lock-in

Page 35: Serverless Azure

Thank you!

Any questions?