The monolith hybrid
How we got here
Section titled “How we got here”The monolith. One codebase, one deploy, one database. It is simple to build, test and reason about, and a call between parts of it is a function call. But every customer shares one process and one database, you scale all of it or none of it, and one bad release takes everyone down.
Microservices. Split the monolith into services that deploy and scale on their own. That fixed the blast radius and the scaling, and made everything distributed. Each service now has its own image, its own datastore and, for confidential workloads, its own attestation. Calls between services become network calls with their own auth. Then come the service mesh, the message queues, distributed tracing, a pipeline per service, and data split across stores that has to be kept consistent. Every boundary is one more thing to build, run and secure.
The hybrid
Section titled “The hybrid”On Calimero you write something as simple as a monolith. The cluster runs it with what microservices were for.
| Kept from the monolith | Taken from microservices |
|---|---|
| One codebase, in one Rust workspace | An isolated instance per customer, with its own state and its own Raft log |
| One signed release; its parts upgrade together in one approval | Instances spread across nodes and zones, and moved live |
| No service mesh, no tokens between services, no per-service image to attest | One customer’s load or failure stays in their instance |
One package, several services
Section titled “One package, several services”A package can hold several services, each its own WASM component, built from one workspace and signed together:
[workspace.metadata.calimero]package = "com.example.team-notes"services = [ { name = "notes", path = "crates/notes" }, { name = "search", path = "crates/search" }, { name = "billing", path = "crates/billing" },]Each app instance runs one of them. They reach each other with cross-app calls: a message delivered once the
sending write commits (env::xcall), or a synchronous call or view in the same run (env::xcall_view). The
receiving method admits its callers in one line, #[app::allow(app = "notes")]; the node, not a token, says who is
calling. See Cross-app calls and
Packaging and signing.
Apps created with your app, upgraded with it
Section titled “Apps created with your app, upgraded with it”An app can also bring others with it. A reference with mode = "create" (a Confidential KV
store, for example) makes one for each instance of your app. Together they form a unit: created together, deleted
together, and upgraded together on one consent page, so there is no version skew between the parts to manage. See
Build on other apps.
An instance per customer
Section titled “An instance per customer”Each organization that uses your app gets its own instance: its own state, its own replicated log on three attested nodes, its own access rules. Instances are spread across the cluster’s nodes and zones, and the rebalancer moves them live as nodes are added. See Scaling and rebalancing.
One image underneath
Section titled “One image underneath”Every app on a cluster runs in the same attested node image, so adding a service doesn’t add an image to build, measure and attest. See Ship code, not images.