Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions akka-docs/src/main/paradox/common/circuitbreaker.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ resource exhaustion. Circuit breakers can also allow savvy developers to mark p
the site that use the functionality unavailable, or perhaps show some cached content as
appropriate while the breaker is open.

Like any other pattern, circuit breakers have their own challenges: circuit breakers can misinterpret a partial failure as total system failure and inadvertently bring down the entire system. In particular, sharded systems and cell-based architectures are vulnerable to this issue. For example, let’s say only one of your database shards is overloaded and other shards are working normally. Usually in such circumstances, the circuit breaker either assumes the entire database (i.e. all shards) is overloaded and trips which negatively impacts the normal shards, or the circuit breaker assumes the required threshold hasn’t been exceeded and doesn’t do anything to mitigate overloading of the problematic shard. In either case, the result is not optimal. A workaround is that the server indicates to the client exactly which specific part is overloaded and the client uses a corresponding mini circuit breaker. However, this workaround can be complex and expensive.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for you contribution @azarboon.
However, I don't think the added paragraph is helping understand Akka's circuit breakers.

The example that of a system being brought down doesn't seem to apply. If you have a distributed database, the access to the instances is managed by some connection pool + driver. The application itself won't be connecting to db shards individually.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. How about cell based architecture? May I change the example to that?

Copy link
Contributor

@octonato octonato Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. What is missing in the Akka documentation about Circuit Breakers that needs to be addressed?

It's good if we have a succinct, high-level, explanation about the concept of Circuit Breakers followed by how to use the Akka APIs.

But if the intro about Circuit Breakers is too extensive, then we miss the main goal. The are enough resources on the internet (articles, blogs, videos) about it and interested users will dig the web for more information.

Copy link
Author

@azarboon azarboon Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. But the problem is that the problem I mentioned, is not well known. Marc Brooker has written an excellent post explaining this. But it's buried and not well-known. So, I'm attempting to evangelize it so builders can be informed. Given that Akka is a well-known resource, it would be great if it evangelizes about challenges of this pattern. I'm thinking maybe we can add a link to that post for further reading? This way we can keep the doc succinct while giving heads-up to builders. What's your advice?


The Akka library provides an implementation of a circuit breaker called
@apidoc[CircuitBreaker] which has the behavior described below.

Expand Down
Loading