Skip to main content

How it works

What is Cosmonic?

Cosmonic is your platform to build globally distributed applications based on WebAssembly that run on any cloud and any edge. We use wasmCloud to provide you with the ability to run Wasm components in our cloud or to host them anywhere. The magic of running them anywhere is that we connect them all for you as part of a single, secure and simple to use compute mesh from any cloud, server or edge.

So how does it work?

We provide a fully-managed PaaS to support and scale your complete multi-component Wasm applications to run and communicate from anywhere to anywhere. To do this, we host a NATS server for you allowing all of your different hosts to connect and talk to each other. We then provide you with a host that you can run anywhere you want that we connect to your flat mesh network. As a developer, you can then write and run code compiled into Wasm on any of these hosts.

Your Constellation Architecture

You interact with Cosmonic through a constellation, a managed, flat network which allows components of your applications to communicate seamlessly.

Below is an annotated diagram of the logical architecture of a constellation:

XKCD architecture

Want to see where the infrastructure is running?

When needed, we can also think about a constellation from an infrastructure perspective, where hosts become relevant. Still, wasmCloud considers hosts as "cattle, not pets", and components maintain seamless communication regardless of which hosts they run on. Check out how all our parts come together:

XKCD architecture

All the bits

  • Your constellation. Your constellation is your own managed wasmCloud lattice.

    • 🛜 Lattice: a mesh network, powered by NATS. A flat topology self-healing network to handle all your distributed needs (it’s how stuff talks).
    • 🖇️ Link or link definitions: Declarative links between our Actors and Providers. These tell our host, the actual runtime, what capabilities our actor should have access to.
    • 🧩 Interface: The functional definition of an actor or capability, defining how they will interact
  • 🖥️ Host: a node, runtime host (could be your laptop or a cloud provider)

Our running objects (components):

  • 🏃 Actors: WASM payloads, stateless functions corresponding to an interface. We store these in a registry (the same as you would containers) using the industry standard OCI format (a blob and a manifest) They can handle messages and invoke functions on our capability providers They are the heart of our core business logic that we are implementing
  • 🗃️ Capability providers: these are stateful providers of services like a blob store, DB, HTTP server etc. These also get stored in a registry as an OCI object

Then we have two bonus definitions

  • 🪱 A Wormhole, this is a publicly accessible endpoint for hosting your application

Each of these Actors & Providers correspond to interfaces. Because my Actor is designed to work with an HTTP client (defined in an interface), hooking them up together is as simple as dragging and dropping 😱

This is a simple example, but the point is that I can take that HTTP provider or that actor and run them on any host. They can still talk, replicate and work together without me having to worry about runtime, recompiling or putting it in a container. Whether that host is a Raspberry Pi, AWS or on Cosmonic, my application will just work.