NoSQL and Normalized Data

I am thinking about starting my first CouchDB project and, based on the background of ORM, I am concerned about how to create my documents, which can be difficult to maintain.

For example, if I have the following model:

A * ---> (1) B

which means that for every object A there is an object B, and there are many instances of A that can share the object B. In this case, there are pointers / foreign key in AB.

I could create a document containing all data A and B. However, the problem is that if at a later stage (after creating 10000 documents) I may need to change some data, which means that I need to update all my documents .

In the world of ORM / normalized database, I would just update B, and all my links now refer to the database.

How do I handle this in CouchDB or is it a NoSQL approach not suitable for these situations?

Jd

+5
source share
1 answer

A general answer to this question: there is no general answer to this question.

The fact is that in NoSQL, the data structure is not dictated by the data, but rather by the queries that the data structure should support. Thus, instead of using the same template for each instance of a 1: N or M: N association problem, the NoSQL way is to use different templates depending on your specific needs. It can be, for example:

  • Read / write ratio
  • Database specific features that simplify or simplify embedding
  • Types of Requests to Support
  • , , , , - .

, , "", MongoDB. - , " ", 1: n. :)

+5

All Articles