Database wrapper for realtime applications, providing the backend for ShareJS, Racer, and Derby. This package (v0.5.13 at current release) exposes an API for submitting operations (via OT), subscribing to document changes, and making live queries. It requires a separate database backend (e.g., livedb-mongo for MongoDB) and an optional driver for multi-server setups. Key differentiators: built for Operational Transformation, stores all operations forever, and supports live query result feeds. Note: the v5 releases listed are for the related share/sharedb package, not livedb itself; livedb appears to be in maintenance mode with no recent updates.
npm install livedbVerified import paths — ran on the pinned version, not inferred.
Shows how to connect to MongoDB via livedb-mongo, subscribe to a document, and submit create and edit operations using OT.
Consider migrating to sharedb (npm: sharedb) which is the successor.
Use a Redis-based driver for multi-server scenarios.
Use a persistent backend like livedb-mongo for production.
Initialize livedb with a driver: livedb.client(db, { driver: redisDriver }).npm install livedb-mongo
Use const backend = livedb.client(db); then call backend.submit(...).
Install the ot-json0 package and register it: const json0 = require('ot-json0'); livedb.types.register(json0.type);