A DotNet Raider

My adventures in the .NET world!
posts - 49, comments - 12, trackbacks - 0

My Links

News

Website View Martino Bordin's profile on LinkedIn

Archives

Post Categories

lunedì 5 febbraio 2024

Dapr - Resiliency

As we know, in a distributed system we have to take into account more complexity and deal with its fallacies. Since several moving parts could potentially be broken or be unreachable, we must design upfront our application with resiliency in mind, to minimize the impact of bad events and continue operating.

Dapr gives us out-of-the-box features that allow our applications to handle temporary failures.

All we have to do is to create a YAML file where we define policies and targets.

Policies are how we want to handle errors:

  • Timeout,  to terminate operations after defined intervals
  • Circuit breaking, to 'open' the circuit when there are several errors in order not to flood the system and give it time to restart the failing service
  • Retry, to retry failed operations

Targets are where we want to apply such policies:

  • Apps, our services (defined in docker-compose in our sample)
  • Components, the different building blocks of Dapr
  • Actors, the actor operations (not used in our sample)

I won't post the full YAML specification in this article, but I prepared a full example with comments in the GitHub repository.

Check it out here.

Once done, we configure the Dapr sidecar to load the resiliency configuration using the -resources-path argument.

In the next article, we'll see observability in Dapr

posted @ lunedì 1 gennaio 0001 00:00 | Feedback (0) | Filed Under [ Dapr Microservices ]

Powered by:
Powered By Subtext Powered By ASP.NET