|
|
|
|
|
by brian_cloutier
1527 days ago
|
|
I can see how you would think they are similar! Actors usually refers to a scheme with multiple coroutines which communicate via message passing. The emphasis is on the fact that there is no shared state: all communication happens via message passing. It's usually something which comes up in programming language design. State Machine Replication usually refers to a scheme where all operations are serialized to a log and have a completely deterministic result, allowing you to reach the same state on any other machine simply by replaying the log. The emphasis is on existence of that persistence log, and on the deterministic result of applying it. It's usually something which comes up in distributed systems. It's also a common pattern in databases though it's usually just called "replication". Erlang is the classic actor model example. Most erlang deployments do not keep persistent logs of messages. There are "inbox"es but those are transient and message disappear as soon as they are processed, actors are also not required to have deterministic responses to incoming messages. So, most erlang programs do not resemble state machine replication! The classic example of SMR is something like Postgres streaming replication. One machine saves all changes to a log before it commits any transactions, and another machine is continuously processing that log. This gives you two instances of the database, making it easy to switch over to the second machine if the first one ever fails. This kind of looks like actors, if you squint, but usually when we talk about actors we don't think of each of the processes running on each of our machines as actors. |
|