@teamwork/sharedb-redis-pubsub

Redis pub/sub adapter adapter for ShareDB

Usage no npm install needed!

<script type="module">
  import teamworkSharedbRedisPubsub from 'https://cdn.skypack.dev/@teamwork/sharedb-redis-pubsub';
</script>

README

sharedb-redis-pubsub

NPM Version Build Status Coverage Status

Redis pub/sub adapter adapter for ShareDB.

This ShareDB add-on gives you horizontal scalability; the ability to have a cluster of multiple server nodes rather than just a single server. Using this adapter, clients can connect to any machine in your cluster, and the ops they submit will be forwarded clients connected through other nodes, and there will be no race conditions with regard to persistence.

Usage

This snippet shows how to load this library and pass it into a new ShareDB instance.

var redisPubsub = require('@teamwork/sharedb-redis-pubsub')(redisClient); // Redis client being an existing redis client connection

var backend = new ShareDB({
  db: db,  // db would be your mongo db or other storage location
  pubsub: redisPubsub
});