Dapr for Building Distributed .NET Applications – Visual Studio Magazine
Questions and answers
Q&A: Dapr for Building Distributed .NET Applications
Modern distributed applications require more than just application logic. Features such as service state management, communication using publish/subscribe messaging, and event-driven binding to cloud resources may be required. Dapr introduces a runtime to offer such building blocks and is less invasive in your application, allowing you to choose what you need.
Dapr has become so essential in the .NET space for distributed applications that it is the subject of an upcoming advanced level workshop which will be led by Alex Thissen to Visual Studio Live! conference scheduled for June 13-17 in Austin, Texas.
Thissen, an architect, lead developer, and mentor at companies large and small, will lead the workshop titled Dapr for Building Distributed .NET Applications on June 17.
The workshop will examine the approach taken by the Dapr runtime with a sidecar architecture, separating application logic from Dapr runtime components while showing participants how to develop distributed applications in .NET using the features of Dapr and how to link to messaging infrastructure, cloud resources and use the actor programming model and client proxies. Coders will also learn how to combine Dapr into ASP.NET Core applications using routing, controllers, and middleware.
Before the workshop, we caught up with Thissen to find out more in a short Q&A session.
Visual Studio Magazine: Microsoft says Dapr addresses a big challenge inherent in modern distributed applications: complexity. How?
Thissen: Distributed applications in a modern architecture and cloud environment are inherently complex. Dapr provides an application-level abstraction and removes a considerable amount of that complexity.
“Developers can focus on the logic instead of having to learn and work with the low-level details of the cloud services used.”
Alex Thissen, Architect, Lead Developer and Mentor
The challenges of communicating and discovering services, pub/sub messaging patterns, storage and multithreading, and high levels of concurrency are facilitated by the building blocks of Dapr. Languages help combine application logic with the use of building blocks in native constructs. Developers can focus on the logic instead of having to learn and work with the low-level details of the cloud services used.
What are some examples of these building blocks?
The building blocks cover storage, secrets management, service-to-service communication, pub/sub models, actor programming model, configuration, observability, and bindings to cloud services. There is a long list of specific blocks for each of them. These include many services from Microsoft Azure, Google Cloud Provider and Amazon Web Services. Application logic is independent of the specific block used, so block switching is relatively easy.
Can you briefly describe what a sidecar architecture is?
A sidecar architecture takes advantage of a container orchestrator’s ability to host container instances with additional accompanying containers tightly connected to each other. These additional containers are sidecars and help the main container provide additional functionality. Dapr uses sidecars to provide secure mutual TLS communication to other services, service discovery, distributed tracing, and binding to different cloud services.
What is the biggest problem that developers typically find when learning to use Dapr?
Dapr uses Kubernetes as its production hosting environment. Dapr itself is fairly accessible, but learning Kubernetes is daunting and challenging. Developers will need to be familiar with container technology in general and Kubernetes as a container orchestrator in particular.
Dapr is described as an open source project sponsored by Microsoft. What benefits does this sponsorship bring to .NET-centric developers?
.NET is a first-class citizen for Dapr to implement applications using the application runtime. The same goes for other languages such as Go and C++. The benefits for .NET developers are the long-standing support implied by Microsoft’s involvement. Also, .NET will often be one of the first to get support for new features in Dapr.