CouchDB for event sourcing -


i've been playing couchdb week , love it; it's convenient nosql db i've seen far.

now i'm considering using (cloudant, actually) manage entities in event sourcing fashion, have doubts couchdb suitable such case...

let's want manage "type" "projection" like:

{     "field1":"some-string",     "field2":["an","array","of","strings"] } 

i insert events like:

{ "type":"set-field1", "value":"another-string" } { "type":"remove-field2", "value":"strings" } { "type":"add-field2", "value":"bugs" } 

and guess, expect "projection" become:

{     "field1":"another-string",     "field2":["an","array","of","bugs"] } 

now i'm still noob in map/reduce, intuition that:

  • the reduce have pretty elaborate js , docs i've read recommend use built-ins reduce functions exclusively
  • even though map executed incrementally on objects being added/updated (and somehow deleted), guess reduce executed on full output of map, makes previous point worse...

that's right now. thing i've found concerning couchdb in event sourcing approach this article (which uses built-in _sum reduce, of course!). appreciate advises/opinions couchdb power users relevance of (modest) analysis.

thanks


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -