Introduction
Golem is a durable computing platform that makes it simple to build and deploy highly reliable distributed systems.
The WASM component model eliminates the need for microservice architectures, since components written in different languages can interact with each other in-process (through component composition), without having to go through remote protocols like HTTP, gRPC, or JSON RPC.
Despite this, however, there are times when remote procedure calls (RPC) are useful or necessary when developing applications on Golem:
- You want to parallelize computation that cannot be done on a single agent, either due to lack of memory or lack of compute.
- You want to partition state that is too large to store in a single agent; or, perhaps, you want to partition state that can fit in a single agent, but cannot be read and written fast enough due to contention.
Both of these are examples require the development of a distributed system, where some combination of state and computation is distributed to improve performance, reduce latency, or improve scalability.
To build a system that distributes state or compute, it is necessary to coordinate work, which requires RPC of some kind.
Recognizing the critical nature of internal communication for many distributed systems, Golem provides a feature called agent-to-agent communication. This feature allows you to simply, and in a type-safe way, communicate between agents, with strong guarantees, such as reliable, exactly-once invocation semantics.
Technical details
For agent-to-agent communication, Golem generates a type-safe client interface for each remotely callable agent type. These client interfaces are matching the agent type's interface.