Hosts
Overview
The wasmCloud host is a runtime environment node. The host is responsible for loading, instantiating, and communicating among WebAssembly components and providers, in a secure, distributed way.
Servers as commodity
A core design principle of wasmCloud is that the health of the lattice and applications running on it should not be dependent on any particular host. Hosts are designed to be interchangeable and should be able to start and stop without causing downtime. While it's possible to run a single host in a lattice, it's also possible for workloads to be distributed across many hosts, and for those hosts to be dynamically scaling up and down in response to changing demand.
A secure sandbox
WebAssembly components require a runtime to execute. The wasmCloud host is not a WebAssembly runtime. The wasmCloud host uses Wasmtime, a fast, secure, and standards-compliant runtime that supports the Component Model, as its WebAssembly runtime. wasmCloud adds additional layers of security on top of the runtime as part of its zero trust security model.
Distributed observability
Observability is always important, but becomes essential in a distributed environment. wasmCloud is committed to providing first-class support for observability via the "three pillars."
Logs
Hosts emit unstructured (text) or structured (JSON) logs. The log level and format can be configured for each host at start time.
Tracing
wasmCloud supports OpenTelemetry for distributed tracing. When configured, the host will emit tracing data in response to every RPC call and control interface request. At this time, the primary host runtime supports OTLP for exporting tracing data to a collector.
Metrics
Hosts emit OpenTelemetry signals for metrics. See the metrics section of the Operator Guide for more information.
RPC as a bridge to capabilities
wasmCloud components cannot directly access capabilities. Instead, the host subscribes to incoming messages and makes outbound requests on behalf of components, using the wasmCloud RPC protocol. This removes the need for components (and developers!) to have any knowledge of the underlying transport mechanism, and allows the host to run untrusted components without compromising security.
The control interface
The API for managing hosts, their inventories (components and providers), and host/lattice metadata is a set of NATS subscriptions. A separate server is not needed to manage hosts and the lattice. Instead, each host within a lattice subscribes to NATS subjects corresponding to its own responsibilities, as well as lattice-wide subjects.
Interoperable events
Hosts will emit CloudEvents during normal operation, as well as in response to errors. These events reflect coarse-grained state changes for a lattice. This event log is useful for monitoring and observability, and is used internally by wadm to track whether applications have been successfully deployed.
Keep reading
Continue to learn more about the lattice, or...
- See Hosts for more detailed background on wasmCloud hosts.