skanatek
skanatek

Reputation: 5251

Is it faster to query CouchDB via an adapter instead of REST?

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:

  1. via curl: curl -X GET http://127.0.0.1/mydb/_design/myexample/_view/all
  2. 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.

Upvotes: 2

Views: 211

Answers (1)

Martijn Pieters
Martijn Pieters

Reputation: 1122222

Under the API covers, Couchdbkit uses the restkit package, 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.

Upvotes: 4

Related Questions