Slide 1

Slide 1 text

Serverless-Architekturen: Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Christian Weyer @christianweyer 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 ASP.NET (Architecture) ASPInsider, AzureInsider § Google GDE for Web Technologies [email protected] @christianweyer https://www.thinktecture.com Christian Weyer Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Serverless-Architekturen

Slide 3

Slide 3 text

3 § Microservices, Nanoservices § Serverless in Azure § Serverless Compute: Azure Functions § Serverless Messaging: Azure Service Bus § Summary Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Our Journey Today

Slide 4

Slide 4 text

How large is small? Microservices Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Serverless-Architekturen 4

Slide 5

Slide 5 text

Single Responsibility § Focused around business domain § ‘Small’ Isolation § Well-defined technology-agnostic API § Mobility § Choice of technology Autonomy § Exclusive state (data storage) Decoupling § Asynchronous communication § Really, always? Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler (Some) Principles of Microservices 5

Slide 6

Slide 6 text

Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Sample Architecture – Shopping Order Monitoring 6

Slide 7

Slide 7 text

Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler 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… 7

Slide 8

Slide 8 text

A different approach Serverless Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Serverless-Architekturen 8

Slide 9

Slide 9 text

9 § We can choose from a continuum § VM ➔ § Containers ➔ § Orchestrators ➔ § PaaS ➔ § Serverless Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Evolution to Cloud Compute Continuum PaaS IaaS On-Premises Serverless

Slide 10

Slide 10 text

10 Serverless? Programming Model (FaaS) § Event-driven § Stateless § Service-full Operational Model § Fully managed § Automatically scaling § Usage priced Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Serverless-Architekturen

Slide 11

Slide 11 text

11 § Serverless Compute → Azure Functions § Serverless SQL Database → Azure SQL Database Serverless § Serverless NoSQL Database → Azure Cosmos DB § Serverless Storage → Azure Storage § Serverless Realtime → Azure SignalR Service § Serverless Events → Azure Event Grid § Serverless Messaging → Azure Service Bus § Serverless Workflows → Azure Logic Apps Azure Durable Functions § Serverless IoT → Azure IoT Hub § Serverless Analytics → Azure Application Insights § Serverless Containers → Azure Container Instances Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Serverless in Azure (my personal choice)

Slide 12

Slide 12 text

Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Sample Architecture – Shopping Order Monitoring: Serverless 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 12

Slide 13

Slide 13 text

Azure Functions Serverless Compute Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Serverless-Architekturen 13

Slide 14

Slide 14 text

14 § 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 Runtime built on .NET Core § Available for self-hosting § Local tooling & runtime § Multiple language bindings supported Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Azure Functions: Functions-as-a-Service

Slide 15

Slide 15 text

15 § 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-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler 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 16

Slide 16 text

16 Functions Triggers & Bindings in Code Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Serverless-Architekturen

Slide 17

Slide 17 text

Azure Service Bus Serverless Messaging Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Serverless-Architekturen 17

Slide 18

Slide 18 text

18 § 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 Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Service Bus: Messaging-as-a-Service

Slide 19

Slide 19 text

19 Sender § Sender sends message to queue § Queue ACKs receipt § Receiver connects to queue & retrieves message § Receiver ACKs complete (or other action) Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Service Bus Queues Receiver

Slide 20

Slide 20 text

20 § Sender only knows about Topic § Receivers only know about Subscriptions § Filters and Actions exist on Subscriptions Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Service Bus Topics & Subscriptions Type == ‘order‘ Sender type=quote type=order Topic Type == ‘quote‘ Filter Filter Subscrip- tion 1 Subscrip- tion 2

Slide 21

Slide 21 text

Wrapping up Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler Serverless-Architekturen 21

Slide 22

Slide 22 text

Single Responsibility § Focused around business domain § ‘Small’ unit ➡ Dedicated Azure Functions App ➡ Dedicated Azure DevOps Pipeline Isolation § Choice of technology ➡ .NET, Java, node.js, Python supported § Well-defined technology-agnostic APIs ➡ HTTPS, AMQP, MQTT, custom § Mobility ➡ Portable runtime ➡ Can use Docker, k8s with Functions ➡ Easily deploy & run in Cloud Autonomy § Exclusive state (data storage) ➡ Use separate Azure Storage, Azure SQL, Azure CosmosDB instances Decoupling § Asynchronous communication ➡ Azure Service Bus with queues or topics & subscriptions Serverless-Architekturen Event-getriebene Microservices mit Azure Functions & Co. – auch für Java-Entwickler (Some) Principles of Microservices – with Serverless Azure 22

Slide 23

Slide 23 text

Chris&an Weyer, Thinktecture AG @chris&anweyer chris&[email protected] h:ps://github.com/thinktecture/serverless-microservices