Seven composable patterns
Use one, or combine them freely on a single WebSocket connection:
| Pattern | Direction | What it does |
|---|
| RPC | client → server → client | Typed request/response with correlation IDs |
| Server events | server → clients | Broadcast to all connected clients |
| Client events | client → server | Fire-and-forget (chat, analytics, telemetry) |
| Live state | server → clients | Automatic JSON Patch sync (dashboards, boards) |
| CRDT sync | client ↔ server | Conflict-free merge (collaborative editing) |
| Sync channels | configurable | Immediate, batched, or debounced flush per key |
| Combinations | any | All patterns compose on one connection |
No other library gives you all seven as first-class APIs on one connection. See Composability for examples of combining patterns (dashboard + actions, chat + presence, collab + voting, analytics pipeline).
Measured end-to-end with headless Chromium against a live Node.js server — not synthetic microbenchmarks. Every gate run re-measures. Web Worker transport and pako compression enabled (defaults).
| What | Result | What it means |
|---|
| RPC round-trip | p50 < 0.5 ms | Call a server function and get a typed response back in under half a millisecond |
| RPC small payload | p50 < 0.4 ms | Tiny JSON body under compression threshold — minimal overhead |
| RPC large JSON | p50 ~18 ms | Randomized ~1 KB JSON payload, pako-compressed on the wire |
| Binary frame streaming | ~6,900 frames/s | Server pushes 1 KB binary-like frames (audio/video metadata) at max rate |
| Two-way game tick | p50 ~4 ms | Client emit → server echo → client ack — full round-trip at emit speed |
| Server event broadcast | ~920 events/s | Push live updates to connected clients at nearly 1,000 events per second |
| Client fire-and-forget | ~235K events/s | Client → server emit throughput: 235,000+ events per second |
| CRDT sync | ~1,300 ops/s | Conflict-free counter increments with full round-trip sync |
| Mixed workload | p50 < 0.4 ms | RPC + events + state combined — sub-millisecond median under mixed load |
| Main-thread blocking | near zero | With Web Worker transport, the UI thread sees no Long Tasks even under flood load |
| Console errors | zero | Zero browser console errors or warnings across all benchmark scenarios |
3 s sustained load per scenario, single Node.js process, Chromium browser. Main-thread impact measured via Long Tasks API + rAF jitter. Console health tracked per-scenario. Full benchmark results, historical trends, and charts →
Bundle sizes
Client bundles inline everything for zero-dependency browser use. Server and shared bundles externalize runtime deps.
| Bundle | Loaded by | Raw | Gzip |
|---|
| Client IIFE (min) | <script> tag | 72.0 KB | 22.2 KB |
| Worker IIFE (min) | Web Worker | 48.3 KB | 15.3 KB |
| Shared (CJS) | import from bundler | 15.3 KB | 4.0 KB |
| Server (CJS) | Node.js require | 72.1 KB | 16.1 KB |
Use cases
datasole is a good fit anywhere you need performant, scalable realtime communication:
| Category | Examples |
|---|
| Games | Multiplayer lobbies, turn-based games, realtime scoreboards |
| Internal tools | Admin dashboards, monitoring panels, ops consoles |
| Analytics | Live metrics dashboards, A/B test monitors, funnel viewers |
| Native apps | Bun single-executable, Node SEA, Electron, Tauri — with rich web UIs |
| Streaming | Internet radio, watch parties, live commentary sync |
| Local servers | Dev tool frontends, CLI web UIs, process managers |
| Collaboration | Shared whiteboards, collaborative editing, design tools |
| IoT | Device control panels, telemetry viewers, sensor networks |
| Finance | Trading data feeds, portfolio trackers, auction platforms |
| Communication | Live chat, customer support, classroom Q&A |
| DevOps | CI/CD pipeline walls, deployment status, log streaming |
How it compares
See the full comparison with Socket.IO, Ably, Pusher, Liveblocks, and PartyKit.