liveBook · Manning

Replica

As explained in Server-Side WebAssembly

A replica is an independently running copy of a component or service deployed to handle workload alongside other copies.

A replica is an independently running copy of a component or service. Running several replicas lets requests execute in parallel instead of waiting behind one internally single-threaded component instance. section 6.3

In a wasmCloud deployment, replicas provide:

  • Parallel request handling through NATS lattice load balancing. section 6.3
  • Distribution across hosts, zones, machines, data centers, or geographic regions. section 6.4
  • Improved fault tolerance and potentially lower latency through weighted regional placement. section 6.4

Scale and benchmark an HTTP component

Set the spreadscaler count to instances: 10, redeploy with `wash app delete rust-hello-world` and `wash app deploy ./wadm.yaml`, then run `oha -n 10 -c 5 http://127.0.0.1:8000`. The average response time falls from about 8 seconds with one replica to about 2 seconds with ten.

Figure 6.4 Updated architecture diagram for “Hello, World” wasmCloud app with 10 replicas of the http-component split across different hosts and regions (i.e., us-east-1 and us-west-1)

Trace how replicas of one HTTP component can be split across East and West Coast hosts and regions. section 6.4

How Server-Side WebAssembly covers it

How deep it goes
Explains configuration, benchmarking, load balancing, host placement, and regional weighting, but does not detail replica lifecycle internals.
Examples
Demonstrates one versus ten HTTP-component instances, weighted East/West placement, inventory inspection, and host shutdown.
What it assumes
Assumes a wasmCloud application and component deployment, while demonstrating scaling from a single instance.
What you can do after
Operate/configure replicas with spreadscaler, deploy them through wash, benchmark them with oha, and inspect host placement.
How it connects
Connects replicas with load balancing, concurrency, NATS, fault tolerance, geographic distribution, and persistent storage.

Also explained in

Compare how 12 books explain replica →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Server-Side WebAssembly. The section links point to the parts of the book it draws on.