More and more applications are being developed as cloud-native, distributed, Microservices-based applications due to a simple reason. Microservice architecture offers an overwhelming set of benefits: better scalability, reliability, loose service coupling, and service-independent deployments. As usual, these benefits come with a price tag, e.g., concurrency issues, failure handling, retry policies, state management, and distributed tracing. This price tag leaves you less time to develop and focus on your business logic.
The Distributed Application Runtime (Dapr) is an open-source project by Microsoft attempting to tackle these issues once and for all. It is a portable, event-driven runtime for building distributed applications across cloud and edge. Unlike other abstractions, Dapr is language-agnostic and can run on any platform, cloud vendor, or even on-prem. In this session, we'll introduce Dapr and demonstrate how we can use it to build a distributed, cloud-native, microservices application using various programming languages and frameworks, that can run virtually anywhere.
8. Microservices – solutions
Serverless architecture
Azure Functions & AWS Lambada
Stateless, event-driven microservices
Virtual Actor model
Object-oriented microservices
E.g Microsoft Orleans
The cloud takes care of
Activating, retries, scaling, failure handling
8
9. Microservices – solution issues
Coupled to Stack
Coupled to cloud providers
A single application depends on multiple SDKs
FaaS and Actor integration can be complicated
FaaS runtimes can be heavy
9
11. Dapr
Portable, Event-driven runtime for building microservices
Open Source
https://github.com/dapr/dapr
6.8K Github stars
117 contributors
28+ new components since launch
Alpha phase
11
12. Dapr
Supports any platform
Services knows only HTTP/gRPC
Can decide to use dedicated SDKs
Services are not aware of the actual technologies
Services are not aware of other services
Everything is configurable via yaml file
E.g you can switch from Cosmos DB to DynamoDB
12
13. Dapr
Sidecar architecture
Dapr is isolated via Process or Container from your app
Two hosting modes
Self hosting
Kubernetes
13
29. Dapr – Service Invocation
Every service has an id (name)
Calling services has to know that id
HTTP or gRPC
Takes care of
Discoverability
Reliability
Retries
Failure handling
30
38. Dapr – State Management
The actual store is not known to services
Support for many platforms, including:
Redis
AWS DynamoDB
Azure Cosmos DB
MongoDB
Cassandra
SQL Server
More…
Easy to implement new state store
40
55. Dapr – Resource Bindings
Input/Output with cloud resources
Similar in concepts to Azure Function’s Binding
Trigger your service or invoke external systems
Takes care of connections, polling, queuing, etc…
Benefits
Focus on Business logic
Your code is free from SDKs and libraries
Auto handling for retries & failure recovery
Switch bindings at run time
Deploy to different environments without code changes
57
67. Dapr – Virtual Actors
The Actor Model
Self-contained unit of code (actor)
Actors interacts using via messages
The runtime manages how, when and where each actor runs
Dapr implements the Virtual Actors Model
Takes care of
Lifetime
Retries
Failover
Concurrency
69
68. summary
Microservices has many benefits
But also challenges
Dapr
Runtime for building microservices
Any platform, any stack, any environment
Takes care of a lot of the challenges
Open Source
Community
Demo repo:
https://github.com/MoaidHathot/Architecture-next-2020-dapr
70