couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilya Khlopotov <iil...@ca.ibm.com>
Subject Vendor specific customisation for couchdb
Date Wed, 25 Feb 2015 19:18:39 GMT


Hello everyone,

I would love to discuss a possibility of allowing couchdb customisation.
CouchDB has lots of features which are not easy to plug into without
forking the code.
Forks brings extra maintenance overhead which we want to avoid.
It would be very helpful if it would be possible to extend couchdb without
modifying it's source code.
In order to achieve that I can see two approaches:

- Implement set of hooks in form of {Module, Function, Arguments} (MFA)
configured via app env or config.
- Introduce a notion of vendor specific plugin. Configure plugin module in
config and call hooks like <plugin>:<hook>(Args). Use [vendor] section in
config to specify args to pass to hooks.

I've pushed couple of PRs using approach #1.
https://github.com/apache/couchdb-global-changes/pull/3
https://github.com/apache/couchdb-couch/pull/38

Here is the list of hooks I can think of (incomplete and driven by current
needs):

- ddoc_validator
- dbname_validator - PR
- docid_validator
- mrview_update_notify - notify when there is any change
- seq_formatter (maybe) - "<int>-<hash>" vs [<int>, <hash>] vs fully
custom
-
https://github.com/apache/couchdb-global-changes/blob/windsor-merge/src/global_changes_httpd.erl#L89
- allowed_owner - PR

I would love to hear a community opinion on:

- Would you like this customisation to be possible?
- Which approach of the mentioned is better or propose your own?
- What additional hooks you can think of (useful if we go with approach
#2)?
- Should we unify the way hooks handle errors? Return {error, Reason} |
throw | crash?
- How do we pass extra args to hooks? [vendor] section | custom keys
anywhere in config | MFA?

BR,
ILYA
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message