Let’s say I have some data in a CouchDB database. The overall size is about 100K docs.
I have a _design doc which stores a ‘get all entities’ view.
Assuming the requests are done on a local machine against a local database:
- via curl:
curl -X GET http://127.0.0.1/mydb/_design/myexample/_view/all - via Couchdbkit:
entities = Entity.view('mydb/all’)
Does 1 have to perform any additional calculations compared to 2 (JSON encoding/decoding, HTTP request parsing, etc.) and how can that affect the performance of querying ‘all’ entities from the database?
I guess that directly querying the database (option 2) should be faster than wrapping request/response into JSON, but I am not sure about that.
Under the API covers, Couchdbkit uses the
restkitpackage, which is a REST library.In other words, Couchdbkit is a pythonic API to the CouchDB REST API, and will do the same amount of work as using the REST API yourself.