SlideShare une entreprise Scribd logo
1  sur  81
Classificatie: vertrouwelijk
Microservices in
real life –
with Node &
Dapr.io
March 2022
Lucas Jellema
Architect & CTO AMIS | Conclusion
labs: https://github.com/lucasjellema/fontys-2022-microservices-kafka-dapr
Classificatie: vertrouwelijk
Microservices in real life – with Node & Dapr.io
Founded in 1991 by students
from University of Twente –
Aircraft Maintenance Information
System (AMIS)
80 colleagues,
located in
Nieuwegein
the core of what we do:
working with Data.
partnering with peers
and companies in
several countries
Lucas Jellema (2002)
Cloud Solution Architect & CTO
lucas.jellema@amis.nl | technology.amis.nl | @lucasjellema | lucas-jellema
Classificatie: vertrouwelijk
Microservices in real life – with Node & Dapr.io
Data Engineering, Data Analytics
(& Data Science)
Data &
Application
Integration
web
applications
Internet of Things
cloud, DevOps, PaaS,
streaming, microservices,
Software Studio, database,
software engineering
Oracle, Microsoft Azure,
open source, Java, SQL,
NodeJS, Python,
React/Angular
Classificatie: vertrouwelijk
Microservices in real life – with Node & Dapr.io
Classificatie: vertrouwelijk
Microservices in real life – with Node & Dapr.io
Classificatie: vertrouwelijk
Microservices in real life – with Node & Dapr.io
Classificatie: vertrouwelijk
Microservices in real life – with Node & Dapr.io
Classificatie: vertrouwelijk
Microservices in real life – with Node & Dapr.io
and you are invited to come do an internship and explore job opportunities with us!
Classificatie: Public
Publiek
Moving On. Our Main Story today (and next week)
• Applications
• more specifically:
Microservices – the best form of applications we have come up with so far
• How they are designed
• How they interact
• How they can be implemented
• Using:
• Dapr.io – distributed application runtime
• Node – popular, full stack, omnipresent programming language
• Apache Kafka – distributed message broker, enterprise backbone
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Overview
• Part One (today)
• Microservices recap
• Dapr.io – personal assistant for applications & distributed application runtime
• Handson with Dapr.io
• Quick Intro to programming in Node[.js]
• Handson Microservice implementation with Node and Dapr.io
• Part Two (next week, 30 March)
• Asynchronous interactions through Apache Kafka
• Handson with Apache Kafka and Node
• Real world use cases and scenarios with Apache Kafka
• Handson Multi-microservice set up with Apache Kafka, Node and Dapr.io
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Assumed is
• A development environment with VS Code, Docker and the ability to install
• Knowledge of
• HTTP, REST, JSON
• Containers, Docker (and Kubernetes)
• Java or C#
• SQL and a database (MySQL or PostgreSQL or SQL Server)
• perhaps Message Broker/Event Queue (RabbitMQ?), Cache (Redis?)
• Cloud fundamentals
• Microservices concepts
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
What is an Application?
• Collection of (business) functionality
• implemented with COTS, code, platform & infra
Microservices in real life – with Node & Dapr.io
standard custom
Compute (Containers, VMs, bare
metal servers)
Storage Network
Database
IAM/
LDAP
Event / Message
Broker
Web
Server
API
Gateway
Data Center Power Cooling
Custom
hardware
Custom
platform
Operating System
Language Runtime
use as is
out of the box
(pre-)integrated
application
platform, to be
custom configured
best of breed
applications per
functional domain.
(custom
integration)
low code tools
for workflow,
automation,
integration en
frontends
high code technology
for bit & pixel perfect
software with tailored
fit (functionally & non-
functionally)
Classificatie: Public
Publiek
What is a microservice?
• Why is a microservice?
• Problems with (BIG) applications
• complex
• inflexible to change (when roll out changes)
• long test, long build
• impossible to upgrade technology (everything is affected)
• hard to scale
• hard to migrate (to different technology)
• hard to learn (for new staff)
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Final Demo
• Microservice
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
What is a microservice?
• Not TOO big (but not too small either)
• understandable by normal human beings – easy to on board new team members
• easy to change – allow for agile functional and non functional evolution
• functionally cohesive/logical collection of features => domain
• design time decoupled, clear standards based external interfaces: API & events
• low external impact of: change, refactor, move, migrate, scale, failure
• reliable, robust, resilient
• clear ownership (business sponsor; one IT team builds it, runs it, evolves it)
• contains everything needed to run [on a generic platform]
• application software, libraries/frameworks, platform configuration
• pipelines for CI and CD, tests, documentation, infra as code
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
What is IT all about?
Application
Production Runtime
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
What is IT all about?
Application
Production Runtime
Platform
Microservices in real life – with Node & Dapr.io
Business
value
Classificatie: Public
Publiek
What is IT all about?
Application
Platform
Production Runtime
Operations
Monitoring &
Management
Platform
Platform
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Production Runtime is the Result of Preparation Runtime
Application
Platform
Production Runtime
Operations
Monitoring &
Management
Application
Preparation Runtime
Platform
Development
CD
Agile Design,
Build, Test
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
One team has Agile responsibility through full lifecyle
Application
Platform
Production Runtime
Operations
Monitoring &
Management
Application
Preparation Runtime
Platform
Development
CD
Agile Design,
Build, Test
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
One team has Agile responsibility through full lifecyle
Application
Platform
Production Runtime
Operations
Monitoring &
Management
Application
Preparation Runtime
Platform
Development
CD
Agile Design,
Build, Test
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
One team has Agile responsibility through full lifecyle
Application
Platform
Application
Platform
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
A microservice is owned by one team through its full lifecyle
Microservice
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
The Microservice
API
HTTP REST/JSON
Microservices in real life – with Node & Dapr.io
µ
Classificatie: Public
Publiek
Independent microservices and an integrated front end
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Independent microservices and an integrated front end
Microservices in real life – with Node & Dapr.io
microservice / team
Classificatie: Public
Publiek
The Microservices Platform
Microservices in real life – with Node & Dapr.io
Runtime Platform
API
µ
API
µ
API
µ
API
µ
Classificatie: Public
Publiek
The Microservices Platform
Cloud Native Application Development- on Oracle Cloud | APAC OGB Tour 2021
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: Public
Publiek
The Microservices Platform
Cloud Native Application Development- on Oracle Cloud | APAC OGB Tour 2021
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: Public
Publiek
The Microservices Platform
Cloud Native Application Development- on Oracle Cloud | APAC OGB Tour 2021
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: Public
Publiek
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
Microservices in real life – with Node & Dapr.io
This requires quite a bit of
repetitive “plumbing” tied to
specific technologies
– not meaningful effort
[from a business functionality
perspective]
Classificatie: Public
Publiek
Dapr
Distributed Application Runtime
quick introduction
Classificatie: Public
Publiek
Dapr
• Runtime
• Personal Assistant for Applications and Microservices
• Distributed Application Runtime
• Microservice architecture
• Decoupling
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
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)
Microservices in real life – with Node & Dapr.io
Application
Microservice or
Monolith
Personal
Assistant
(Dapr)
Personal
Assistant
(Dapr)
Personal
Assistant
(Dapr)
Personal
Assistant
(Dapr)
Personal
Assistant
(Dapr)
Personal
Assistant
(Dapr)
Classificatie: Public
Publiek
Dapr.io
• Personal Assistant is Dapr Side Car
• companion process or side car container in Kubernetes Pod
Microservices in real life – with Node & Dapr.io
My App Dapr API
HTTP/gRPC
Application
Dapr sidecar
Classificatie: Public
Publiek
key value
myApp-weapon "DeathStar"
State management
My App
POST
http://localhost:3500/v1.0/state/corpdb
[{
"key": "weapon",
"value": "DeathStar"
}]
Redis Cache
Classificatie: Public
Publiek
State management
My App
key value
myApp-weapon "DeathStar"
Redis Cache
GET
http://localhost:3500/v1.0/state/corpdb/planet
"DeathStar"
Classificatie: Public
Publiek
State management
My App
key value
myApp-weapon "DeathStar"
Azure CosmosDB
GET
http://localhost:3500/v1.0/state/corpdb/planet
"DeathStar"
Classificatie: Public
Publiek
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: Public
Publiek
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: Public
Publiek
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: Public
Publiek
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 Extensible
Classificatie: Public
Publiek
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 Extensible
Hosting infrastructure
On-Premises
Azure Arc
Classificatie: Public
Publiek
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: Public
Publiek
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: Public
Publiek
Input triggers
My App
Twitter
POST
http://10.0.0.2:8000/newtweet
{"data":“📢 We are excited
to announce the …"}
Classificatie: Public
Publiek
Output bindings
My App
Twilio
POST
http://localhost:3500/v1.0/bindings/twilio
{"data":"Hello World"}
Hello World
Classificatie: Public
Publiek
Secrets
My App
GET
http://localhost:3500/v1.0/secrets/vault/mysecret
"supersecret"
HashiCorp
Vault
key value
mysecret "supersecret"
Classificatie: Public
Publiek
Observability
OpenTelemetry collector
Logging &
tracing extensions
My App Redis
Cache
Twitter
Service B
Service A
Classificatie: Public
Publiek
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: Public
Publiek
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: Public
Publiek
Hands On Lab 1
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
Microservices in real life – with Node & Dapr.io
labs: https://github.com/lucasjellema/fontys-2022-microservices-kafka-dapr
Classificatie: Public
Publiek
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
daprdapr 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
Introduction
Node
Classificatie: Public
Publiek
General Purpose Programming Languages
• C & C++
• COBOL, Fortran, ALGOL, BASIC, Pascal
• SmallTalk
• Visual Basic
• Python
• PHP, Perl, Ruby
• Java
• JavaScript (ECMAScript, ES)
• C#
• Go
• Kotlin
• Rust
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Node == Server Side JavaScript
• Script: Not statically typed, not compiled – interpreted at runtime
• Node(JS) – open source, runtime based on Chrome V8 JavaScript engine
• initial release: 2009
• Full stack development – server side and client side can leverage JavaScript
• for example: MEAN stack (MongoDB, Express, Angular, NodeJS)
• Light weight, quick startup, support for high concurrency
• Skills widely available, many resources, tools and libraries
• Easy to get started, quite high productivity and fun factor
• Functions are primary citizens – functional programming
well supported
• Quite suitable for microservices –
including containerized and serverless
• Available everywhere – cross platform, all public clouds
• Note: TypeScript compiles to Node that is interpreted at runtime
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Introducing Node – Single Thread model
• Multi-thread languages – such as Java –
typically block when file system or network operations take place
• Parallel processing continues in parallel threads
• Threads consume resources and are only somewhat scalable
• JavaScript has a main (single thread) event loop and uses
asynchronous processing
• Non-blocking handling of file system
interactions, HTTP calls, network
operations and other blocking actions
• Scalable, very quick startup
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Introducing Node - NPM
• NPM = Node Package Manager
• To include libraries from the ecosystem
• Leverages npm registry (> 1.3M NPM Modules available)
• Acquired by Microsoft – March 2020
• To build and run Node applications
• similar to Maven & Gradle (Java)
or pip (Python)
• Yarn and Turbo are popular
alternatives
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Hello World in Node
• app.js
• with the code to execute
• (optional) package.json
• with NPM dependencies, build and run configuration
(compare Maven pom.xml)
• Create Node application:
• npm init (optional, you can just create a text file by hand instead)
• Run Node application
• node app.js
• npm start
• Add dependencies
• npm install <name of module> --save
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Functions
• Functions
• have a name
• take zero, one or multiple untyped input parameters
• return zero or one untyped result
• or an exception instead of a result
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Functions
• Function references
• can be assigned to a variable
• can be passed around
• can be invoked
• Note: function name without
parentheses is not a call to the
function but a reference
• print vs print()
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Functions
• Function references can be
closures – function + state
• closures contain values of
local context at the time
of instantiation
Microservices in real life – with Node & Dapr.io
Hello 1
World 2
Classificatie: Public
Publiek
Require – to import a module
• Node contains many out of the box modules
• for example: file, os, http, stream, crypto, net, url
• The NPM package manager adds more than 1M modules to make us of
• You can create your own (reusable) modules
• To access elements from a module, that module needs to be identified,
using: const <logical name> = require('module name')
• Module name can be reference to a local file, to a global module or to the
name of a module defined in package.json (and installed in the
application’s node-modules directory)
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Node – Asynchronous calls
• JavaScript is single threaded – no parallel threads can be started from your
code
• Any action in Node that requires network or file system interaction is
typically performed asynchronously:
• the command is started and handed to the
Node background processes;
the main thread continues with other work
• when the background processes have completed
the task, the results are returned to the invoker
(when the main thread has an opening)
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Node – Asynchronous HTTP calls
• Many modules are available
for HTTP communications
from Node
• The standard HTTP
module is not the most
convenient
• An HTTP request is
processed asynchronously in
all cases
• main program loop
proceeds while request is
made
Microservices in real life – with Node & Dapr.io
asynchronous HTTP request
response
Classificatie: Public
Publiek
Asynchronous –
waiting for one or more asynchronous results
• A function is declared to be asynchronous using the async keyword
• The result of an asynchronous function is an object of type Promise
• in order to get the actual value – the Promise must be “resolved”
• this can be waited for using the keyword await
• Alternatively – especially when multiple asynchronous results are waited for at the
same time – we can use Promise.then( <callback function>) or Promise.all(
<callback function>) to wait for Promise results to come available
Microservices in real life – with Node & Dapr.io
Classificatie: Public
Publiek
Hello World Web Application
• Node is very good at handling HTTP Requests
• It is a great technology to implement REST APIs and backends for Web and Mobile applications
• fast, scalable, easy to develop and to deploy
Microservices in real life – with Node & Dapr.io
define the function that
handles each HTTP
request and prepares the
response
Classificatie: Public
Publiek
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
Microservices in real life – with Node & Dapr.io
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: Public
Publiek
State Management with Dapr from Node application
Microservices in real life – with Node & Dapr.io
sidecar (the personal assistant)
Node SDK
for Dapr
State Store
components
set & get state
components.yaml
State
Stores
state store
interface
Classificatie: Public
Publiek
State Management with Dapr from Node application
Microservices in real life – with Node & Dapr.io
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: Public
Publiek
State Management with Dapr from Node application -
switch to MySQL state store with configuration change
Microservices in real life – with Node & Dapr.io
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: Public
Publiek
State Management with Dapr from any application
- either through SDK or using HTTP or gRPC
Microservices in real life – with Node & Dapr.io
sidecar (the personal assistant)
SDK for
Dapr
State Store
components
set & get state
components.yaml
State
Stores
state store
interface
Classificatie: Public
Publiek
Pub/Sub with Dapr from Node applications
Microservices in real life – with Node & Dapr.io
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: Public
Publiek
Pub/Sub with Dapr from Node applications
Microservices in real life – with Node & Dapr.io
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: Public
Publiek
Pub/Sub with Dapr from Node applications
Microservices in real life – with Node & Dapr.io
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: Public
Publiek
Asynchronous Interaction between Microservices
Microservices in real life – with Node & Dapr.io
Front App
http
State
Stores
PubSub
Brokers
Node App
get get & set
publish
subscribe
consume
name = John
Classificatie: Public
Publiek
Telemetry Observation in Zipkin
Microservices in real life – with Node & Dapr.io
greeter
http
State
Stores
PubSub
Brokers
name-processor
get get & set
publish
subscribe
consume
name = John
Telemetry
Data
Classificatie: Public
Publiek
Telemetry Observation in Zipkin
Microservices in real life – with Node & Dapr.io
Telemetry
Data
Front App
http
State
Stores
PubSub
Brokers
Node App
get get & set
publish
subscribe
consume
name = John
Classificatie: Public
Publiek
Handson Lab 2
• Install Node (and npm) runtime
• Explore Node
• hello world
• functions
• asynchronous
• http server
• 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
Microservices in real life – with Node & Dapr.io
labs: https://github.com/lucasjellema/fontys-2022-microservices-kafka-dapr
Classificatie: Public
Publiek
Microservices in real life – with Node & Dapr.io
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 Lab 2
Classificatie: vertrouwelijk
Microservices in
real life –
with Node &
Dapr.io &
30 March 2022
Lucas Jellema
Architect & CTO AMIS | Conclusion
Next Week:
Apache Kafka

Contenu connexe

Tendances

Tendances (20)

Network Service Mesh
Network Service MeshNetwork Service Mesh
Network Service Mesh
 
클라우드 컴퓨팅 기반 기술과 오픈스택(Kvm) 기반 Provisioning
클라우드 컴퓨팅 기반 기술과 오픈스택(Kvm) 기반 Provisioning 클라우드 컴퓨팅 기반 기술과 오픈스택(Kvm) 기반 Provisioning
클라우드 컴퓨팅 기반 기술과 오픈스택(Kvm) 기반 Provisioning
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton
 
stupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdfstupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdf
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Introduction to Docker - 2017
Introduction to Docker - 2017Introduction to Docker - 2017
Introduction to Docker - 2017
 
Grafana Loki: like Prometheus, but for Logs
Grafana Loki: like Prometheus, but for LogsGrafana Loki: like Prometheus, but for Logs
Grafana Loki: like Prometheus, but for Logs
 
[OpenInfra Days Korea 2018] (Track 2) Neutron LBaaS 어디까지 왔니? - Octavia 소개
[OpenInfra Days Korea 2018] (Track 2) Neutron LBaaS 어디까지 왔니? - Octavia 소개[OpenInfra Days Korea 2018] (Track 2) Neutron LBaaS 어디까지 왔니? - Octavia 소개
[OpenInfra Days Korea 2018] (Track 2) Neutron LBaaS 어디까지 왔니? - Octavia 소개
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps
 
20명 규모의 팀에서 Vault 사용하기
20명 규모의 팀에서 Vault 사용하기20명 규모의 팀에서 Vault 사용하기
20명 규모의 팀에서 Vault 사용하기
 
Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with Prometheus
 
Introduction to Spring Cloud
Introduction to Spring Cloud           Introduction to Spring Cloud
Introduction to Spring Cloud
 
2019 DevSecOps Reference Architectures
2019 DevSecOps Reference Architectures2019 DevSecOps Reference Architectures
2019 DevSecOps Reference Architectures
 
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
 

Similaire à Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)

