Designing a Registration System Using CouchDB

I am considering the design of a CouchDB based event logging system.

What would be a good way to store each event?

  • one document with events as "attachments"
  • one document per event
  • one document for event type, event as attachment

Other?

+4
source share
2 answers

I would set one document for the event. If this is an event registration system, an event is the main entity, right? Therefore, IMHO this should be a document, and not just an attachment. This solution gives you the flexibility to search / filter events.

+4
source

I would definitely go for one document per event. In addition to amorfis answers, using attachments can lead to a conflict over the document during updates if you do not serialize the updates very carefully. Just throw events in couchdb as documents as they are, and use the views to slice and cubed events for analysis.

+2
source

All Articles