Skip to content

datasoleThe full-stack realtime primitive for TypeScript

One npm install — server, client, shared types, CRDTs, and Web Worker all included. Self-hosted, Apache-2.0, free forever.

datasole

Seven composable patterns

Use one, or combine them freely on a single WebSocket connection:

PatternDirectionWhat it does
RPCclient → server → clientTyped request/response with correlation IDs
Server eventsserver → clientsBroadcast to all connected clients
Client eventsclient → serverFire-and-forget (chat, analytics, telemetry)
Live stateserver → clientsAutomatic JSON Patch sync (dashboards, boards)
CRDT syncclient ↔ serverConflict-free merge (collaborative editing)
Sync channelsconfigurableImmediate, batched, or debounced flush per key
CombinationsanyAll 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).

Performance benchmarks

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).

WhatResultWhat it means
RPC round-tripp50 < 0.5 msCall a server function and get a typed response back in under half a millisecond
RPC small payloadp50 < 0.4 msTiny JSON body under compression threshold — minimal overhead
RPC large JSONp50 ~18 msRandomized ~1 KB JSON payload, pako-compressed on the wire
Binary frame streaming~6,900 frames/sServer pushes 1 KB binary-like frames (audio/video metadata) at max rate
Two-way game tickp50 ~4 msClient emit → server echo → client ack — full round-trip at emit speed
Server event broadcast~920 events/sPush live updates to connected clients at nearly 1,000 events per second
Client fire-and-forget~235K events/sClient → server emit throughput: 235,000+ events per second
CRDT sync~1,300 ops/sConflict-free counter increments with full round-trip sync
Mixed workloadp50 < 0.4 msRPC + events + state combined — sub-millisecond median under mixed load
Main-thread blockingnear zeroWith Web Worker transport, the UI thread sees no Long Tasks even under flood load
Console errorszeroZero 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.

BundleLoaded byRawGzip
Client IIFE (min)<script> tag72.0 KB22.2 KB
Worker IIFE (min)Web Worker48.3 KB15.3 KB
Shared (CJS)import from bundler15.3 KB4.0 KB
Server (CJS)Node.js require72.1 KB16.1 KB

Use cases

datasole is a good fit anywhere you need performant, scalable realtime communication:

CategoryExamples
GamesMultiplayer lobbies, turn-based games, realtime scoreboards
Internal toolsAdmin dashboards, monitoring panels, ops consoles
AnalyticsLive metrics dashboards, A/B test monitors, funnel viewers
Native appsBun single-executable, Node SEA, Electron, Tauri — with rich web UIs
StreamingInternet radio, watch parties, live commentary sync
Local serversDev tool frontends, CLI web UIs, process managers
CollaborationShared whiteboards, collaborative editing, design tools
IoTDevice control panels, telemetry viewers, sensor networks
FinanceTrading data feeds, portfolio trackers, auction platforms
CommunicationLive chat, customer support, classroom Q&A
DevOpsCI/CD pipeline walls, deployment status, log streaming

How it compares

See the full comparison with Socket.IO, Ably, Pusher, Liveblocks, and PartyKit.