SlideShare a Scribd company logo
Classificatie: vertrouwelijk
Introductie van
Dapr –
de open source
personal
assistant
voor
applicaties en
microservices
Conclusion Code Café – Maandag 4 april 2022
Lucas Jellema
Classificatie: vertrouwelijk
Demo
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
dapr run --app-id myapp --dapr-http-port 3500
http
port 3500
myapp
default-components.yaml
Redis
Zipkin
tracing
Zipkin
Redis
state store
pubsub broker
Redis
state: redis
pubsub: redis
OpenTelemetry:
Classificatie: vertrouwelijk
Demo
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
curl -X POST -H "Content-Type: application/json"
-d '[{ "key": "name", "value": "Bruce Wayne"}]'
http://localhost:3500/v1.0/state/statestore
http
port 3500
myapp
default-components.yaml
Redis
Zipkin
tracing
Zipkin
Redis
state store
pubsub broker
Redis
statestore
pubsub
POST
key: name
value: Bruce Wayne
Classificatie: vertrouwelijk
Demo
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
curl -X POST -H "Content-Type: application/json"
-d '[{ "key": "name", "value": "Bruce Wayne"}]'
http://localhost:3500/v1.0/state/statestore
http
port 3500
myapp
default-components.yaml
Redis
Zipkin
tracing
Zipkin
Redis
state store
pubsub broker
Redis
statestore
pubsub
POST
key: name
value: Bruce Wayne
key: name
value:
Bruce
Wayne
Classificatie: vertrouwelijk
Demo
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
curl http://localhost:3500/v1.0/state/statestore/name
http
port 3500
myapp
default-components.yaml
Redis
Zipkin
tracing
Zipkin
Redis
state store
pubsub broker
Redis
statestore
pubsub
GET
key: name
value:
Bruce
Wayne
Classificatie: vertrouwelijk
Demo
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
curl http://localhost:3500/v1.0/state/statestore/name
http
port 3500
myapp
default-components.yaml
Redis
Zipkin
tracing
Zipkin
Redis
state store
pubsub broker
Redis
statestore
pubsub
GET
key: name
value: Bruce Wayne
“Bruce Wayne”
Classificatie: vertrouwelijk
Demo
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
http
myapp
app-components.yaml
Redis
Zipkin
tracing
Zipkin
Redis
state store
pubsub broker
Redis
My App
Application
http
Classificatie: vertrouwelijk
Hypothetical Demo
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
http
myapp
app-components.yaml
Redis
Zipkin
tracing
Zipkin
Redis
state store
pubsub broker
Redis
My App
Application
MySQL
database
http
Classificatie: vertrouwelijk
The Microservice
API
HTTP REST/JSON
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
µ
Classificatie: vertrouwelijk
The Microservices Platform
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
Runtime Platform
API
µ
API
µ
API
µ
API
µ
Classificatie: vertrouwelijk
The Microservices Platform
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
power cooling
rack
space
physical real estate
IAM
Certificate
Management
Vulnerability
Scanning
Logging
Monitoring Auditing
Cloud Usage
Analysis
Resource
Manager
APIs
Cloud
Events
Notifications Cloud Guard
Tagging
Search
Serverless
Functions
Container
engine
API
Gateway
Load
Balancer
Container
Registry
Artifact
Repository
Job
Scheduling Build & Deploy
Pipelines
Code
Repository
Web Application
Firewall
CDN
Virtual
Machines
API
µ
Classificatie: vertrouwelijk
The Microservices Platform
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
power cooling
rack
space
physical real estate
IAM
Certificate
Management
Vulnerability
Scanning
Logging
Monitoring Auditing
Cloud Usage
Analysis
Resource
Manager
APIs
Cloud
Events
Notifications Cloud Guard
Tagging
Search
SQL
Database Serverless
Functions
Container
engine
Vault
API
Gateway
Load
Balancer
Message/
Event Broker
Data
Lake
Container
Registry
Artifact
Repository
Job
Scheduling Build & Deploy
Pipelines
NoSQL
Database
Data
Cache
Code
Repository
Web Application
Firewall
CDN
Virtual
Machines
File Storage
API
µ
Classificatie: vertrouwelijk
The Microservices Platform
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
power cooling
rack
space
physical real estate
IAM
Certificate
Management
Vulnerability
Scanning
Logging
Monitoring Auditing
Cloud Usage
Analysis
Resource
Manager
APIs
Cloud
Events
Notifications Cloud Guard
Tagging
Search
SQL
Database Serverless
Functions
Container
engine
Vault
API
Gateway
Load
Balancer
Message/
Event Broker
Data
Lake
Container
Registry
Artifact
Repository
Job
Scheduling Build & Deploy
Pipelines
NoSQL
Database
Data
Cache
Code
Repository
Web Application
Firewall
CDN
Virtual
Machines
File Storage
API
µ
Zipin
Classificatie: vertrouwelijk
What do most microservices do?
• Store and retrieve state
• Read runtime secrets and configuration values
• Publish “observability data”
• Subscribe to event topic and handle incoming events
• Publish events to event topic
• Interact with other microservices
• Invoke external services
• Run microservice specific business logic
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
This requires quite a bit of
repetitive “plumbing” tied to
specific technologies
– not meaningful effort
[from a business functionality
perspective]
Classificatie: vertrouwelijk
Dapr
Distributed Application Runtime
quick introduction
Classificatie: vertrouwelijk
Dapr
• Runtime
• Personal Assistant for Applications and Microservices
• Distributed Application Runtime
• Microservice architecture
• Decoupling
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
Classificatie: vertrouwelijk
Dapr.io
• Launched by Microsoft (2019)
• Application runtime framework –
supporting cloud native and serverless
• Every application gets a uniform Personal Assistant
that takes care of common tasks
• remember (take note and reproduce)
• keep log
• restrict access
• handle incoming
• route outgoing
• interact with
other PAs (and
their apps)
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
Application
Microservice or
Monolith
Personal
Assistant
(Dapr)
Personal
Assistant
(Dapr)
Personal
Assistant
(Dapr)
Personal
Assistant
(Dapr)
Personal
Assistant
(Dapr)
Personal
Assistant
(Dapr)
Classificatie: vertrouwelijk
Dapr.io
• Personal Assistant is Dapr Side Car
• companion process or side car container in Kubernetes Pod
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
My App Dapr API
HTTP/gRPC
Application
Dapr sidecar
Classificatie: vertrouwelijk
key value
myApp-weapon "DeathStar"
State management
My App
POST
http://localhost:3500/v1.0/state/corpdb
[{
"key": "weapon",
"value": "DeathStar"
}]
Redis Cache
Classificatie: vertrouwelijk
State management
My App
key value
myApp-weapon "DeathStar"
Redis Cache
GET
http://localhost:3500/v1.0/state/corpdb/planet
"DeathStar"
Classificatie: vertrouwelijk
State management
My App
key value
myApp-weapon "DeathStar"
Azure CosmosDB
GET
http://localhost:3500/v1.0/state/corpdb/planet
"DeathStar"
Classificatie: vertrouwelijk
Dapr state API
Save state
POST /v1.0/state/corpdb
Retrieve state
GET /v1.0/state/corpdb/mystate
Delete state
DELETE /v1.0/state/corpdb/mystate
Get bulk state
POST /v1.0/state/corpdb/bulk
Submit multiple state transactions
POST /v1.0/state/corpdb/transaction
corpdb-redis.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: corpdb
spec:
type: state.redis
version: v1
metadata:
- name: redisHost
value: redis-master.default.svc.cluster.local:6379
- name: redisPassword
secretKeyRef:
name: redis-secret
key: redis-password
Classificatie: vertrouwelijk
Dapr state API
Save state
POST /v1.0/state/corpdb
Retrieve state
GET /v1.0/state/corpdb/mystate
Delete state
DELETE /v1.0/state/corpdb/mystate
Get bulk state
POST /v1.0/state/corpdb/bulk
Submit multiple state transactions
POST /v1.0/state/corpdb/transaction
corpdb-cosmosdb.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: corpdb
spec:
type: state.azure.cosmosdb
version: v1
metadata:
- name: url
value: corpdb.documents.azure.com
- name: masterKey
secretKeyRef:
name: master-key
key: cosmos-key
- name: database
value: orders
- name: collection
value: processed
Classificatie: vertrouwelijk
HTTP API gRPC API
Microservice building blocks
Service-
to-service
invocation
State
management
Publish
and
subscribe
Resource
bindings
and triggers
Actors Observability Secrets Extensible
Classificatie: vertrouwelijk
Standard APIs accessed over http/gRPC protocols from
user service code
Runs as local “side car library” dynamically loaded
at runtime for each service
HTTP API gRPC API
Any language and framework
Application code
Microservices written in
Any code or framework…
Service-
to-service
invocation
State
management
Publish
and
subscribe
Resource
bindings
and triggers
Actors Observability Secrets Application
Configuration
Classificatie: vertrouwelijk
HTTP API gRPC API
Any cloud or edge infrastructure
Application code
Microservices written in
Any code or framework…
Service-
to-service
invocation
State
management
Publish
and
subscribe
Resource
bindings
and triggers
Actors Observability Secrets Application
Configuration
Hosting infrastructure
On-Premises
Azure Arc
Classificatie: vertrouwelijk
Dapr components
My App
Observability
Prometheus AppInsights Jaeger
Zipkin
Bindings
& Triggers
State
Stores
Secret
Stores
PubSub
Brokers
Classificatie: vertrouwelijk
Service invocation
Service A
My App
mDNS
Multicast DNS component for
service discovery
mTLS encryption
POST
http://localhost:3500/v1.0/invoke/servicea/method/neworder
{"data":"Hello World"}
POST
http://10.0.0.2:8000/neworder
{"data":"Hello World"}
Classificatie: vertrouwelijk
Publish and subscribe
Service B
My App Redis
Cache
Service A
POST
http://localhost:3500/v1.0/publish/orders/processed
{"data":"Hello World"}
POST
http://10.0.0.2:8000/orders
http://10.0.0.4:8000/factory/orders
{"data":"Hello World"}
Classificatie: vertrouwelijk
Input triggers
My App
Twitter
POST
http://10.0.0.2:8000/newtweet
{"data":“📢 We are excited
to announce the …"}
Classificatie: vertrouwelijk
Output bindings
My App
Twilio
POST
http://localhost:3500/v1.0/bindings/twilio
{"data":"Hello World"}
Hello World
Classificatie: vertrouwelijk
Secrets
My App
GET
http://localhost:3500/v1.0/secrets/vault/mysecret
"supersecret"
HashiCorp
Vault
key value
mysecret "supersecret"
Classificatie: vertrouwelijk
Host/Pod
Stateful, objects of
storage and compute
Dapr Actor features:
Distribution and failover
Turn-based concurrency
State management
Timers
Reminders
Host/Pod
Video Game
Enemy
Virtually identical to Service Fabric Reliable Actors
Virtual actors
Classificatie: vertrouwelijk
Actor A
Actor C
My
Actor
Pod 1
Actor B
Actor F
Actor E
Actor G
Virtual actors
My App
POST
http://localhost:3500/v1.0/actors/MyActor/A/method/update
{"speed":"1"}
Dapr actor placement
service
Placement
Actor Z
Actor X
My
Actor
Pod 2
Actor Y
Actor U
Actor V
Actor T
Classificatie: vertrouwelijk
Observability
OpenTelemetry collector
Logging &
tracing extensions
My App Redis
Cache
Twitter
Service B
Service A
Classificatie: vertrouwelijk
Metrics
Dapr Metrics features:
Call latency
CPU/memory usage
Error rates
Sidecar injection failures
System health
Built-in monitoring capabilities to
understand the behavior of the
Dapr sidecar and system services
Classificatie: vertrouwelijk
Application Configuration Settings (preview)
Centralized management of configuration settings such as endpoints, hostnames,
filesystem locations, feature toggles.
Applications can consume configuration values and subscribe to change events.
Classificatie: vertrouwelijk
Dapr hosting environments
• Get started with dapr init -k
• Fully managed Dapr control plane
• Deploys dashboard, placement, operator,
sentry, and injector pods
• Automatically inject Dapr sidecar into
all annotated pods
• Upgrade with dapr upgrade or Helm
• Get started with dapr init
• Easy setup with Docker images
• Sets up placement, Zipkin, Redis
• slim-init available without Docker
• Run any application with Dapr sidecar
using dapr run
Self-hosted
Classificatie: vertrouwelijk
Dapr in self-hosted Docker mode
Local dev machine or virtual machine
Zipkin
tracing
Zipkin
Redis
state store
Redis
My App
State Stores
PubSub
Brokers
Secret Stores
Bindings
& Triggers
Observability
Dapr Components
dapr run myapp
Use components
Launch application
Launch sidecar process
Set env variables
Save and retrieve state
Publish and subscribe to messages
Send distributed tracing
Classificatie: vertrouwelijk
Dapr in self-hosted Docker mode – add MySQL Database
Local dev machine or virtual machine
Zipkin
tracing
Zipkin
MySQL
database
Redis
state store
Redis
myotherapp
dapr run --app-id myotherapp --dapr-http-port 3510 --components-path .
Launch application
Launch sidecar process
Set env variables
Save and retrieve state
mysql-statestore.yaml
Classificatie: vertrouwelijk
Dapr on Kubernetes
Any cloud or edge infrastructure
Pod
Actor
partition
placement
Placement
Pod
Dapr
runtime
injector
Injector
Pod
Cert authority
and identity Sentry
Pod
Update
component
changes
Operator
Pod
My App
Kubelet Use components
Inject Dapr sidecar
into annotated pods
Inject env variables
Manage mTLS
between services
Assign spiffe identity
Create mapping table of
actor instances to pods
Manage component updates
Manage Kubernetes
service endpoints
Readiness and Liveness
probe on healthz API to
determine Dapr health state
State Stores
Pub/Sub
Brokers
Secret Stores
Bindings
& Triggers
Observability
Dapr Components
Operator
Deploys and
manages Dapr
Classificatie: vertrouwelijk
Dapr and service meshes
Service Mesh
Operator
Hosting infrastructure
Application code
Any code or
framework…
Traffic splitting
Traffic routing
Distributed tracing
Resiliency
Metrics
mTLS
Service-to-service
invocation
State
management
Publish and
subscribe
Secrets
Resource bindings
and triggers
Actors
Developer
Classificatie: vertrouwelijk
Dapr and Node Applications
• HTTP (or gRPC) with Dapr SideCar
• easier yet: Node SDK for Dapr
• Leverage Dapr and its building blocks for
• simple state management
• simple publication of messages
• subscription to incoming messages
• retrieving secrets
• retrieving configuration data
• invoking external services (database, message broker, store, API)
• register as listener to inbound requests and messages for external
services
• decoupled interaction between microservices – implemented in
potentially very different languages
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
components.yaml
sidecar (the personal assistant)
Node SDK
for Dapr
Observability
Prometheus AppInsights Jaeger
Zipkin
Bindings
& Triggers
GCP
Storage
AWS
S3 Kafka
Azure
Storage Twilio
State
Stores
Firebase Cassandra
Redis
Azure
CosmosDB
AWS
DynamoDB
Secret
Stores
AWS
Secrets Manager
Azure
KeyVault
GCP
Secret Manager
HashiCorp
Vault
Kubernetes
Secret
PubSub
Brokers
Redis
AWS
SQS
Azure
Service Bus
RabbitMQ
GCP
Pub/Sub
Classificatie: vertrouwelijk
Observability
Prometheus AppInsights Jaeger
Zipkin
Bindings
& Triggers
State
Stores
Secret
Stores
PubSub
Brokers
Dapr Architecture
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
Dapr main
state store
interface
pub/sub
interface
binding
interface
secret
interface
register all
components
(per type)
observable
interface
do something for me – store
or retrieve state, subscribe
to topic (and callback with
messages), invoke service,
retrieve secret
components.yaml
Classificatie: vertrouwelijk
State Management with Dapr from Node application
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
sidecar (the personal assistant)
Node SDK
for Dapr
State Store
components
set & get state
components.yaml
State
Stores
state store
interface
Classificatie: vertrouwelijk
State Management with Dapr from Node application
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
sidecar (the personal assistant)
Node SDK
for Dapr
State Store
components
set & get state
components.yaml
State
Stores
state store
interface
connect to
sidecar
retrieve
state
setstate
Classificatie: vertrouwelijk
State Management with Dapr from Node application -
switch to MySQL state store with configuration change
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
sidecar (the personal assistant)
Node SDK
for Dapr
State Store
components
set & get state
components.yaml
State
Stores
state store
interface
connect to
sidecar
retrieve
state
setstate
Classificatie: vertrouwelijk
State Management with Dapr from any application
- either through SDK or using HTTP or gRPC
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
sidecar (the personal assistant)
SDK for
Dapr
State Store
components
set & get state
components.yaml
State
Stores
state store
interface
Classificatie: vertrouwelijk
Pub/Sub with Dapr from Node applications
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
sidecar (the personal assistant)
Node SDK
for Dapr
Pub/Sub
components
publish message
components.yaml
PubSub
Brokers
pub/sub
interface
Node SDK
for Dapr
components.yaml
subscribe on topic
with handler function
message sent to handler
Classificatie: vertrouwelijk
Pub/Sub with Dapr from Node applications
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
sidecar (the personal assistant)
Node SDK
for Dapr
Pub/Sub
components
publish message
components.yaml
PubSub
Brokers
Node SDK
for Dapr
components.yaml
subscribe on topic
with handler function
message sent to handler
pub/sub
interface
publish
message
Classificatie: vertrouwelijk
Pub/Sub with Dapr from Node applications
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
sidecar (the personal assistant)
Node SDK
for Dapr
Pub/Sub
components
publish message
ponents.yaml
PubSub
Brokers
Node SDK
for Dapr
components.yaml
pub/sub
interface
subscribe
on topic
message sent
to handler
Classificatie: vertrouwelijk
Pub/Sub with Dapr from Node applications
Replace Redis by Apache Kafka
Microservices in real life – with Node & Dapr.io
sidecar (the personal assistant)
Node SDK
for Dapr
Pub/Sub
components
publish message
to topic
components.yaml
PubSub
Brokers
pub/sub
interface
Node SDK
for Dapr
components.yaml
subscribe on topic
with handler function
message sent to handler
9094
9093
9092
test-topic
Classificatie: vertrouwelijk
Asynchronous Interaction between Microservices
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
Front App
http
State
Stores
PubSub
Brokers
Node App
get get & set
publish
subscribe
consume
name = John
Classificatie: vertrouwelijk
Telemetry Observation in Zipkin
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
greeter
http
State
Stores
PubSub
Brokers
name-processor
get get & set
publish
subscribe
consume
name = John
Telemetry
Data
Classificatie: vertrouwelijk
Telemetry Observation in Zipkin
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
Telemetry
Data
Front App
http
State
Stores
PubSub
Brokers
Node App
get get & set
publish
subscribe
consume
name = John
Classificatie: vertrouwelijk
Hands On
In a Linux compatible environment with Docker CLI set up
• Download and Install Dapr.io
• with out of the box state management and pub/sub based on Redis and
telemetry observation by Zipkin
• Run Dapr Sidecar
• Explore Dapr State Management APIs
• from the command line (cURL HTTP calls)
• Run MySQL container and have Dapr manage state in a MySQL database
• Explore Dapr Telemetry collection and presentation in Zipkin
• Explore Node and Dapr
• add state management to Node application – through Dapr sidecar
• implement pub/sub for Node applications – through Dapr sidecar
• realize asynchronous communication between Node based microservices
through Daprized pub/sub
• Explore Telemetry for asynchronous interactions
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
Classificatie: vertrouwelijk
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
State
Stores
app.js
get & set
Node SDK
for Dapr
components.yaml
dapr_host,
dapr_http_port
app_port
key value
John
Monty
3
2
name,
instance count
Default, out
of the box
?name=John
Handson
Classificatie: vertrouwelijk
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
Handson
SomeService
Invoker SomeService
echo
Daprized Go application – has
registered an invocation
handler for operation echo
Daprized Node application –
asks its sidecar to invoke
method echo on service
SomeService
mDNS
Multicast DNS component
for service discovery
Classificatie: vertrouwelijk
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
Handson
SomeService
Invoker SomeService
echo
Daprized Go application – has
registered an invocation
handler for operation calculate
{ x: 3.14159,
y: 42,
z: 2.71828 }
mDNS
Multicast DNS component
for service discovery
calculate
{ "outcome":
13618.131,
"comment":
"Greetings" }
Local function
complexCalculation invokes
method calculate on remote
service SomeService
Classificatie: vertrouwelijk
Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
Handson
SomeService
echo
Daprized Go application – has
registered an invocation
handler for operation echo
OtherService
Invoker
Regular, NonDaprized Node
application – asks
SomeService’s sidecar to
invoke method echo – calling
the gRPC port of that sidecar

More Related Content

PPTX
OpenTelemetry For Architects
PPTX
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
PDF
Dapr - A 10x Developer Framework for Any Language
PDF
Grafana overview deck - Tech - 2023 May v1.pdf
PDF
PDSを実現するにあたっての技術動向の紹介 (OAuth, OpenID Connect, UMAなど)
PDF
GitOps 101 Presentation.pdf
PDF
Microservices for Application Modernisation
OpenTelemetry For Architects
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Dapr - A 10x Developer Framework for Any Language
Grafana overview deck - Tech - 2023 May v1.pdf
PDSを実現するにあたっての技術動向の紹介 (OAuth, OpenID Connect, UMAなど)
GitOps 101 Presentation.pdf
Microservices for Application Modernisation

What's hot (20)

PDF
3分でわかるAzureでのService Principal
PDF
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)
PDF
Credential store using HashiCorp Vault
PDF
[오픈소스컨설팅] 서비스 메쉬(Service mesh)
PDF
Istio : Service Mesh
PDF
Observability
PDF
Machine Learning using Kubeflow and Kubernetes
PDF
Vault
PPTX
OpenTelemetry For Operators
PDF
Tracing Micro Services with OpenTracing
PPTX
Keeping a Secret with HashiCorp Vault
PDF
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
PDF
Kubernetes
PDF
Terraform introduction
PDF
Distributed tracing using open tracing & jaeger 2
PPTX
Vault - Secret and Key Management
PDF
Introduction to Kong API Gateway
PDF
Everything You wanted to Know About Distributed Tracing
PDF
카프카, 산전수전 노하우
PDF
OpenTelemetry Introduction
3分でわかるAzureでのService Principal
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)
Credential store using HashiCorp Vault
[오픈소스컨설팅] 서비스 메쉬(Service mesh)
Istio : Service Mesh
Observability
Machine Learning using Kubeflow and Kubernetes
Vault
OpenTelemetry For Operators
Tracing Micro Services with OpenTracing
Keeping a Secret with HashiCorp Vault
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
Kubernetes
Terraform introduction
Distributed tracing using open tracing & jaeger 2
Vault - Secret and Key Management
Introduction to Kong API Gateway
Everything You wanted to Know About Distributed Tracing
카프카, 산전수전 노하우
OpenTelemetry Introduction
Ad

