Socket.IO Redis Adapter

Scale Socket.IO across multiple server instances by broadcasting events through Redis

Library
npm
v8.3.0
2,768stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
58/100Fair
Development Activity28
Maintenance24
Community80
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture80
Code Quality82
Innovation65
Learning Curve78

@socket.io/redis-adapter is the official Socket.IO adapter that lets a single logical Socket.IO deployment span multiple Node.js server processes. By default, Socket.IO can only broadcast events to sockets connected to the same process; this adapter uses Redis Pub/Sub (or Redis’s newer sharded Pub/Sub for cluster mode) to relay emit() calls, room management, and acknowledgements across every server node, so clients connected to different instances still see each other’s real-time events.

It supports both the redis and ioredis client packages, standalone Redis and Redis Cluster topologies, and — since Socket.IO 4.1+ — inter-server communication features like broadcast acknowledgements and remote socket management. The README includes an explicit security notice: Redis Pub/Sub traffic is unauthenticated and unencrypted by the adapter itself, so Redis must be treated as trusted internal infrastructure, not exposed to untrusted networks.

What You Get

  • createAdapter(pubClient, subClient) for the standard Pub/Sub-based adapter, compatible with both redis and ioredis clients
  • createShardedAdapter() for Redis 7.0+ sharded Pub/Sub, designed to scale Pub/Sub usage in Redis Cluster deployments
  • Support for Redis Cluster topologies via createCluster/Cluster client configuration on either side
  • Inter-server broadcast acknowledgements and remote socket management (since adapter 7.0.0 / Socket.IO 4.1.0+)
  • Configurable options (key/channelPrefix, requestsTimeout, subscriptionMode) for tuning channel naming and cross-node request behavior

Common Use Cases

  • Horizontally scaling a Socket.IO-based real-time application across multiple Node.js server processes or containers
  • Running a chat or notification system behind a load balancer where clients may land on different backend instances
  • Coordinating room membership and presence across a multi-node Socket.IO deployment during rolling deploys or autoscaling
  • Migrating a growing Socket.IO app from a single-process deployment to a horizontally scaled architecture without changing application-level event code

Under The Hood

Architecture - The core implementation in lib/index.ts (~950 lines) extends Socket.IO’s base Adapter class, overriding broadcast, room-management, and acknowledgement methods to additionally publish serialized packets to Redis channels and process incoming messages from subscribed channels on other nodes. lib/sharded-adapter.ts implements a parallel adapter built on Redis’s sharded Pub/Sub (SSUBSCRIBE/SPUBLISH) introduced in Redis 7.0, which distributes Pub/Sub load across cluster shards instead of a single channel. lib/util.ts centralizes packet encoding/decoding shared by both adapters.

Tech Stack - Written entirely in TypeScript, published with compiled type declarations, and designed to work with either of the two dominant Node.js Redis clients (redis and ioredis) rather than bundling its own — the adapter only needs a pub/sub-capable client instance passed in.

Code Quality - Tests under test/ (index.ts, specifics.ts, custom-parser.ts, util.ts) run against a real Redis instance provisioned via the included docker-compose.yml, exercising actual pub/sub behavior rather than mocked Redis calls — an appropriate choice given how state- and timing-sensitive cross-node broadcast logic is. A compatibility table in the README explicitly maps adapter major versions to supported Socket.IO server versions, showing deliberate attention to avoiding breaking changes for existing deployments.

API Design - Integration is a single line — pass createAdapter(pubClient, subClient) (or createShardedAdapter) into the Socket.IO Server constructor’s adapter option — with all further usage identical to single-process Socket.IO code, so application logic doesn’t need to change when scaling out. The explicit security notice in the README about treating Redis as trusted infrastructure is a notable, responsible piece of documentation often missing from comparable adapters.

Used by 12 apps in this directory

TypeScript
99%
Other

Activepieces

Automation · AI Assistants

23,887

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
65
Dependency
Built with
TypeScript99%
Updated today
TypeScript
88%
Other

AFFiNE

Productivity · Project Management · Note Taking

71,668

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
68
Dependency
Built with
TypeScript88%
Updated today
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
69%
Other

Budibase

Low Code Platforms · No Code Platforms

28,220

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
92
Repo Health
81
Technical
63
Dependency
Built with
TypeScript69%
Svelte26%
Updated today
JavaScript
99%
Other

ChartBrew

Analytics · Databases

4,041

Open-source reporting platform to build live dashboards from SQL, NoSQL, APIs, and SaaS tools with an AI assistant that creates charts from natural language.

View details
90
Repo Health
83
Technical
65
Dependency
Built with
JavaScript99%
Updated 6 days ago
TypeScript
95%
AGPL 3.0

Docmost

Productivity · Note Taking · Collaboration

21,411

Self-hosted collaborative wiki and knowledge base with real-time editing, diagrams, AI assistance, and enterprise access controls — a modern alternative to Confluence and Notion.

View details
89
Repo Health
70
Technical
71
Dependency
Built with
TypeScript95%
Updated yesterday
TypeScript
98%
Other

Hexabot

AI Development · Automation

1,186

Build and run agentic workflows across channels with YAML, tools, and RAG

View details
79
Repo Health
76
Technical
70
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
64%
Other

NocoDB

No Code Platforms · Databases · Low Code Platforms

64,586

Turn any SQL database into a collaborative no-code spreadsheet with automatic REST APIs and real-time views.

View details
91
Repo Health
77
Technical
64
Dependency
Built with
TypeScript64%
Vue31%
Updated today
JavaScript
87%
GPL 3.0

NodeBB

Community

15,199

Modern Node.js forum software with real-time WebSockets, multi-database support, and a plugin ecosystem — the community platform built for the open web and the Fediverse.

View details
97
Repo Health
78
Technical
71
Dependency
Built with
JavaScript87%
Go Template12%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search