Does CouchDB support caching?

Does CouchDB support caching out of the box, or do I need to manually have a cache proxy in front of it, like Squid?

+6
caching couchdb
source share
2 answers

Short answer: None.

Long Answer: Yes?

The whole philosophy of CouchDB is to think about everything that may be requested later, calculate it now (when it's convenient) and save the result in the index. All access to data from CouchdB comes from scanning one of these indices, which is very fast and tends to take about the same amount of time regardless of the amount of data (actually logarithmic time).

In addition, CouchDB does not consume much memory because it expects the operating system to cache its disk operations. The file system cache provides tremendous performance.

Finally, CouchDB supports all web standards for caching, so browsers and ISPs often cache it without doing anything special.

I believe my point is that for a high read load, CouchDB often does not need a cache. However, no, there is no built-in caching function. One of the reasons CouchDB uses HTTP is to allow people to use standard tools to solve their problems. Many people use web proxy caching in front of CouchDB in production.

+13
source share

It supports form caching through ETags . (HTTP caching mechanism)

ETag matches document number _rev . You can send an If-None-Match header along with a GET request. If there is a new version, the server will send it. Otherwise, it sends the 300 Not Modified header, letting you know that you can continue to use the existing version.

+5
source share

All Articles