protoactor

Ask Pattern

protoactor docs
Ask Pattern The ask pattern provides request–response semantics between actors. An actor sends a message and waits for a reply, typically by using a future or awaiting a Task. Basic Flow sequenceDiagram participant Caller participant Target Caller->>Target: Request Target-->>Caller: Response In Proto.Actor you can use Context.Request when the sender expects the recipient to know who sent the message. For an awaitable response, Context.RequestAsync<T> or PID.RequestAsync<T> returns a Task<T> that completes when the reply arrives. Read more...

CAP Theorem

protoactor docs
CAP Theorem The CAP theorem states that in the presence of a network partition a distributed system can provide either consistency or availability, but not both simultaneously. For an overview of consistency trade‑offs, see Consistency Models. Consistency Reads return the most recent write. Choosing consistency often requires coordination—for example via Consensus and Leader Election—and may lead to unavailability if partitions occur. Availability Every request receives a response, even if it may not be the latest data. Read more...

Circuit Breaker Pattern

protoactor docs
Circuit Breaker Pattern A circuit breaker prevents a failing dependency from overwhelming the system. When error rates exceed a threshold the breaker “opens” and short‑circuits requests until the dependency recovers. State Transitions stateDiagram-v2 [*] --> Closed Closed --> Open: failures > threshold Open --> HalfOpen: timeout expires HalfOpen --> Closed: trial success HalfOpen --> Open: failure Why Use It? Remote calls may hang or fail rapidly. Without protection, actors waiting on those calls can pile up and consume resources. Read more...

Consensus and Leader Election

protoactor docs
Consensus and Leader Election Consensus algorithms coordinate state across nodes so that the cluster agrees on a single value. They are essential when strong consistency or coordination is required, as described by the CAP Theorem and the trade‑offs in Consistency Models. Why Consensus? Failures and partitions can create multiple conflicting updates. Protocols like Raft or Paxos elect a leader and replicate a log to keep nodes in sync. Proto.Actor and Consensus Proto. Read more...

Consistency Models

protoactor docs
Consistency Models Distributed systems must balance consistency with availability and latency. These choices are often framed by the CAP Theorem. Proto.Actor leaves those trade‑offs to application design so you can choose a model that fits your needs. Strong Consistency A strongly consistent system ensures that every read sees the latest write. Achieving this typically requires coordination or consensus which adds latency and reduces availability. Use strong consistency when correctness outweighs availability, e. Read more...

Idempotency in Messaging

protoactor docs
Idempotency in Messaging In distributed systems messages may be delivered more than once. Idempotent handlers ensure that processing a message multiple times yields the same result, making retries safe. Techniques Track processed message identifiers and discard duplicates Use database constraints or compare-and-swap operations Design operations so that applying them twice has no additional effect Proto.Actor Support Proto.Actor offers tools to help implement idempotency: Props.WithClusterRequestDeduplication keeps a cache of recent requests to drop duplicates Envelope Pattern groups messages so you can acknowledge a batch after state is persisted Durability explains delivery guarantees and why duplicate messages appear Combine these techniques with Reentrancy for non-blocking retries. Read more...

Messaging Patterns

protoactor docs
Messaging Patterns Actors communicate by exchanging messages. Proto.Actor supports several common patterns that build on this simple foundation. Send – fire and forget, the sender does not expect a reply. Ask Pattern – request–response using Request or RequestAsync. Envelope Pattern – batch multiple messages and acknowledge them as a unit. Routing – use Routers to distribute work across actors or forward messages. The diagram below summarizes how messages can be routed and queued. Read more...

Service Discovery

protoactor docs
Service Discovery Service discovery allows nodes to find each other without hardcoded addresses. In dynamic environments like containers or cloud deployments, discovery is essential to keep clusters connected. Approaches DNS or static lists – simple but inflexible. Central registries – systems such as Consul, etcd or Kubernetes APIs track active members. Gossip protocols – nodes exchange membership information peer‑to‑peer. Service Discovery in Proto.Actor Proto.Actor’s cluster providers use these approaches under the hood. Read more...

Sharding and Data Partitioning

protoactor docs
Sharding and Data Partitioning Sharding splits data or workload across nodes so that no single machine becomes a bottleneck. In Proto.Actor this typically means distributing virtual actors across the cluster. Why Shard? Scale horizontally by distributing actors or state. Reduce contention by isolating unrelated data. Place data close to users for lower latency. Strategies Consistent hashing keeps related keys on the same node and minimizes movement when members join or leave. Read more...

High Availability using Proto.Cluster

protoactor cluster Go
The Basic Ideas To better understand why and when clustering architecture should be adopted, the below subsections show the benefits of actor model in general, its remoting architecture, and its clustering architecture. Actor Model in General With the power of actor model, a developer has easier access to concurrent programming. The actor can keep mutable state, and its messaging queue – a mailbox – guarantees messages are passed to the actor one at a time. Read more...
1 of 4 Next Page
Icon