anything.solutions

Scaling AnythingCloud

AnythingCloud is designed to run more than one application worker and more than one load balancer node. The control plane keeps shared state in the database and in the service APIs; the request path does not depend on a single process holding a resource in memory.

Application workers

Run the web application as multiple identical workers behind the edge. A worker keeps no authoritative state on local disk:

  • Members, resources, routes, and usage live in the database.
  • Object bytes live in the S3-compatible store.
  • Worker and database nodes are reached through their service APIs.
  • Rate limits and sessions use the shared backend configured for the deployment, not a per-process dictionary.

Use PostgreSQL for a multi-worker deployment. SQLite remains useful for local development and single-host installs, but it serializes writes and is not the scaling path.

Load balancer data plane

The data plane is stateless. Every replica pulls a versioned snapshot from the control plane, validates it, and swaps it in atomically. A node can be added or removed without moving member data.

  • WEB nodes are interchangeable. The edge can send a hostname to any replica of its load balancer.
  • TCP nodes own the public addresses assigned to them. Moving an address between nodes is a control-plane operation.
  • Health is local to each replica; client affinity uses a consistent hash over the full backend set, so it survives a replica change.
  • Upgrades use a new process and a drain of the old one; connections are not dropped just to reload configuration.

Edge and DNS

The edge is the public TLS terminator for WEB hostnames. It balances a hostname across the load balancer replicas that are reported as running. For more capacity, register another data-plane node and add replicas to the load balancer; no member DNS change is needed.

Public IP traffic is tied to the node that holds the address. Extra capacity means another public-IP node and addresses moved to it. The control plane records the assignment so the data plane and edge agree on where the address lives.

Capacity rules

  • Add shared nodes before the shared replica count reaches capacity.
  • Add public-IP nodes before the address count on a node reaches its capacity.
  • Watch the load balancer and edge metrics: snapshot version lag, backend health, request rate, error rate, and active connections.
  • Scale the database and object store independently of the web workers.

What not to do

  • Do not run multiple workers against a local SQLite file on a shared network filesystem.
  • Do not put member state in a worker's local disk or in-process cache.
  • Do not put the control plane in the request path of a load balancer. The data plane must keep serving the last known-good snapshot while the control plane is unavailable.
  • Do not move a public address while its old node is still accepting traffic; drain the old node first.