Slide 1

Slide 1 text

Serverless Microservices - by example of Azure Functions (and a bit of deep dive into the platform) Christian Weyer @christianweyer [email protected] CTO #ServerlessWebinar

Slide 2

Slide 2 text

2 § Microservices, Nanoservices? § Serverless Compute with Azure Functions (FaaS) § Serverless messaging with Azure Service Bus (MaaS) § Add your own data sources & sinks with Azure Functions extensibility Serverless Microservices – by example of Azure Functions (and a bit of deep dive into the platform) Topics

Slide 3

Slide 3 text

How large is small? Microservices (and a bit of deep dive into the platform) Serverless Microservices – by example of Azure Functions 3

Slide 4

Slide 4 text

Single Responsibility § Focused around business domain § ‘Small’ unit Isolation § Choice of technology § Well-defined technology- agnostic API (event-triggered) § Mobility Autonomy § Exclusive state (data storage) Decoupling § Asynchronous communication (Really, always?) Serverless Microservices – by example of Azure Functions (and a bit of deep dive into the platform) (Some) Principles of Microservices 4

Slide 5

Slide 5 text

5 § 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 Microservices – by example of Azure Functions (and a bit of deep dive into the platform) Microservices – or rather: Nanoservices?

Slide 6

Slide 6 text

A different approach Serverless (and a bit of deep dive into the platform) Serverless Microservices – by example of Azure Functions 6

Slide 7

Slide 7 text

Serverless Compute Azure Functions (and a bit of deep dive into the platform) Serverless Microservices – by example of Azure Functions 7

Slide 8

Slide 8 text

8 § Azure Functions is code being triggered by an event § Basic principles enable powerful use cases § Events ➔ Triggers § Bindings § V2 Runtime built on .NET Core – completely OSS § Available for e.g. self-hosting § Local tooling & runtime § Multiple language bindings supported: C#, JavaScript/TypeScript, Java, Python Serverless Microservices – by example of Azure Functions (and a bit of deep dive into the platform) 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 Serverless Microservices – by example of Azure Functions (and a bit of deep dive into the platform) 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

Serverless Messaging Azure Service Bus (and a bit of deep dive into the platform) Serverless Microservices – by example of Azure Functions 10

Slide 11

Slide 11 text

11 § Decoupling your Microservices § Queues & Topics § Reliable asynchronous communication § Rich features for temporal control § Routing and filtering § Transactions § Convoys & Sessions (related messages with state) § AMQP 1.0-compatible § Bindings for Azure Functions available Serverless Microservices – by example of Azure Functions (and a bit of deep dive into the platform) Service Bus: Messaging-as-a-Service

Slide 12

Slide 12 text

12 Sender § Sender sends message to queue § Queue ACKs receipt § Receiver connects to queue & retrieves message § Receiver ACKs complete (or other action) Serverless Microservices – by example of Azure Functions (and a bit of deep dive into the platform) Service Bus Queues Receiver

Slide 13

Slide 13 text

13 § Sender only knows about Topic § Receivers only know about Subscriptions § Filters and Actions exist on Subscriptions Serverless Microservices – by example of Azure Functions (and a bit of deep dive into the platform) Service Bus Topics & Subscriptions Type == ‘order‘ Sender type=quote type=order Topic Type == ‘quote‘ Filter Filter Subscrip- tion 1 Subscrip- tion 2

Slide 14

Slide 14 text

Azure Functions Extensibility Custom Bindings (and a bit of deep dive into the platform) Serverless Microservices – by example of Azure Functions 14

Slide 15

Slide 15 text

15 § Connecting your own data sources and data sinks to Azure Functions § Beyond available bindings & triggers § We can implement custom bindings § Input § Output § Triggers (with limitations) § E.g. build input binding for your own ERP system § E.g. provide output binding for Web Push protocol (used in PWAs) Serverless Microservices – by example of Azure Functions (and a bit of deep dive into the platform) Azure Functions Custom Bindings & Triggers

Slide 16

Slide 16 text

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 Microservices – by example of Azure Functions (and a bit of deep dive into the platform) (Some) Principles of Microservices – with Serverless Azure 16

Slide 17

Slide 17 text

Christian Weyer, Thinktecture AG @christianweyer [email protected] #ServerlessWebinar