CouchDB / NoSQL and Domain Driven Design?
Asked Answered
C

1

7

Doing some research in getting ramped up for a CouchApp project.

I understand the concept of a Document Data Store vs a regular RDBMS. And I can totally grasp modeling documents and views instead of using WHERE and JOIN statements. But I haven't been able to find many resources on how to model documents, views, and design docs with Domain Driven Design (DDD) in mind.

Examples:

  • DDD no-no's in the CouchDB world (eg. GetObjectAFor(id, ... some other int, string, ObjectB, foobar) == BOOM )
  • When DDD starts indicating you should be using SQL instead
  • DDD considerations for CouchDB heavy lifting and potential bottle necks (view modeling, compacting, replication, etc.)
Carniola answered 4/2, 2011 at 21:54 Comment(4)
This post seemed to wet my appetite (Looks like CouchDB design should really reflect what a standard DDD API looks like), but still no details talking about performance considerations before going down this route. Ideas? - erenaykin.net/blog/?p=21Carniola
I don't really understand what you're asking or what your concerns are. E.g. what does "When DDD starts indicating you should be using SQL instead"? I would argue that DDD should never tell you that you should be using SQL- simply because that "SQL" should never be part of your domain (unless you are designing a relational database...).Valenciavalenciennes
Have you had a look at this other post on stackoverflow: #1531245 ? Contains some good pointers, not specific to DDD but to modelling data in CouchDB in general.Valenciavalenciennes
DDD should not dictate which database technology I use. But a data store can significantly impact how my domain design plays out. As in the case of CQRS it's common to deal with objects in 1NF in read situations and 3NF in write situations. But when using a document data store such as CouchDB it is common for a major part of your application (if not all) to be interacted with in 1NF.Carniola
F
3

Take a look at CQRS -- it's a great match for the DDD + NoSQL combination.

See the #cqrs tag here and also have a look at:

http://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf

http://groups.google.com/group/dddcqrs/browse_thread/thread/26d08282c329a598/e7f6986d6445dc73?pli=1

http://blog.jonathanoliver.com/2010/07/cqrs-event-store.html

http://www.youtube.com/results?search_query=cqrs&aq=f

Freeloader answered 22/4, 2011 at 9:12 Comment(1)
Thanks. Back when you wrote your response I was already starting down the path of CQRS hoping that there would be a cross over (where storage was append only). I'm curious if CouchDB was taking a different approach than CQRS trying to elimate 3NF all together. But it seems fairly clear that there's a fair amount of crossover. I'll definitely take from this.Carniola

© 2022 - 2024 — McMap. All rights reserved.