Inject CouchDB

Is there a layout for CouchDB, i.e. same REST interface and semantics, but only in memory? We have testuite, which each time runs each test in an untouched database (to be reproducible), but working with a real database can be faster.

+8
couchdb
source share
5 answers

Do you mean running against a mock database?

I donโ€™t think there is anything right out of the box. Two ideas:

  • CouchDB in the file system memory. Configure ramdisk or tmpfs mount and configure CouchDB database_dir and view_index_dir to specify there.
  • PouchDB brings CouchDB to the IndexedDB browser. You did not specify which language and environment you are using, but if you can run Node.js, it can be interesting to learn. PouchDB has a good boost, and I think it will launch in Node.js soon (possibly via jsdom or some other library). Please note that this does not give you a complete solution, but you expanded your question to โ€œmemory IndexedDB for Node.jsโ€, for which the answer is either โ€œyesโ€ or โ€œsoonโ€, given its trajectory of adoption.
+6
source share

Found the following: https://github.com/RipcordSoftware/AvanceDB - it supports different platforms and seems to be a serious effort.

+2
source share

Pretty late, but I had great success using the pouchdb-server based on the aforementioned PouchDB project (JavaScript of CouchDB implementation). It can work with various background contents, including internal memory. That means you can run

 pouchdb-server --in-memory 

to get a memory compatible CouchDB server. There are also several other command line options available.

I think it can run the entire CouchDB test suite, so I guess you are unlikely to run into too many implementation differences.

+2
source share

I have the same problem ... for tests, I just don't want to configure couchdb ... I just want to have some memory files as simple as possible.

What I did: * I create memory CouchDB Connector => this is just a very simple implementation of "org.ektorp.CouchDbConnector" * By spring, I connect the CouchDbConnection-Implementation, which I need => when I use it for my dev tests. I am connecting my CouchDB Connector memory, if I want to connect to a real CouchDb, I use a regular => org connector. ektorp.impl.StdCouchDbConnector

The only problem is that "org.ektorp.CouchDbConnector" has over 50 methods that need to be implemented. For my problems, it was enough to implement only some of these methods. Depends on your test boxes.

0
source share

memorydb is a partial (incomplete) in-memory implementation of CouchDB used with Kivik , which can be run as a stand-alone server.

Not all features are implemented yet.

-one
source share

All Articles