2. 2
www.luxoft.com
Short bio
Java Developer at Luxoft
10 years of experience in Java
Involved in the development of:
A huge OSGI-baseddesktop application(600+ modules, 300+ third-partymodules)
Server-side - microservices
3.
4. 4
www.luxoft.com
Project overview
https://dapr.io/
Initiated by Microsoft
Open-source project (MIT License) - https://github.com/dapr/dapr
Initial version: 0.1 released in Oct 2019
Current version: v1.0 released on Feb 17
12. 12
www.luxoft.com
Service invocation API
Features
• All calls between Dapr applications can be made secure with mutual authentication (mTLS)
• Supports calls across namespaces
• Performs retries
• Observability
• All calls between applications are traced, and metrics are gathered to provide insights and diagnostics for applications
• Uses W3C tracing context
• Integrates with OpenTelemetry for tracing, metrics, and logs
• Access Control Lists
15. 15
www.luxoft.com
Pub/sub API
Features
• Guarantees at-least-once semantics for message delivery
• Multiple subscribers with the same app ID
• Message delivered to one instance
• Multiple subscribers with different app ID
• Message delivered to all subscribers
• Topic scoping
• Limit which application can publish or subscribe to topics
• Messages are wrapped in CloudEvent format (if not already wrapped)
16. 16
www.luxoft.com
Pub/sub API
Components
• Hazelcast
• Redis Streams (5.0.0 or later)
• NATS
• Kafka
• Azure Service Bus
• RabbitMQ
• Azure Event Hubs
• GCP Pub/Sub
• MQTT
• Possible to provide custom backend via SPI
18. 18
www.luxoft.com
State management API
Features
• Consistency
• eventual consistency (default behavior)
• strong consistency
• Concurrency
• first-write-wins (ETag support is required either by store or through Dapr emulation)
• last-write-wins
• Bulk operations
• not transactional
• transactional
24. 24
www.luxoft.com
Secrets API
Features
• Can be accessed
• Programmatically through API
• In Dapr component configuration files
• Secrets scoping
• By default, any secret is accessible from any Dapr application
• Each Dapr application can be configured to have access to only selected secrets
26. 26
www.luxoft.com
SDKs
Language Status Client SDK
Service
Extensions
Actor SDK
.NET Stable ✔
✔
ASP.NET Core
✔
Python Stable ✔
✔
gRPC
✔
FastAPI
Flask
Java Stable ✔
✔
Spring Boot
✔
Go Stable ✔ ✔
PHP Stable ✔ ✔ ✔
C++ In development ✔
Rust In development ✔
Javascript In development ✔
28. 28
www.luxoft.com
Performance and scalability
Overhead
Test setup:
• 1,000 requests per second
• Sidecar limited to 0.5 vCPU
• Sidecar mTLS enabled
• Sidecar telemetry enabled (tracing with a sampling rate of 0.1)
• Payload of 1KB
• Dapr side car overhead (1,000 requests):
• 0.48 vCPU
• 23Mb
• Control plane consumes:
• In non-HA mode: 0.009 vCPU and 61.6 Mb
• In HA mode: ~0.02 vCPU and 185 Mb
30. 30
www.luxoft.com
Pros
Simple workflows with pub/sub and stage management are easy to implement with Dapr
No need to deal with different third-party SDK, drivers, etc.
Encourages developers to use best practices
Implementation of a component (store, pub-sub, etc) can be replaced easily
Language-agnostic
Well-documented
API examples
SDK examples
Deployment examples
31. 31
www.luxoft.com
Cons
APIs provide a small subset of features of underlying components
Restricts versions of underlying components
Only Redis 5 and 6 are supported
Makes it harder to launch/debug apps on the dev side
Need to launch two processes instead of one (app + Dapr)
Console log is cluttered
No good support in IDE (yet?)
Devs have to create launchers manually to launch Dapr
Requires extra resources on server side (two-four pods)
Adds complexity to the overall picture
Overlaps with istio: mTLS, tracing
Maturity status:
A lot of components are in alpha/experimental state
Low adaptation
32. 32
www.luxoft.com
References
Good overview - https://www.youtube.com/watch?v=MjyulcRqh20
Examples - https://github.com/dapr/quickstarts
SDK examples - https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples
API reference - https://docs.dapr.io/reference/api/
Service Invocation Performance - https://docs.dapr.io/operations/performance-and-scalability/perf-service-invocation/