Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CouchDB in-memory implementation

Tags:

couchdb

Is there a mock backend for CouchDB, i.e. same REST interface and semantics but purely in-memory? We have a testsuite that runs each test on a pristine database every time (to be reproducible), but running against real database could be faster.

like image 503
Alex B Avatar asked May 11 '12 01:05

Alex B


People also ask

Is CouchDB in memory database?

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

What is the maximum number of views a document can have in CouchDB?

The default value for many OSes is 1024 or 4096. On a system with many databases or many views, CouchDB can very rapidly hit this limit.

What is node CouchDB?

js databases: Using CouchDB. Much like the previous two databases we presented here, CouchDB is an open-source key-value store. But it's also a bit more than that. Each record is not an opaque string: it's a JSON document that the engine understands.


1 Answers

Do you mean running against a mock database?

I do not think there is something right out of the box. Two ideas:

  1. CouchDB on a memory filesystem. Set up a ramdisk, or tmpfs mount, and configure the CouchDB database_dir and view_index_dir to point to there.
  2. PouchDB is porting CouchDB to the browser IndexedDB standard. You did not say which language and environment you are using, but if you can run Node.js, this might be worth looking into. PouchDB has good momentum and I think it will be running in Node.js soon (perhaps through jsdom or some other library. Note, this does not get you the full solution; but you have expanded your question to "are there in-memory IndexedDB implementations for Node.js" for which the answer is either "yes" or "soon," given its adoption trajectory.
like image 152
JasonSmith Avatar answered Sep 19 '22 19:09

JasonSmith