How volatile paths work
Volatile paths are special paths in your database optimized for high-frequency updates. When you write to a volatile path:- The write resolves immediately on the client. There’s no waiting for a server acknowledgment.
- The server batches and coalesces volatile updates before broadcasting them. If a client writes 60 cursor positions per second, subscribers don’t receive all 60. They get the latest value at each broadcast interval.
- Only the most recent value for each path is sent. Intermediate states are dropped.
Volatile vs. regular writes
| Regular writes | Volatile writes | |
|---|---|---|
| Acknowledgment | Server confirms the write | Resolves immediately, no server ack |
| Denials | Server sends an error the client can handle | Silently dropped |
| Delivery | Reliable, ordered | Best-effort, latest-value-wins |
| Persistence | Written to durable storage | Not persisted — in-memory only |
| Broadcast | Every change is sent to subscribers | Batched and coalesced before broadcast |
| Transport | TCP (WebSocket) or QUIC streams (WebTransport) | TCP (WebSocket) or UDP datagrams (WebTransport) |
Over WebTransport, volatile writes use UDP datagrams — truly unreliable delivery for maximum speed. Over WebSocket, they’re sent as regular TCP messages but are still batched and coalesced on the server before broadcast.
Batching rates
The server broadcasts volatile updates at fixed intervals:- WebTransport clients: ~20 Hz (every 50ms). At most 20 volatile updates per second reach each subscriber.
- WebSocket clients: ~7 Hz (every 150ms). Slower than WebTransport due to TCP overhead, but still fast enough for smooth updates.
Size limit
Each volatile write is limited to 2 KB. Keep your volatile payloads small — coordinates, velocity vectors, flags. If you need to send more, break it into multiple paths.Configuring volatile paths
Mark a path as volatile by adding".volatile": true in your security rules:
.volatile rule automatically uses volatile delivery. You don’t need to change your write code — the same set() and update() calls just behave differently under the hood.
Rules restrictions on volatile paths
Volatile paths support.read, .write, and .validate rules, but they must be simple rules — rules that don’t reference existing database state. Specifically, a rule on a volatile path cannot contain data. or root. anywhere in the expression. These require reading current state from storage, which is incompatible with the volatile fast path.
Any rule variable that doesn’t require reading existing state — auth, newData, $wildcards, now, literals, and operators — works fine. The two that don’t work are data and root, since both require reading current database state.
Volatile snapshots
When you receive a volatile update through a subscription, the snapshot includes extra metadata:snapshot.isVolatile()— Returnstrueif this update arrived via volatile delivery.snapshot.getServerTimestamp()— The server timestamp when the volatile value was broadcast. Use this for interpolation or lag compensation in games.
When to use volatile paths
Volatile paths are the right choice when:- The data changes many times per second
- You only care about the latest value, not every intermediate state
- Missing an update is acceptable (the next one will arrive shortly)
- Cursor and pointer positions
- Player position and velocity in games
- Typing indicators
- Drag-and-drop coordinates
- Animation state and transforms
- Camera position in collaborative 3D editors
- Scores and leaderboards (every increment matters)
- Inventory and currency (can’t afford to miss a change)
- Chat messages (users expect to see every message)
- Game actions and events (order and completeness matter)
Volatile data is not persisted to disk — it lives in memory only. If the server restarts, volatile data is gone. This is by design — volatile paths are for ephemeral, high-frequency data where the next update is always right behind the current one.

