I'm looking for file-based embedded store for Node.js with following features:
- Support for master-master replication that replicates real time changes so you can easily have a cluster of node.js processes (on several servers) where you can read or write to any of them. An appropriate conflict-resolution mechanism should be thought of.
- Support for both JSON and binary values
- Non-memory-based
I would take a look ad LevelUP and its plugin level-replicate and multilevel.
https://github.com/rvagg/node-
https://github.com/
https://github.com/
I'm looking for file-based embedded store for Node.js with following features:
- Support for master-master replication that replicates real time changes so you can easily have a cluster of node.js processes (on several servers) where you can read or write to any of them. An appropriate conflict-resolution mechanism should be thought of.
What are your application's requirements for conflict-resolution? This isn't something that can be hidden from an application; it affects semantics of the system.
ready-made solutions that I know of include CouchBase and CouchDB.
they are both pretty much the same in regard of your requirements.
- blobs and docs are supported natively (but better done by CouchDB for JSON)
- They both have master-master replication in real-time with default or custom conflict resolution mechanisms.
- They both persist to disk even though CouchBase caches a lot more in-memory
Where they differ
- CouchDB talks HTTP, CouchBase talks the memcached protocol
- CouchDB uses map/reduce javascript functions to expose your data whereas CouchBase has N1QL (sql-like). This doesn't matter in any of them if you use this purely as key-value
- CouchDB doesn't cache anything in memory
If you have a lot of writes, use CouchBase. There is a node driver developed by them.
Other solutions include etcd and zookeeper that I know less but also satisfy your use-case.
댓글 없음:
댓글 쓰기