Hi Vincent,

I have somewhat different long standing opinion on several topics touched
by Jan, so I decided to add some notes )

> small VPS that also runs my small web-applications as well

I also have a lot of small instances, however we also use Couch for much
larger projects. Couch scales well not only as a cluster, but also as a
mesh, i.e. a set of nodes of very different perf and workload, more or less
independent, and only syncing small portions of data or design docs.

> how long-time users are querying their JSON documents mostly nowadays

Mostly map/reduce, mostly JS.

Mango is attractive if your docs are small and are in a way ‘atomized’
(docs with a single data record, not an aggregate of records). A single doc
can only emit a single key into a given Mango index, but map function can
emit several index keys with different values for each item of a complex
doc.

Couch is great for large complex docs of flexible structure, map/reduce
approach fits them remarkably well. Couch is ok for small docs of
predefined structure if performance and storage isn’t an issue. Otherwise
SQL-like DBs are generally much faster.

> are "Validate Document Update Functions" also part of the  "Update
functions"
>> update functions receive any HTTP requests and transform them into
CouchDB docs

Actually, rewrite + update functions provide that feature. Update function
alone, without rewrite, only accepts requests of predefined syntax, which
limits it immensely in terms of transforming any HTTP request into CouchDB
doc.

> since I use Nginx, I personally never even considered it

Well, if you build small webapps using nginx and Couch, consider looking at
rewrite as a function. Moving from long nginx configs to JS code was one of
the incentives to implement rewrite-as-js-function feature. See
https://docs.couchdb.org/en/stable/api/ddoc/rewrites.html#using-a-stringified-function-for-rewrites
for more details.

Rewrite functions are for making simple APIs right on top of Couch, so they
can be useful for established Mango queries – you can have a much simpler
API for known requests in your webapp.

Cheers,
ermouth

Reply via email to