Similar to Introducing Dapr.io - the open source personal assistant to microservices and other applications (Conclusion Code Cafe, april 2022) (20)

PDF
2021 JCConf 使用Dapr簡化Java微服務應用開發
PDF
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
PDF
2015-11-cloudsoft-basho-brooklyn-riak
PDF
What Can I Get You? An Introduction to Dynamic Resource Allocation
PDF
M3D - Metadata Driven Development
PPTX
Open Shift.Run2019 マイクロサービスの開発に疲れる前にdaprを使おう
PDF
Our Hybrid Future: WordPress As Part of the Stack #WCNYC
PPSX
Docker presentation
PDF
K8s Pod Scheduling - Deep Dive. By Tsahi Duek.
PDF
Our Hybrid Future: WordPress As Part of the Stack
PDF
MariaDB on Docker
PPTX
Kubernetes CI/CD with Helm
PDF
DevOps Days Tel Aviv - Serverless Architecture
PPTX
Open shift enterprise 3.1 paas on kubernetes
PDF
Null Dubai Humla_Romansh_Yadav_Android_app_pentesting
PPTX
Android application analyzer
PPTX
Dapr- Distributed Application Runtime
PDF
apidays Helsinki & North 2023 -Design first or first design?, Patrick Brosse,...
PDF
A hitchhiker‘s guide to the cloud native stack
PDF
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
2021 JCConf 使用Dapr簡化Java微服務應用開發
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
2015-11-cloudsoft-basho-brooklyn-riak
What Can I Get You? An Introduction to Dynamic Resource Allocation
M3D - Metadata Driven Development
Open Shift.Run2019 マイクロサービスの開発に疲れる前にdaprを使おう
Our Hybrid Future: WordPress As Part of the Stack #WCNYC
Docker presentation
K8s Pod Scheduling - Deep Dive. By Tsahi Duek.
Our Hybrid Future: WordPress As Part of the Stack
MariaDB on Docker
Kubernetes CI/CD with Helm
DevOps Days Tel Aviv - Serverless Architecture
Open shift enterprise 3.1 paas on kubernetes
Null Dubai Humla_Romansh_Yadav_Android_app_pentesting
Android application analyzer
Dapr- Distributed Application Runtime
apidays Helsinki & North 2023 -Design first or first design?, Patrick Brosse,...
A hitchhiker‘s guide to the cloud native stack
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
Ad