Optimizing the Ops in DevOps
Optimizing the Ops in DevOpsOptimizing the Ops in DevOps
Optimizing the Ops in DevOps
Gordon Haff
 
Meetup Devops-Geneva-19.10.2019
Meetup Devops-Geneva-19.10.2019Meetup Devops-Geneva-19.10.2019
Meetup Devops-Geneva-19.10.2019
Hidora
 

Similaire à Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022) (20)

Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...
 
Optimizing the Ops in DevOps
Optimizing the Ops in DevOpsOptimizing the Ops in DevOps
Optimizing the Ops in DevOps
 
56k.cloud intro and pitch deck
56k.cloud intro and pitch deck56k.cloud intro and pitch deck
56k.cloud intro and pitch deck
 
OpenStack and Cloud Foundry - Pair the leading open source IaaS and PaaS
OpenStack and Cloud Foundry - Pair the leading open source IaaS and PaaSOpenStack and Cloud Foundry - Pair the leading open source IaaS and PaaS
OpenStack and Cloud Foundry - Pair the leading open source IaaS and PaaS
 
Microservices in the Enterprise
Microservices in the Enterprise Microservices in the Enterprise
Microservices in the Enterprise
 
A Hitchhiker's Guide to the Cloud Native Stack
A Hitchhiker's Guide to the Cloud Native StackA Hitchhiker's Guide to the Cloud Native Stack
A Hitchhiker's Guide to the Cloud Native Stack
 
A Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPL
A Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPLA Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPL
A Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPL
 
Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015
 
infrastructure management at digital ages
infrastructure management at digital agesinfrastructure management at digital ages
infrastructure management at digital ages
 
Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday
 
The Future of Cloud Innovation, featuring Adrian Cockcroft
The Future of Cloud Innovation, featuring Adrian CockcroftThe Future of Cloud Innovation, featuring Adrian Cockcroft
The Future of Cloud Innovation, featuring Adrian Cockcroft
 
Containers and microservices create new performance challenges kowall - app...
Containers and microservices create new performance challenges   kowall - app...Containers and microservices create new performance challenges   kowall - app...
Containers and microservices create new performance challenges kowall - app...
 
AppSphere 15 - Containers and Microservices Create New Performance Challenges
AppSphere 15 - Containers and Microservices Create New Performance ChallengesAppSphere 15 - Containers and Microservices Create New Performance Challenges
AppSphere 15 - Containers and Microservices Create New Performance Challenges
 
Oracle Cloud Native
Oracle Cloud NativeOracle Cloud Native
Oracle Cloud Native
 
Cloud Native Application Development
Cloud Native Application DevelopmentCloud Native Application Development
Cloud Native Application Development
 
Docker Orchestration: Welcome to the Jungle! JavaOne 2015
Docker Orchestration: Welcome to the Jungle! JavaOne 2015Docker Orchestration: Welcome to the Jungle! JavaOne 2015
Docker Orchestration: Welcome to the Jungle! JavaOne 2015
 
CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018
 
56k.cloud training
56k.cloud training56k.cloud training
56k.cloud training
 
.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles
 
Meetup Devops-Geneva-19.10.2019
Meetup Devops-Geneva-19.10.2019Meetup Devops-Geneva-19.10.2019
Meetup Devops-Geneva-19.10.2019
 

Plus de Lucas Jellema

Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
Lucas Jellema
 
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...
Help me move away from Oracle - or not?!  (Oracle Community Tour EMEA - LVOUG...Help me move away from Oracle - or not?!  (Oracle Community Tour EMEA - LVOUG...
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...
Lucas Jellema
 
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Lucas Jellema
 
Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...
Lucas Jellema
 
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
Lucas Jellema
 
Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Cloud Native Application Development - build fast, low TCO, scalable & agile ...Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Lucas Jellema
 
Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...
Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...
Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...
Lucas Jellema
 
Triple C - Centralize, Cloudify and Consolidate Dozens of Oracle Databases (O...
Triple C - Centralize, Cloudify and Consolidate Dozens of Oracle Databases (O...Triple C - Centralize, Cloudify and Consolidate Dozens of Oracle Databases (O...
Triple C - Centralize, Cloudify and Consolidate Dozens of Oracle Databases (O...
Lucas Jellema
 

Plus de Lucas Jellema (20)

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

Dernier

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Dernier (20)

MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 

Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)

  • 1. Classificatie: vertrouwelijk Microservices in real life – with Node & Dapr.io March 2022 Lucas Jellema Architect & CTO AMIS | Conclusion labs: https://github.com/lucasjellema/fontys-2022-microservices-kafka-dapr
  • 2. Classificatie: vertrouwelijk Microservices in real life – with Node & Dapr.io Founded in 1991 by students from University of Twente – Aircraft Maintenance Information System (AMIS) 80 colleagues, located in Nieuwegein the core of what we do: working with Data. partnering with peers and companies in several countries Lucas Jellema (2002) Cloud Solution Architect & CTO lucas.jellema@amis.nl | technology.amis.nl | @lucasjellema | lucas-jellema
  • 3. Classificatie: vertrouwelijk Microservices in real life – with Node & Dapr.io Data Engineering, Data Analytics (& Data Science) Data & Application Integration web applications Internet of Things cloud, DevOps, PaaS, streaming, microservices, Software Studio, database, software engineering Oracle, Microsoft Azure, open source, Java, SQL, NodeJS, Python, React/Angular
  • 4. Classificatie: vertrouwelijk Microservices in real life – with Node & Dapr.io
  • 5. Classificatie: vertrouwelijk Microservices in real life – with Node & Dapr.io
  • 6. Classificatie: vertrouwelijk Microservices in real life – with Node & Dapr.io
  • 7. Classificatie: vertrouwelijk Microservices in real life – with Node & Dapr.io
  • 8. Classificatie: vertrouwelijk Microservices in real life – with Node & Dapr.io and you are invited to come do an internship and explore job opportunities with us!
  • 9. Classificatie: Public Publiek Moving On. Our Main Story today (and next week) • Applications • more specifically: Microservices – the best form of applications we have come up with so far • How they are designed • How they interact • How they can be implemented • Using: • Dapr.io – distributed application runtime • Node – popular, full stack, omnipresent programming language • Apache Kafka – distributed message broker, enterprise backbone Microservices in real life – with Node & Dapr.io
  • 10. Classificatie: Public Publiek Overview • Part One (today) • Microservices recap • Dapr.io – personal assistant for applications & distributed application runtime • Handson with Dapr.io • Quick Intro to programming in Node[.js] • Handson Microservice implementation with Node and Dapr.io • Part Two (next week, 30 March) • Asynchronous interactions through Apache Kafka • Handson with Apache Kafka and Node • Real world use cases and scenarios with Apache Kafka • Handson Multi-microservice set up with Apache Kafka, Node and Dapr.io Microservices in real life – with Node & Dapr.io
  • 11. Classificatie: Public Publiek Assumed is • A development environment with VS Code, Docker and the ability to install • Knowledge of • HTTP, REST, JSON • Containers, Docker (and Kubernetes) • Java or C# • SQL and a database (MySQL or PostgreSQL or SQL Server) • perhaps Message Broker/Event Queue (RabbitMQ?), Cache (Redis?) • Cloud fundamentals • Microservices concepts Microservices in real life – with Node & Dapr.io
  • 12. Classificatie: Public Publiek What is an Application? • Collection of (business) functionality • implemented with COTS, code, platform & infra Microservices in real life – with Node & Dapr.io standard custom Compute (Containers, VMs, bare metal servers) Storage Network Database IAM/ LDAP Event / Message Broker Web Server API Gateway Data Center Power Cooling Custom hardware Custom platform Operating System Language Runtime use as is out of the box (pre-)integrated application platform, to be custom configured best of breed applications per functional domain. (custom integration) low code tools for workflow, automation, integration en frontends high code technology for bit & pixel perfect software with tailored fit (functionally & non- functionally)
  • 13. Classificatie: Public Publiek What is a microservice? • Why is a microservice? • Problems with (BIG) applications • complex • inflexible to change (when roll out changes) • long test, long build • impossible to upgrade technology (everything is affected) • hard to scale • hard to migrate (to different technology) • hard to learn (for new staff) Microservices in real life – with Node & Dapr.io
  • 14. Classificatie: Public Publiek Final Demo • Microservice Microservices in real life – with Node & Dapr.io
  • 15. Classificatie: Public Publiek What is a microservice? • Not TOO big (but not too small either) • understandable by normal human beings – easy to on board new team members • easy to change – allow for agile functional and non functional evolution • functionally cohesive/logical collection of features => domain • design time decoupled, clear standards based external interfaces: API & events • low external impact of: change, refactor, move, migrate, scale, failure • reliable, robust, resilient • clear ownership (business sponsor; one IT team builds it, runs it, evolves it) • contains everything needed to run [on a generic platform] • application software, libraries/frameworks, platform configuration • pipelines for CI and CD, tests, documentation, infra as code Microservices in real life – with Node & Dapr.io
  • 16. Classificatie: Public Publiek What is IT all about? Application Production Runtime Microservices in real life – with Node & Dapr.io
  • 17. Classificatie: Public Publiek What is IT all about? Application Production Runtime Platform Microservices in real life – with Node & Dapr.io Business value
  • 18. Classificatie: Public Publiek What is IT all about? Application Platform Production Runtime Operations Monitoring & Management Platform Platform Microservices in real life – with Node & Dapr.io
  • 19. Classificatie: Public Publiek Production Runtime is the Result of Preparation Runtime Application Platform Production Runtime Operations Monitoring & Management Application Preparation Runtime Platform Development CD Agile Design, Build, Test Microservices in real life – with Node & Dapr.io
  • 20. Classificatie: Public Publiek One team has Agile responsibility through full lifecyle Application Platform Production Runtime Operations Monitoring & Management Application Preparation Runtime Platform Development CD Agile Design, Build, Test Microservices in real life – with Node & Dapr.io
  • 21. Classificatie: Public Publiek One team has Agile responsibility through full lifecyle Application Platform Production Runtime Operations Monitoring & Management Application Preparation Runtime Platform Development CD Agile Design, Build, Test Microservices in real life – with Node & Dapr.io
  • 22. Classificatie: Public Publiek One team has Agile responsibility through full lifecyle Application Platform Application Platform Microservices in real life – with Node & Dapr.io
  • 23. Classificatie: Public Publiek A microservice is owned by one team through its full lifecyle Microservice Microservices in real life – with Node & Dapr.io
  • 24. Classificatie: Public Publiek The Microservice API HTTP REST/JSON Microservices in real life – with Node & Dapr.io µ
  • 25. Classificatie: Public Publiek Independent microservices and an integrated front end Microservices in real life – with Node & Dapr.io
  • 26. Classificatie: Public Publiek Independent microservices and an integrated front end Microservices in real life – with Node & Dapr.io microservice / team
  • 27. Classificatie: Public Publiek The Microservices Platform Microservices in real life – with Node & Dapr.io Runtime Platform API µ API µ API µ API µ
  • 28. Classificatie: Public Publiek The Microservices Platform Cloud Native Application Development- on Oracle Cloud | APAC OGB Tour 2021 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 µ
  • 29. Classificatie: Public Publiek The Microservices Platform Cloud Native Application Development- on Oracle Cloud | APAC OGB Tour 2021 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 µ
  • 30. Classificatie: Public Publiek The Microservices Platform Cloud Native Application Development- on Oracle Cloud | APAC OGB Tour 2021 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
  • 31. Classificatie: Public Publiek 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 Microservices in real life – with Node & Dapr.io This requires quite a bit of repetitive “plumbing” tied to specific technologies – not meaningful effort [from a business functionality perspective]
  • 33. Classificatie: Public Publiek Dapr • Runtime • Personal Assistant for Applications and Microservices • Distributed Application Runtime • Microservice architecture • Decoupling Microservices in real life – with Node & Dapr.io
  • 34. Classificatie: Public Publiek 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) Microservices in real life – with Node & Dapr.io Application Microservice or Monolith Personal Assistant (Dapr) Personal Assistant (Dapr) Personal Assistant (Dapr) Personal Assistant (Dapr) Personal Assistant (Dapr) Personal Assistant (Dapr)
  • 35. Classificatie: Public Publiek Dapr.io • Personal Assistant is Dapr Side Car • companion process or side car container in Kubernetes Pod Microservices in real life – with Node & Dapr.io My App Dapr API HTTP/gRPC Application Dapr sidecar
  • 36. Classificatie: Public Publiek key value myApp-weapon "DeathStar" State management My App POST http://localhost:3500/v1.0/state/corpdb [{ "key": "weapon", "value": "DeathStar" }] Redis Cache
  • 37. Classificatie: Public Publiek State management My App key value myApp-weapon "DeathStar" Redis Cache GET http://localhost:3500/v1.0/state/corpdb/planet "DeathStar"
  • 38. Classificatie: Public Publiek State management My App key value myApp-weapon "DeathStar" Azure CosmosDB GET http://localhost:3500/v1.0/state/corpdb/planet "DeathStar"
  • 39. Classificatie: Public Publiek 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
  • 40. Classificatie: Public Publiek 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
  • 41. Classificatie: Public Publiek HTTP API gRPC API Microservice building blocks Service- to-service invocation State management Publish and subscribe Resource bindings and triggers Actors Observability Secrets Extensible
  • 42. Classificatie: Public Publiek 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 Extensible
  • 43. Classificatie: Public Publiek 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 Extensible Hosting infrastructure On-Premises Azure Arc
  • 44. Classificatie: Public Publiek 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"}
  • 45. Classificatie: Public Publiek 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"}
  • 46. Classificatie: Public Publiek Input triggers My App Twitter POST http://10.0.0.2:8000/newtweet {"data":“📢 We are excited to announce the …"}
  • 47. Classificatie: Public Publiek Output bindings My App Twilio POST http://localhost:3500/v1.0/bindings/twilio {"data":"Hello World"} Hello World
  • 49. Classificatie: Public Publiek Observability OpenTelemetry collector Logging & tracing extensions My App Redis Cache Twitter Service B Service A
  • 50. Classificatie: Public Publiek 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
  • 51. Classificatie: Public Publiek 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
  • 52. Classificatie: Public Publiek Hands On Lab 1 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 Microservices in real life – with Node & Dapr.io labs: https://github.com/lucasjellema/fontys-2022-microservices-kafka-dapr
  • 53. Classificatie: Public Publiek 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 daprdapr 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
  • 55. Classificatie: Public Publiek General Purpose Programming Languages • C & C++ • COBOL, Fortran, ALGOL, BASIC, Pascal • SmallTalk • Visual Basic • Python • PHP, Perl, Ruby • Java • JavaScript (ECMAScript, ES) • C# • Go • Kotlin • Rust Microservices in real life – with Node & Dapr.io
  • 56. Classificatie: Public Publiek Node == Server Side JavaScript • Script: Not statically typed, not compiled – interpreted at runtime • Node(JS) – open source, runtime based on Chrome V8 JavaScript engine • initial release: 2009 • Full stack development – server side and client side can leverage JavaScript • for example: MEAN stack (MongoDB, Express, Angular, NodeJS) • Light weight, quick startup, support for high concurrency • Skills widely available, many resources, tools and libraries • Easy to get started, quite high productivity and fun factor • Functions are primary citizens – functional programming well supported • Quite suitable for microservices – including containerized and serverless • Available everywhere – cross platform, all public clouds • Note: TypeScript compiles to Node that is interpreted at runtime Microservices in real life – with Node & Dapr.io
  • 57. Classificatie: Public Publiek Introducing Node – Single Thread model • Multi-thread languages – such as Java – typically block when file system or network operations take place • Parallel processing continues in parallel threads • Threads consume resources and are only somewhat scalable • JavaScript has a main (single thread) event loop and uses asynchronous processing • Non-blocking handling of file system interactions, HTTP calls, network operations and other blocking actions • Scalable, very quick startup Microservices in real life – with Node & Dapr.io
  • 58. Classificatie: Public Publiek Introducing Node - NPM • NPM = Node Package Manager • To include libraries from the ecosystem • Leverages npm registry (> 1.3M NPM Modules available) • Acquired by Microsoft – March 2020 • To build and run Node applications • similar to Maven & Gradle (Java) or pip (Python) • Yarn and Turbo are popular alternatives Microservices in real life – with Node & Dapr.io
  • 59. Classificatie: Public Publiek Hello World in Node • app.js • with the code to execute • (optional) package.json • with NPM dependencies, build and run configuration (compare Maven pom.xml) • Create Node application: • npm init (optional, you can just create a text file by hand instead) • Run Node application • node app.js • npm start • Add dependencies • npm install <name of module> --save Microservices in real life – with Node & Dapr.io
  • 60. Classificatie: Public Publiek Functions • Functions • have a name • take zero, one or multiple untyped input parameters • return zero or one untyped result • or an exception instead of a result Microservices in real life – with Node & Dapr.io
  • 61. Classificatie: Public Publiek Functions • Function references • can be assigned to a variable • can be passed around • can be invoked • Note: function name without parentheses is not a call to the function but a reference • print vs print() Microservices in real life – with Node & Dapr.io
  • 62. Classificatie: Public Publiek Functions • Function references can be closures – function + state • closures contain values of local context at the time of instantiation Microservices in real life – with Node & Dapr.io Hello 1 World 2
  • 63. Classificatie: Public Publiek Require – to import a module • Node contains many out of the box modules • for example: file, os, http, stream, crypto, net, url • The NPM package manager adds more than 1M modules to make us of • You can create your own (reusable) modules • To access elements from a module, that module needs to be identified, using: const <logical name> = require('module name') • Module name can be reference to a local file, to a global module or to the name of a module defined in package.json (and installed in the application’s node-modules directory) Microservices in real life – with Node & Dapr.io
  • 64. Classificatie: Public Publiek Node – Asynchronous calls • JavaScript is single threaded – no parallel threads can be started from your code • Any action in Node that requires network or file system interaction is typically performed asynchronously: • the command is started and handed to the Node background processes; the main thread continues with other work • when the background processes have completed the task, the results are returned to the invoker (when the main thread has an opening) Microservices in real life – with Node & Dapr.io
  • 65. Classificatie: Public Publiek Node – Asynchronous HTTP calls • Many modules are available for HTTP communications from Node • The standard HTTP module is not the most convenient • An HTTP request is processed asynchronously in all cases • main program loop proceeds while request is made Microservices in real life – with Node & Dapr.io asynchronous HTTP request response
  • 66. Classificatie: Public Publiek Asynchronous – waiting for one or more asynchronous results • A function is declared to be asynchronous using the async keyword • The result of an asynchronous function is an object of type Promise • in order to get the actual value – the Promise must be “resolved” • this can be waited for using the keyword await • Alternatively – especially when multiple asynchronous results are waited for at the same time – we can use Promise.then( <callback function>) or Promise.all( <callback function>) to wait for Promise results to come available Microservices in real life – with Node & Dapr.io
  • 67. Classificatie: Public Publiek Hello World Web Application • Node is very good at handling HTTP Requests • It is a great technology to implement REST APIs and backends for Web and Mobile applications • fast, scalable, easy to develop and to deploy Microservices in real life – with Node & Dapr.io define the function that handles each HTTP request and prepares the response
  • 68. Classificatie: Public Publiek 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 Microservices in real life – with Node & Dapr.io 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
  • 69. Classificatie: Public Publiek State Management with Dapr from Node application Microservices in real life – with Node & Dapr.io sidecar (the personal assistant) Node SDK for Dapr State Store components set & get state components.yaml State Stores state store interface
  • 70. Classificatie: Public Publiek State Management with Dapr from Node application Microservices in real life – with Node & Dapr.io 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
  • 71. Classificatie: Public Publiek State Management with Dapr from Node application - switch to MySQL state store with configuration change Microservices in real life – with Node & Dapr.io 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
  • 72. Classificatie: Public Publiek State Management with Dapr from any application - either through SDK or using HTTP or gRPC Microservices in real life – with Node & Dapr.io sidecar (the personal assistant) SDK for Dapr State Store components set & get state components.yaml State Stores state store interface
  • 73. Classificatie: Public Publiek Pub/Sub with Dapr from Node applications Microservices in real life – with Node & Dapr.io 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
  • 74. Classificatie: Public Publiek Pub/Sub with Dapr from Node applications Microservices in real life – with Node & Dapr.io 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
  • 75. Classificatie: Public Publiek Pub/Sub with Dapr from Node applications Microservices in real life – with Node & Dapr.io 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
  • 76. Classificatie: Public Publiek Asynchronous Interaction between Microservices Microservices in real life – with Node & Dapr.io Front App http State Stores PubSub Brokers Node App get get & set publish subscribe consume name = John
  • 77. Classificatie: Public Publiek Telemetry Observation in Zipkin Microservices in real life – with Node & Dapr.io greeter http State Stores PubSub Brokers name-processor get get & set publish subscribe consume name = John Telemetry Data
  • 78. Classificatie: Public Publiek Telemetry Observation in Zipkin Microservices in real life – with Node & Dapr.io Telemetry Data Front App http State Stores PubSub Brokers Node App get get & set publish subscribe consume name = John
  • 79. Classificatie: Public Publiek Handson Lab 2 • Install Node (and npm) runtime • Explore Node • hello world • functions • asynchronous • http server • 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 Microservices in real life – with Node & Dapr.io labs: https://github.com/lucasjellema/fontys-2022-microservices-kafka-dapr
  • 80. Classificatie: Public Publiek Microservices in real life – with Node & Dapr.io 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 Lab 2
  • 81. Classificatie: vertrouwelijk Microservices in real life – with Node & Dapr.io & 30 March 2022 Lucas Jellema Architect & CTO AMIS | Conclusion Next Week: Apache Kafka

Notes de l'éditeur

  1. Wat is een microservice? (waarom, problemen met monolitische applicaties, hoe microservice architectuur, generieke voorzieningen & platform voor microservices, data & events als glue tussen microservices) Hier alvast stilstaan bij het belang van een event broker en een korte intro van Kafka (meer in college 2) Implementatie van microservices: afhandelen van http requests, consumeren en publiceren van events, doen van http calls:  wat zijn activiteiten die iedere microservice moet uitvoeren? (state mgt, pub/sub, secrets, config mgt, aanroepen 3rd party (cloud) services, ..) Introductie en demo van Dapr.io framework – de personal assistant die iedere applicatie eenvoudig laat aansluiten op generieke voorzieningen én die applicaties (microservices) met elkaar laat interacteren op ontkoppelde wijze; note: ik zal wijzen op de ondersteuning in Dapr.io voor diverse technologieën zoals RabbitMQ, MySQL, Redis Handson met Dapr – meegeleverde applicaties in Java en C# Zelf implementeren van microservice – introductie van NodeJS ; Handson: afbouwen eenvoudige services in NodeJs en via Dapr.io interactie met elkaar en met generieke voorzieningen
  2. https://github.com/lucasjellema/fontys-2022-microservices-kafka-dapr
  3. Implementatie van microservices: afhandelen van http requests, consumeren en publiceren van events, doen van http calls: wat zijn activiteiten die iedere microservice moet uitvoeren? (state mgt, pub/sub, secrets, config mgt, aanroepen 3rd party (cloud) services, ..) Introductie en demo van Dapr.io framework – de personal assistant die iedere applicatie eenvoudig laat aansluiten op generieke voorzieningen én die applicaties (microservices) met elkaar laat interacteren op ontkoppelde wijze; note: ik zal wijzen op de ondersteuning in Dapr.io voor diverse technologieën zoals RabbitMQ, MySQL, Redis Handson met Dapr – meegeleverde applicaties in Java en C# Zelf implementeren van microservice – introductie van NodeJS ; Handson: afbouwen eenvoudige services in NodeJs en via Dapr.io interactie met elkaar en met generieke voorzieningen     College 2 – Kafka als backbone van microservice gebaseerde applicaties, containers & Kubernetes als deployment vehikel en runtime platform Korte recap – microservices, API & Events, Dapr.io , Kafka; Intro & Demo van Kafka en plek van Kafka in microservices architecture (en gebruik van Kafka bij grote organisaties) Handson: interactie met Kafka vanuit eenvoudige NodeJS applicatie Handson: interactie tussen NodeJS applicaties via Kafka Kafka via Dapr.io Handson: microservice pub/sub interactie via Dapr.io sidecar en Kafka; wissel Kafka en Redis base pub/sub (dit kan met NodeJS maar ook met Java of C#) Handson: microservice binding interactie via Dapr.io sidecar met externe Kafka broker ; studenten kunnen events met elkaars microservices uitwisselen Intro Kafka Connectors HerIntro Containers & Kubernetes Microservices met Containers op Kubernetes plus plek van Dapr.io Handson: lokaal draaien van Kubernetes (met minikube of k3s), Dapr.io op lokaal cluster Bouw microservice tot Dapr-enabled container en deploy op lokaal cluster; test microservice Voeg tweede microservice toe die met de eerste interactie heeft Bonus: horizontaal schalen van eerste service – load balancing door Dapr in aanroepen naar de twee of meer instanties van de eerste service  
  4. http://www.modulecounts.com/
  5. Wat is een microservice? (waarom, problemen met monolitische applicaties, hoe microservice architectuur, generieke voorzieningen & platform voor microservices, data & events als glue tussen microservices) Hier alvast stilstaan bij het belang van een event broker en een korte intro van Kafka (meer in college 2) Implementatie van microservices: afhandelen van http requests, consumeren en publiceren van events, doen van http calls:  wat zijn activiteiten die iedere microservice moet uitvoeren? (state mgt, pub/sub, secrets, config mgt, aanroepen 3rd party (cloud) services, ..) Introductie en demo van Dapr.io framework – de personal assistant die iedere applicatie eenvoudig laat aansluiten op generieke voorzieningen én die applicaties (microservices) met elkaar laat interacteren op ontkoppelde wijze; note: ik zal wijzen op de ondersteuning in Dapr.io voor diverse technologieën zoals RabbitMQ, MySQL, Redis Handson met Dapr – meegeleverde applicaties in Java en C# Zelf implementeren van microservice – introductie van NodeJS ; Handson: afbouwen eenvoudige services in NodeJs en via Dapr.io interactie met elkaar en met generieke voorzieningen