swarm icon indicating copy to clipboard operation
swarm copied to clipboard

MongoStorage ?

Open temsa opened this issue 10 years ago • 3 comments

ReadMe references https://github.com/gritzko/swarm/blob/master/lib/MongoStorage.js , yet it does not exist :(

BTW an ElasticsearchStorage using official client would be great too ! I may do it by myself if I really understand either the LevelDB one or the FileSystem one

temsa avatar Jan 23 '15 01:01 temsa

That would be a valuable contribution. Storage is the base class. Implementations override writeState, readState, writeOp, readOps. Former two methods deal with state snapshots. The latter two append ops to the log and read it, respectively. Storage is totally agnostic about CRDT/logic; it deals with plain key-value pairs. In MongoDB, we used arrays to keep the log. But (1) that was an ugly hack, (2) that code is not open source and (3) arrays are not actually necessary (key-value is OK as the order can be derived from the keys).

gritzko avatar Jan 23 '15 06:01 gritzko

Do you have any plans to make the Mongo Storage driver available?

garethdown44 avatar Jul 15 '15 07:07 garethdown44

0.4 works differently. It is backed by an ordered key-value engine (everything levelup). So, it is possible to export data to MongoDB in real-time. @garethdown44, is such an option suitable for you? What is your scenario?

gritzko avatar Jul 16 '15 08:07 gritzko