Skip to main content
← Back to Templates

Geo-Distributed Database

Store user session state in edge-local Rivet Actors so preferences and activity stay close to users.

Geo-Distributed Database

Features

  • Creates a region-specific Rivet Actor using createInRegion and createState input.
  • Persists session preferences, recent activity, and last login time in actor state.
  • Measures action latency to highlight the benefit of edge-local updates.
  • Visualizes data locality with a world map and region indicators.

Implementation

The UserSession actor initializes state with a region input and stores session data in persistent state. See the implementation in src/actors.ts.

The frontend connects with createInRegion and displays session locality from the actor state. See the client UI in frontend/App.tsx and the server wiring in src/server.ts.

Resources

Read more about state, actions, and actor inputs.