Book Image

Practical Microservices with Dapr and .NET - Second Edition

By : Davide Bedin
Book Image

Practical Microservices with Dapr and .NET - Second Edition

By: Davide Bedin

Overview of this book

This second edition will help you get to grips with microservice architectures and how to manage application complexities with Dapr in no time. You'll understand how Dapr simplifies development while allowing you to work with multiple languages and platforms. Following a C# sample, you'll understand how Dapr's runtime, building blocks, and software development kits (SDKs) help you to simplify the creation of resilient and portable microservices. Dapr provides an event-driven runtime that supports the essential features you need for building microservices, including service invocation, state management, and publish/subscribe messaging. You'll explore all of those in addition to various other advanced features with this practical guide to learning Dapr. With a focus on deploying the Dapr sample application to an Azure Kubernetes Service cluster and to the Azure Container Apps serverless platform, you’ll see how to expose the Dapr application with NGINX, YARP, and Azure API Management. By the end of this book, you'll be able to write microservices easily by implementing industry best practices to solve problems related to distributed systems.
Table of Contents (20 chapters)
1
Part 1: Introduction to Dapr
5
Part 2: Building Microservices with Dapr
11
Part 3: Deploying and Scaling Dapr Solutions

What this book covers

Chapter 1, Introducing Dapr, will introduce you to the basics of Dapr, briefly exposing the features that make Dapr interesting for new cloud-native applications, as well as for inserting microservices into existing applications.

Chapter 2, Debugging Dapr Solutions, will focus on how to set up your Dapr development environment in VS Code to locally debug simple Dapr solutions, as well as more complex ones.

Chapter 3, Microservices Architecture with Dapr, will discuss the relevance of microservices architectures and starts to explore how Dapr as a runtime can make it easier to adopt this style. 

Chapter 4, Service-to-Service Invocation, will instruct you on how services can discover and invoke each other via the Dapr infrastructure. With examples, you will understand how to implement services and invoke them from other Dapr-aware components and Dapr-unaware or external clients.

Chapter 5, Introducing State Management, will illustrate how a Dapr solution can manage states with different store types. Managing states for services and actors is a centerpiece of Dapr.

Chapter 6, Publish and Subscribe, will teach you about publish and subscribe, which is the messaging pattern used by Dapr to enable decoupled interactions between components. Input bindings enable you to trigger your microservice using an incoming Twilio SMS or an Azure Service Bus message.

Chapter 7, Resource Bindings, will detail how input bindings in Dapr enable you to design event-driven microservices and invoke external resources via a pluggable configuration.

Chapter 8, Using Actors, will help you learn about the powerful virtual actor model provided by Dapr, how to leverage it in a microservices-style architecture, and the pros and cons of different approaches.

Chapter 9, Deployment to Kubernetes, will help distinguish the basic differences between local Standalone mode and Kubernetes mode in terms of their operations. Specifically using Azure Kubernetes Service, we will deploy a Dapr sample application composed of several microservices to Kubernetes.

Chapter 10, Exposing Dapr Applications, will explore how we can expose our Dapr applications to our end users. Specifically using Azure Kubernetes Service, we will expose our Dapr sample application on Kubernetes via NGINX and Azure API Management.

Chapter 11, Tracing Dapr Applications, will outline the observability options in Dapr by exploring how traces, logs, and metrics are emitted and can be collected in Dapr using Zipkin, Prometheus, and Grafana.

Chapter 12, Load-Testing and Scaling Dapr, will elaborate on how the scaling of Dapr services and actors works in Kubernetes, and by leveraging Locust, the reader will also learn how to load-test a Dapr solution by simulating user behaviors via the Locust testing tool.

Chapter 13, Leveraging Serverless Containers with Dapr, will guide you on how to benefit from Kubernetes without its complexities by adopting serverless containers with Azure. We will understand how to deploy a Dapr application to Azure Container Apps.