More from Lucas Jellema (20)

PPTX
Introduction to web application development with Vue (for absolute beginners)...
PPTX
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
PPTX
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
PPTX
Apache Superset - open source data exploration and visualization (Conclusion ...
PPTX
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
PPTX
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...
PPTX
Op je vingers tellen... tot 1000!
PPTX
IoT - from prototype to enterprise platform (DigitalXchange 2022)
PPTX
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
PPTX
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...
PPTX
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...
PPTX
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
PPTX
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
PPTX
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...
PPTX
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)
PPTX
Tech Talks 101 - DevOps (jan 2022)
PPTX
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
PPTX
Cloud Native Application Development - build fast, low TCO, scalable & agile ...
PPTX
Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...
PPTX
Triple C - Centralize, Cloudify and Consolidate Dozens of Oracle Databases (O...
Introduction to web application development with Vue (for absolute beginners)...
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
Apache Superset - open source data exploration and visualization (Conclusion ...
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...
Op je vingers tellen... tot 1000!
IoT - from prototype to enterprise platform (DigitalXchange 2022)
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)
Tech Talks 101 - DevOps (jan 2022)
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...
Triple C - Centralize, Cloudify and Consolidate Dozens of Oracle Databases (O...

Recently uploaded (20)

PPTX
CHAPTER 2 - PM Management and IT Context
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
assetexplorer- product-overview - presentation
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
AutoCAD Professional Crack 2025 With License Key
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
medical staffing services at VALiNTRY
CHAPTER 2 - PM Management and IT Context
17 Powerful Integrations Your Next-Gen MLM Software Needs
Operating system designcfffgfgggggggvggggggggg
Computer Software and OS of computer science of grade 11.pptx
assetexplorer- product-overview - presentation
Download FL Studio Crack Latest version 2025 ?
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
AutoCAD Professional Crack 2025 With License Key
Reimagine Home Health with the Power of Agentic AI​
Oracle Fusion HCM Cloud Demo for Beginners
Advanced SystemCare Ultimate Crack + Portable (2025)
Designing Intelligence for the Shop Floor.pdf
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Navsoft: AI-Powered Business Solutions & Custom Software Development
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Internet Downloader Manager (IDM) Crack 6.42 Build 41
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Wondershare Filmora 15 Crack With Activation Key [2025
medical staffing services at VALiNTRY

Introducing Dapr.io - the open source personal assistant to microservices and other applications (Conclusion Code Cafe, april 2022)

  • 1. Classificatie: vertrouwelijk Introductie van Dapr – de open source personal assistant voor applicaties en microservices Conclusion Code Café – Maandag 4 april 2022 Lucas Jellema
  • 2. Classificatie: vertrouwelijk Demo Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices dapr run --app-id myapp --dapr-http-port 3500 http port 3500 myapp default-components.yaml Redis Zipkin tracing Zipkin Redis state store pubsub broker Redis state: redis pubsub: redis OpenTelemetry:
  • 3. Classificatie: vertrouwelijk Demo Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices curl -X POST -H "Content-Type: application/json" -d '[{ "key": "name", "value": "Bruce Wayne"}]' http://localhost:3500/v1.0/state/statestore http port 3500 myapp default-components.yaml Redis Zipkin tracing Zipkin Redis state store pubsub broker Redis statestore pubsub POST key: name value: Bruce Wayne
  • 4. Classificatie: vertrouwelijk Demo Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices curl -X POST -H "Content-Type: application/json" -d '[{ "key": "name", "value": "Bruce Wayne"}]' http://localhost:3500/v1.0/state/statestore http port 3500 myapp default-components.yaml Redis Zipkin tracing Zipkin Redis state store pubsub broker Redis statestore pubsub POST key: name value: Bruce Wayne key: name value: Bruce Wayne
  • 5. Classificatie: vertrouwelijk Demo Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices curl http://localhost:3500/v1.0/state/statestore/name http port 3500 myapp default-components.yaml Redis Zipkin tracing Zipkin Redis state store pubsub broker Redis statestore pubsub GET key: name value: Bruce Wayne
  • 6. Classificatie: vertrouwelijk Demo Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices curl http://localhost:3500/v1.0/state/statestore/name http port 3500 myapp default-components.yaml Redis Zipkin tracing Zipkin Redis state store pubsub broker Redis statestore pubsub GET key: name value: Bruce Wayne “Bruce Wayne”
  • 7. Classificatie: vertrouwelijk Demo Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices http myapp app-components.yaml Redis Zipkin tracing Zipkin Redis state store pubsub broker Redis My App Application http
  • 8. Classificatie: vertrouwelijk Hypothetical Demo Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices http myapp app-components.yaml Redis Zipkin tracing Zipkin Redis state store pubsub broker Redis My App Application MySQL database http
  • 9. Classificatie: vertrouwelijk The Microservice API HTTP REST/JSON Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices µ
  • 10. Classificatie: vertrouwelijk The Microservices Platform Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices Runtime Platform API µ API µ API µ API µ
  • 11. Classificatie: vertrouwelijk The Microservices Platform Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices power cooling rack space physical real estate IAM Certificate Management Vulnerability Scanning Logging Monitoring Auditing Cloud Usage Analysis Resource Manager APIs Cloud Events Notifications Cloud Guard Tagging Search Serverless Functions Container engine API Gateway Load Balancer Container Registry Artifact Repository Job Scheduling Build & Deploy Pipelines Code Repository Web Application Firewall CDN Virtual Machines API µ
  • 12. Classificatie: vertrouwelijk The Microservices Platform Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices power cooling rack space physical real estate IAM Certificate Management Vulnerability Scanning Logging Monitoring Auditing Cloud Usage Analysis Resource Manager APIs Cloud Events Notifications Cloud Guard Tagging Search SQL Database Serverless Functions Container engine Vault API Gateway Load Balancer Message/ Event Broker Data Lake Container Registry Artifact Repository Job Scheduling Build & Deploy Pipelines NoSQL Database Data Cache Code Repository Web Application Firewall CDN Virtual Machines File Storage API µ
  • 13. Classificatie: vertrouwelijk The Microservices Platform Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices power cooling rack space physical real estate IAM Certificate Management Vulnerability Scanning Logging Monitoring Auditing Cloud Usage Analysis Resource Manager APIs Cloud Events Notifications Cloud Guard Tagging Search SQL Database Serverless Functions Container engine Vault API Gateway Load Balancer Message/ Event Broker Data Lake Container Registry Artifact Repository Job Scheduling Build & Deploy Pipelines NoSQL Database Data Cache Code Repository Web Application Firewall CDN Virtual Machines File Storage API µ Zipin
  • 14. Classificatie: vertrouwelijk What do most microservices do? • Store and retrieve state • Read runtime secrets and configuration values • Publish “observability data” • Subscribe to event topic and handle incoming events • Publish events to event topic • Interact with other microservices • Invoke external services • Run microservice specific business logic Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices This requires quite a bit of repetitive “plumbing” tied to specific technologies – not meaningful effort [from a business functionality perspective]
  • 16. Classificatie: vertrouwelijk Dapr • Runtime • Personal Assistant for Applications and Microservices • Distributed Application Runtime • Microservice architecture • Decoupling Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
  • 17. Classificatie: vertrouwelijk Dapr.io • Launched by Microsoft (2019) • Application runtime framework – supporting cloud native and serverless • Every application gets a uniform Personal Assistant that takes care of common tasks • remember (take note and reproduce) • keep log • restrict access • handle incoming • route outgoing • interact with other PAs (and their apps) Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices Application Microservice or Monolith Personal Assistant (Dapr) Personal Assistant (Dapr) Personal Assistant (Dapr) Personal Assistant (Dapr) Personal Assistant (Dapr) Personal Assistant (Dapr)
  • 18. Classificatie: vertrouwelijk Dapr.io • Personal Assistant is Dapr Side Car • companion process or side car container in Kubernetes Pod Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices My App Dapr API HTTP/gRPC Application Dapr sidecar
  • 19. Classificatie: vertrouwelijk key value myApp-weapon "DeathStar" State management My App POST http://localhost:3500/v1.0/state/corpdb [{ "key": "weapon", "value": "DeathStar" }] Redis Cache
  • 20. Classificatie: vertrouwelijk State management My App key value myApp-weapon "DeathStar" Redis Cache GET http://localhost:3500/v1.0/state/corpdb/planet "DeathStar"
  • 21. Classificatie: vertrouwelijk State management My App key value myApp-weapon "DeathStar" Azure CosmosDB GET http://localhost:3500/v1.0/state/corpdb/planet "DeathStar"
  • 22. Classificatie: vertrouwelijk Dapr state API Save state POST /v1.0/state/corpdb Retrieve state GET /v1.0/state/corpdb/mystate Delete state DELETE /v1.0/state/corpdb/mystate Get bulk state POST /v1.0/state/corpdb/bulk Submit multiple state transactions POST /v1.0/state/corpdb/transaction corpdb-redis.yaml apiVersion: dapr.io/v1alpha1 kind: Component metadata: name: corpdb spec: type: state.redis version: v1 metadata: - name: redisHost value: redis-master.default.svc.cluster.local:6379 - name: redisPassword secretKeyRef: name: redis-secret key: redis-password
  • 23. Classificatie: vertrouwelijk Dapr state API Save state POST /v1.0/state/corpdb Retrieve state GET /v1.0/state/corpdb/mystate Delete state DELETE /v1.0/state/corpdb/mystate Get bulk state POST /v1.0/state/corpdb/bulk Submit multiple state transactions POST /v1.0/state/corpdb/transaction corpdb-cosmosdb.yaml apiVersion: dapr.io/v1alpha1 kind: Component metadata: name: corpdb spec: type: state.azure.cosmosdb version: v1 metadata: - name: url value: corpdb.documents.azure.com - name: masterKey secretKeyRef: name: master-key key: cosmos-key - name: database value: orders - name: collection value: processed
  • 24. Classificatie: vertrouwelijk HTTP API gRPC API Microservice building blocks Service- to-service invocation State management Publish and subscribe Resource bindings and triggers Actors Observability Secrets Extensible
  • 25. Classificatie: vertrouwelijk Standard APIs accessed over http/gRPC protocols from user service code Runs as local “side car library” dynamically loaded at runtime for each service HTTP API gRPC API Any language and framework Application code Microservices written in Any code or framework… Service- to-service invocation State management Publish and subscribe Resource bindings and triggers Actors Observability Secrets Application Configuration
  • 26. Classificatie: vertrouwelijk HTTP API gRPC API Any cloud or edge infrastructure Application code Microservices written in Any code or framework… Service- to-service invocation State management Publish and subscribe Resource bindings and triggers Actors Observability Secrets Application Configuration Hosting infrastructure On-Premises Azure Arc
  • 27. Classificatie: vertrouwelijk Dapr components My App Observability Prometheus AppInsights Jaeger Zipkin Bindings & Triggers State Stores Secret Stores PubSub Brokers
  • 28. Classificatie: vertrouwelijk Service invocation Service A My App mDNS Multicast DNS component for service discovery mTLS encryption POST http://localhost:3500/v1.0/invoke/servicea/method/neworder {"data":"Hello World"} POST http://10.0.0.2:8000/neworder {"data":"Hello World"}
  • 29. Classificatie: vertrouwelijk Publish and subscribe Service B My App Redis Cache Service A POST http://localhost:3500/v1.0/publish/orders/processed {"data":"Hello World"} POST http://10.0.0.2:8000/orders http://10.0.0.4:8000/factory/orders {"data":"Hello World"}
  • 30. Classificatie: vertrouwelijk Input triggers My App Twitter POST http://10.0.0.2:8000/newtweet {"data":“📢 We are excited to announce the …"}
  • 31. Classificatie: vertrouwelijk Output bindings My App Twilio POST http://localhost:3500/v1.0/bindings/twilio {"data":"Hello World"} Hello World
  • 33. Classificatie: vertrouwelijk Host/Pod Stateful, objects of storage and compute Dapr Actor features: Distribution and failover Turn-based concurrency State management Timers Reminders Host/Pod Video Game Enemy Virtually identical to Service Fabric Reliable Actors Virtual actors
  • 34. Classificatie: vertrouwelijk Actor A Actor C My Actor Pod 1 Actor B Actor F Actor E Actor G Virtual actors My App POST http://localhost:3500/v1.0/actors/MyActor/A/method/update {"speed":"1"} Dapr actor placement service Placement Actor Z Actor X My Actor Pod 2 Actor Y Actor U Actor V Actor T
  • 35. Classificatie: vertrouwelijk Observability OpenTelemetry collector Logging & tracing extensions My App Redis Cache Twitter Service B Service A
  • 36. Classificatie: vertrouwelijk Metrics Dapr Metrics features: Call latency CPU/memory usage Error rates Sidecar injection failures System health Built-in monitoring capabilities to understand the behavior of the Dapr sidecar and system services
  • 37. Classificatie: vertrouwelijk Application Configuration Settings (preview) Centralized management of configuration settings such as endpoints, hostnames, filesystem locations, feature toggles. Applications can consume configuration values and subscribe to change events.
  • 38. Classificatie: vertrouwelijk Dapr hosting environments • Get started with dapr init -k • Fully managed Dapr control plane • Deploys dashboard, placement, operator, sentry, and injector pods • Automatically inject Dapr sidecar into all annotated pods • Upgrade with dapr upgrade or Helm • Get started with dapr init • Easy setup with Docker images • Sets up placement, Zipkin, Redis • slim-init available without Docker • Run any application with Dapr sidecar using dapr run Self-hosted
  • 39. Classificatie: vertrouwelijk Dapr in self-hosted Docker mode Local dev machine or virtual machine Zipkin tracing Zipkin Redis state store Redis My App State Stores PubSub Brokers Secret Stores Bindings & Triggers Observability Dapr Components dapr run myapp Use components Launch application Launch sidecar process Set env variables Save and retrieve state Publish and subscribe to messages Send distributed tracing
  • 40. Classificatie: vertrouwelijk Dapr in self-hosted Docker mode – add MySQL Database Local dev machine or virtual machine Zipkin tracing Zipkin MySQL database Redis state store Redis myotherapp dapr run --app-id myotherapp --dapr-http-port 3510 --components-path . Launch application Launch sidecar process Set env variables Save and retrieve state mysql-statestore.yaml
  • 41. Classificatie: vertrouwelijk Dapr on Kubernetes Any cloud or edge infrastructure Pod Actor partition placement Placement Pod Dapr runtime injector Injector Pod Cert authority and identity Sentry Pod Update component changes Operator Pod My App Kubelet Use components Inject Dapr sidecar into annotated pods Inject env variables Manage mTLS between services Assign spiffe identity Create mapping table of actor instances to pods Manage component updates Manage Kubernetes service endpoints Readiness and Liveness probe on healthz API to determine Dapr health state State Stores Pub/Sub Brokers Secret Stores Bindings & Triggers Observability Dapr Components Operator Deploys and manages Dapr
  • 42. Classificatie: vertrouwelijk Dapr and service meshes Service Mesh Operator Hosting infrastructure Application code Any code or framework… Traffic splitting Traffic routing Distributed tracing Resiliency Metrics mTLS Service-to-service invocation State management Publish and subscribe Secrets Resource bindings and triggers Actors Developer
  • 43. Classificatie: vertrouwelijk Dapr and Node Applications • HTTP (or gRPC) with Dapr SideCar • easier yet: Node SDK for Dapr • Leverage Dapr and its building blocks for • simple state management • simple publication of messages • subscription to incoming messages • retrieving secrets • retrieving configuration data • invoking external services (database, message broker, store, API) • register as listener to inbound requests and messages for external services • decoupled interaction between microservices – implemented in potentially very different languages Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices components.yaml sidecar (the personal assistant) Node SDK for Dapr Observability Prometheus AppInsights Jaeger Zipkin Bindings & Triggers GCP Storage AWS S3 Kafka Azure Storage Twilio State Stores Firebase Cassandra Redis Azure CosmosDB AWS DynamoDB Secret Stores AWS Secrets Manager Azure KeyVault GCP Secret Manager HashiCorp Vault Kubernetes Secret PubSub Brokers Redis AWS SQS Azure Service Bus RabbitMQ GCP Pub/Sub
  • 44. Classificatie: vertrouwelijk Observability Prometheus AppInsights Jaeger Zipkin Bindings & Triggers State Stores Secret Stores PubSub Brokers Dapr Architecture Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices Dapr main state store interface pub/sub interface binding interface secret interface register all components (per type) observable interface do something for me – store or retrieve state, subscribe to topic (and callback with messages), invoke service, retrieve secret components.yaml
  • 45. Classificatie: vertrouwelijk State Management with Dapr from Node application Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices sidecar (the personal assistant) Node SDK for Dapr State Store components set & get state components.yaml State Stores state store interface
  • 46. Classificatie: vertrouwelijk State Management with Dapr from Node application Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices sidecar (the personal assistant) Node SDK for Dapr State Store components set & get state components.yaml State Stores state store interface connect to sidecar retrieve state setstate
  • 47. Classificatie: vertrouwelijk State Management with Dapr from Node application - switch to MySQL state store with configuration change Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices sidecar (the personal assistant) Node SDK for Dapr State Store components set & get state components.yaml State Stores state store interface connect to sidecar retrieve state setstate
  • 48. Classificatie: vertrouwelijk State Management with Dapr from any application - either through SDK or using HTTP or gRPC Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices sidecar (the personal assistant) SDK for Dapr State Store components set & get state components.yaml State Stores state store interface
  • 49. Classificatie: vertrouwelijk Pub/Sub with Dapr from Node applications Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices sidecar (the personal assistant) Node SDK for Dapr Pub/Sub components publish message components.yaml PubSub Brokers pub/sub interface Node SDK for Dapr components.yaml subscribe on topic with handler function message sent to handler
  • 50. Classificatie: vertrouwelijk Pub/Sub with Dapr from Node applications Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices sidecar (the personal assistant) Node SDK for Dapr Pub/Sub components publish message components.yaml PubSub Brokers Node SDK for Dapr components.yaml subscribe on topic with handler function message sent to handler pub/sub interface publish message
  • 51. Classificatie: vertrouwelijk Pub/Sub with Dapr from Node applications Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices sidecar (the personal assistant) Node SDK for Dapr Pub/Sub components publish message ponents.yaml PubSub Brokers Node SDK for Dapr components.yaml pub/sub interface subscribe on topic message sent to handler
  • 52. Classificatie: vertrouwelijk Pub/Sub with Dapr from Node applications Replace Redis by Apache Kafka Microservices in real life – with Node & Dapr.io sidecar (the personal assistant) Node SDK for Dapr Pub/Sub components publish message to topic components.yaml PubSub Brokers pub/sub interface Node SDK for Dapr components.yaml subscribe on topic with handler function message sent to handler 9094 9093 9092 test-topic
  • 53. Classificatie: vertrouwelijk Asynchronous Interaction between Microservices Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices Front App http State Stores PubSub Brokers Node App get get & set publish subscribe consume name = John
  • 54. Classificatie: vertrouwelijk Telemetry Observation in Zipkin Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices greeter http State Stores PubSub Brokers name-processor get get & set publish subscribe consume name = John Telemetry Data
  • 55. Classificatie: vertrouwelijk Telemetry Observation in Zipkin Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices Telemetry Data Front App http State Stores PubSub Brokers Node App get get & set publish subscribe consume name = John
  • 56. Classificatie: vertrouwelijk Hands On In a Linux compatible environment with Docker CLI set up • Download and Install Dapr.io • with out of the box state management and pub/sub based on Redis and telemetry observation by Zipkin • Run Dapr Sidecar • Explore Dapr State Management APIs • from the command line (cURL HTTP calls) • Run MySQL container and have Dapr manage state in a MySQL database • Explore Dapr Telemetry collection and presentation in Zipkin • Explore Node and Dapr • add state management to Node application – through Dapr sidecar • implement pub/sub for Node applications – through Dapr sidecar • realize asynchronous communication between Node based microservices through Daprized pub/sub • Explore Telemetry for asynchronous interactions Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices
  • 57. Classificatie: vertrouwelijk Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices State Stores app.js get & set Node SDK for Dapr components.yaml dapr_host, dapr_http_port app_port key value John Monty 3 2 name, instance count Default, out of the box ?name=John Handson
  • 58. Classificatie: vertrouwelijk Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices Handson SomeService Invoker SomeService echo Daprized Go application – has registered an invocation handler for operation echo Daprized Node application – asks its sidecar to invoke method echo on service SomeService mDNS Multicast DNS component for service discovery
  • 59. Classificatie: vertrouwelijk Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices Handson SomeService Invoker SomeService echo Daprized Go application – has registered an invocation handler for operation calculate { x: 3.14159, y: 42, z: 2.71828 } mDNS Multicast DNS component for service discovery calculate { "outcome": 13618.131, "comment": "Greetings" } Local function complexCalculation invokes method calculate on remote service SomeService
  • 60. Classificatie: vertrouwelijk Code Café - 4 april 2022 - Dapr - Open Source Personal Assistant voor Microservices Handson SomeService echo Daprized Go application – has registered an invocation handler for operation echo OtherService Invoker Regular, NonDaprized Node application – asks SomeService’s sidecar to invoke method echo – calling the gRPC port of that sidecar

Editor's Notes

  • #57: https://github.com/lucasjellema/fontys-2022-microservices-kafka-dapr