does the vote counter get incremented atomically?
Scratch my comment above, the caching and flushing is introduced in a future blog post. In this iteration of the code base, an attempt is made to save a vote to the DB. If it fails, it fails, there is no attempt to retry.
https://github.com/crabasa/votr-part1/blob/master/events.js#...
A comment was made about whether the vote persistence would be considered ACID. Most likely not! Each vote that comes in fetches a copy of the event document. If votes came in fast enough, this would create a problem.
However, rather than corrupting the data, I think the votes would simply fails since CouchDB uses a revision property to prevent this:
http://wiki.apache.org/couchdb/Document_revisions?action=sho...