Multi-Region State

Databases that
Span the Globe.

Stop wrestling with read replicas and eventual consistency. Rivet Actors replicate state automatically across regions, giving every user local latency for both reads and writes.

global_config.ts
1import { actor } from "rivetkit";
2
3export const globalStore = actor({
4 // Pin data to specific regions for sovereignty
5 // This actor never leaves the EU
6 region: ["fra", "lhr"],
7
8 state: { inventory: {} },
9
10 actions: {
11 // Reads are served from the nearest local replica
12 getItem: (c, id) => c.state.inventory[id],
13
14 // Writes are coordinated globally (Paxos/Raft)
15 updateStock: (c, id, qty) => {
16 c.state.inventory[id] = qty;
17 c.broadcast("stock_update", { id, qty });
18 }
19 }
20});

Latency is the Enemy

Don't send your users across the ocean for a database query. Rivet brings the data to the edge, synchronizing state changes across regions.

World Map

Distributed Superpowers

The benefits of a global CDN, but for your application state.

Read from Anywhere

Requests are automatically routed to the nearest regional replica. Reads are served from local memory in <5ms.

Write Locally

Writes are accepted by the local node and asynchronously replicated to other regions. No global locking required for most ops.

Conflict Resolution

Built-in CRDT (Conflict-free Replicated Data Types) support handles concurrent edits gracefully.

Edge Caching

Actors act as intelligent caches that can execute logic. Invalidate cache globally with a single broadcast.

Data Sovereignty

Pin specific actors to specific regions. Ensure data never leaves a jurisdiction (e.g. Germany) to satisfy compliance.

Partition Tolerance

If a region goes dark, the rest of the cluster continues to operate. State heals automatically when connectivity returns.

Case Study

Global Inventory System

A retail platform tracking stock across warehouses in 12 countries.

  • Real-time: Stock levels update globally in <100ms
  • Resilient: Local warehouses can continue operating if the transatlantic cable creates latency
  • Consistent: Overselling prevented via regional allocation pools
Item: SKU-992
Global Stock: 14,200
Synced
New York4,200
London3,800
Tokyo6,200
Replication Lag: 45ms

Built for Scale

Global User Profiles

Store user settings and session data close to where they are. Login in Tokyo feels as fast as login in NY.

Content Delivery

Serve dynamic, personalized content from the edge without hitting a central origin database.

IoT Data Aggregation

Ingest sensor data locally in each region, aggregate it, and replicate summaries to HQ.

Multi-Region Failover

Keep a hot standby of your entire application state in a second region for instant disaster recovery.

Works with your stack

AWS (Global)
GCP
Azure
Fly.io
Cloudflare
Vercel Edge

Go Global.

Stop worrying about latency. Start building applications that feel local to everyone, everywhere.