Slide 1

Slide 1 text

Real-time in no time (and costs?) with Azure Functions, Cosmos DB & SignalR Christian Weyer @christianweyer https://www.thinktecture.com/en/christian-weyer CTO, Thinktecture AG

Slide 2

Slide 2 text

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 Azure, Developer Tools ASPInsider, AzureInsider § Google GDE for Web Technologies [email protected] @christianweyer https://www.thinktecture.com Christian Weyer Real-time in no time (and costs?) With Azure Functions, Cosmos DB & SignalR

Slide 3

Slide 3 text

3 § Serverless Compute: Azure Functions § Serverless Messaging: Azure Service Bus § Serverless Database: Azure CosmosDB § Serverless Real-time: Azure SignalR Service With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Serverless-all-the-things™ - Today: Greenfield

Slide 4

Slide 4 text

With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Sample Architecture – Shopping Order Monitoring 4

Slide 5

Slide 5 text

With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Sample Architecture – Shopping Order Monitoring Orders Service Products Service Shipping Service AuthN Service Order Monitoring SPA Shopping Web Site (simulated by Postman) 1 - authenticate 2 - register for push 3 - send new order 5 - new order created push 6 - get updated orders 4 - processing order… 5

Slide 6

Slide 6 text

With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Sample Architecture – Shopping Order Monitoring: Serverless Azure Orders Service Products Service Shipping Service AuthN Service Order Monitoring SPA Shopping Web Site (simulated by Postman) Azure Function App – C# Azure Function App - C# Azure Function App - JS Azure Function App - Java Azure Service Bus Azure Blob Storage Azure SignalR Service Azure Table Storage Azure Cosmos DB Identity Server 6

Slide 7

Slide 7 text

Azure Functions Serverless Compute Real-time in no time (and costs?) With Azure Functions, Cosmos DB & SignalR 7

Slide 8

Slide 8 text

8 § Azure Functions: code being triggered by an event § Use Façade pattern for your business logic § Basic principles enable powerful use cases § Events ➔ Triggers & Bindings § Cost-optimized, automatic scale (Consumption plan) § V2/V3 Runtime built on .NET Core § Available for self-hosting § Local tooling & runtime § Multiple language bindings supported With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Azure Functions: Functions-as-a-Service

Slide 9

Slide 9 text

9 § Incoming event triggers function § Input bindings enable easy access to data from various data sources § Output bindings offer easy access to outbound data sinks With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Functions Triggers & Bindings Your code logic Runtime Azure Function HTTP Trigger Storage Input Binding Push Notification Output Binding Database Output Binding Email Output Binding Example

Slide 10

Slide 10 text

10 Functions Triggers & Bindings in Code Real-time in no time (and costs?) With Azure Functions, Cosmos DB & SignalR

Slide 11

Slide 11 text

With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Sample Architecture – Shopping Order Monitoring: Azure Functions Orders Service Products Service Shipping Service AuthN Service Order Monitoring SPA Shopping Web Site (simulated by Postman) Azure Function App – C# Azure Function App - C# Azure Function App - JS Azure Function App - Java Azure Service Bus Azure Blob Storage Azure SignalR Service Azure Table Storage Azure Cosmos DB Identity Server 11

Slide 12

Slide 12 text

12 Azure Cosmos DB Serverless Database Real-time in no time (and costs?) With Azure Functions, Cosmos DB & SignalR

Slide 13

Slide 13 text

13 § Globally distributed, elastically scalable § Fully managed by Azure § Serverless mode in preview § Multi-model database § Key-value, document, graph § Multiple APIs § DocumentDB, with SQL & JS APIs § MongoDB API § Cassandra API § Table Storage API § Graph Database with Gremlin API Real-time in no time (and costs?) Cosmos DB: NoSQL Database with Many Faces With Azure Functions, Cosmos DB & SignalR

Slide 14

Slide 14 text

With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Sample Architecture – Shopping Order Monitoring: Azure Cosmos DB Orders Service Products Service Shipping Service AuthN Service Order Monitoring SPA Shopping Web Site (simulated by Postman) Azure Function App – C# Azure Function App - C# Azure Function App - JS Azure Function App - Java Azure Service Bus Azure Blob Storage Azure SignalR Service Azure Table Storage Azure Cosmos DB Identity Server 14

Slide 15

Slide 15 text

15 § Building event-driven architectures with Cosmos DB § Listening to Azure Cosmos DB collection for any changes § Inserts, updates, soft-deletes § Subscribe to collection changes Real-time in no time (and costs?) Cosmos DB Change Feed With Azure Functions, Cosmos DB & SignalR

Slide 16

Slide 16 text

Azure Service Bus Serverless Messaging Real-time in no time (and costs?) With Azure Functions, Cosmos DB & SignalR 16

Slide 17

Slide 17 text

17 § 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 With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Service Bus: Messaging-as-a-Service

Slide 18

Slide 18 text

18 Sender § Sender sends message to queue § Queue ACKs receipt § Receiver connects to queue & retrieves message § Receiver ACKs complete (or other action) With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Service Bus Queues Receiver

Slide 19

Slide 19 text

With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Sample Architecture – Shopping Order Monitoring: Azure Service Bus Orders Service Products Service Shipping Service AuthN Service Order Monitoring SPA Shopping Web Site (simulated by Postman) Azure Function App – C# Azure Function App - C# Azure Function App - JS Azure Function App - Java Azure Service Bus Azure Blob Storage Azure SignalR Service Azure Table Storage Azure Cosmos DB Identity Server 19

Slide 20

Slide 20 text

20 Azure SignalR Service Serverless Real-time Real-time in no time (and costs?) With Azure Functions, Cosmos DB & SignalR

Slide 21

Slide 21 text

21 § Real-time messaging 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 § Various client libs available § Wanted: “SignalR messaging & scale-out”-as-a-Service ➔ Azure SignalR Service § Azure Functions bindings available for accessing SignalR Service With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Azure SignalR Service

Slide 22

Slide 22 text

With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Sample Architecture – Shopping Order Monitoring: Azure SignalR Orders Service Products Service Shipping Service AuthN Service Order Monitoring SPA Shopping Web Site (simulated by Postman) Azure Function App – C# Azure Function App - C# Azure Function App - JS Azure Function App - Java Azure Service Bus Azure Blob Storage Azure SignalR Service Azure Table Storage Azure Cosmos DB Identity Server 22

Slide 23

Slide 23 text

Wrapping up Real-time in no time (and costs?) With Azure Functions, Cosmos DB & SignalR 23

Slide 24

Slide 24 text

24 § Completely scriptable with e.g. Terraform § No need to touch servers, or portals § You need check and measure early § Serverless pricing can bite you… § Check out pricing – and do the math § https://azure.microsoft.com/en-us/pricing/details/functions/ § https://azure.microsoft.com/en-us/pricing/details/cosmos-db/ § https://azure.microsoft.com/en-us/pricing/details/service-bus/ § https://azure.microsoft.com/en-us/pricing/details/signalr-service/ With Azure Functions, Cosmos DB & SignalR Real-time in no time (and costs?) Serverless! At “no cost”?

Slide 25

Slide 25 text

Christian Weyer, Thinktecture AG @christianweyer [email protected] https://github.com/thinktecture/serverless-microservices