Pub/Sub adapters

  1. Available adapters
    1. MemoryPubSub
    2. ShareDBRedisPubSub
    3. ShareDBWSBusPubSub
  2. Usage

The pub/sub adapter is responsible for notifying other ShareDB instances of changes to data.

Available adapters

MemoryPubSub

ShareDB ships with an in-memory Pub/Sub, which can be used for a single, standalone ShareDB instance.

Unlike the database adapter, the in-memory Pub/Sub adapter is suitable for use in a Production environment, where only a single, standalone ShareDB instance is being used.

ShareDBRedisPubSub

sharedb-redis-pubsub runs on Redis.

ShareDBWSBusPubSub

sharedb-wsbus-pubsub runs on ws-bus.

Usage

An instance of a pub/sub adapter should be provided to the Backend() constructor’s pubsub option:

const backend = new Backend({
  pubsub: new MemoryPubSub(),
})