News

Microsoft's Distributed Application Runtime (Dapr) Debuts for Microservices

Microsoft's open source distributed application runtime, Dapr, is now production ready in version 1.0, easing microservices development on-premises, on the edge or in the cloud.

Dapr is intended to manage the many challenges inherent to developing microservices applications, which typically are event-driven, firing off code executions in response to events like telemetry triggers, user interactions and so on. Such applications can draw on resources from all over the place, invocating other microservices (which in turn may leverage others), managing state, making calls to data stores, handling identity functionality and more.

The idea is to let developers focus on building their own applications without having to worry about those distributed development challenges such as recovering state after failures, managing secrets, discovering and calling other microservices, managing security, etc.

Dapr
[Click on image for larger view.] Dapr (source: Microsoft).

While abstracting away the implementation details of all those interactions, developers can use any programming language, any development framework, running anywhere, Microsoft says.

Dapr uses core "bulding blocks" providing specific best practices functionality for different use cases. Dapr, first announced back in October 2019, features these building blocks:

  • Service Invocation: Using service invocation, your application can reliably and securely communicate with other applications using the standard gRPC or HTTP protocols.
  • State Management: Using state management, your application can store data as key/value pairs in the supported state stores. The state manager can be used with different state stores housed in popular offerings like Redis, MongoDB, and Azure Cosmos DB, remaining agnostic to any specific implementation so developers can swap them out without changing code.
  • Publish & Subscribe: The publish/subscribe pattern allows microservices to communicate with each other using messages. Publishing events and subscribing to topics between services enables event-driven architectures to simplify horizontal scalability and make them resilient to failure.
  • Securing Secrets: To make it easier for developers everywhere to consume application secrets, Dapr has a dedicated secrets building block API that allows developers to get secrets from a secret store.
    Dapr Security
    [Click on image for larger view.] Dapr Security (source: Microsoft).
  • Bindings: Using bindings, you can trigger your app with events coming in from external systems, or interface with external systems. Resource bindings and triggers build further on event-driven architectures for scale and resiliency by receiving and sending events to and from any external resources such as databases, queues, file systems, blob stores, webhooks, etc. For example, your code can be triggered by a message on an Azure EventHub service and write data to Azure CosmosDB.
  • Actors: The actor pattern describes actors as the lowest-level “unit of computation.” You write code in a self-contained unit (called an actor) that receives messages and processes them one at a time, without any kind of concurrency or threading. It's a pattern for stateless and stateful objects that make concurrency simple with method and state encapsulation. Dapr provides many capabilities in its virtual actor runtime including concurrency, state, life-cycle management for actor activation/deactivation and timers and reminders to wake up actors.

In shipping v1., the dev team drew upon community feedback to focus on performance, security, High Availability (HA) and conformance. The initial release installs Kubernetes as a production environment, with the super-popular container orchestration system being deeply integrated into Dapr's control plane and its "sidecar architecture."

Regarding the latter, Microsoft says Dapr runs alongside your application like a sidecar, whether on a local dev box, edge device or in the cloud, providing functionality as needed. For example, when an app is hosted in Kubernetes, Dapr runs as another container in the application's pod, scaling along with the app.

As far as developer tooling, Dapr 1.0 is integrated with several frameworks including ASP.NET Core, Java Spring Boot, Azure Functions and Logic Apps. Microsoft says it sees this trend continuing with more open source frameworks like Django, Nodejs and Kyma, for potential examples.

Dapr SDKs & Languages
[Click on image for larger view.] Dapr SDKs & Languages (source: Microsoft).

As the above graphic shows, the project provides SDK packages for client, service extensions and actors, supporting .NET and the Python, Java, Go and PHP programming languages, with C++, Rust and JavaScript support on tap.

Developers can work with Visual Studio Code integrations with Dapr, IntelliJ or GitHub Codespaces.

Going forward, Microsoft said the v1.0 release lays the foundation for essential building blocks for cloud native development.

"Being community driven means that the community will set the project's priorities in future releases and many of these have already been up voted on," the company said in a Feb. 17 announcement post. "For example, highlights to enhance the existing building blocks include having the ability to query and filter multiple values in state management with OData. In pub/sub, supporting CloudEvents v1.0 filtering to filter out events that are of interest to the subscriber based on message content. In observability, providing an API for tracing events from the application, preventing you from having to bind to specific monitoring libraries and enabling actors to subscribe to pub/sub events directly opens up a wealth of event driven scenarios."

You can learn more at:

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube