Reputation: 1705
Is there any NoSQL database or "ready to use solution" which combines duplicating data by application needs for fast reading and relations of data for data integrity with auto distribution of changes to duplicated data?
Example:
Entities:
Topic
- id
- title
- first_comment_id
Comment
- id
- topic_id
- text
Documents / Materialized Views:
TopicList
- topic_id
- topic_title
- first_comment_text
When I change topic title, change will be distributed to every documents containing this property at database layer. So integrity would be managed by database.
I really like MongoDB with its schema-less behavior, so Oracle or other relational databases is not solution.
Upvotes: 3
Views: 681
Reputation: 7275
I have some experience with Mongo and joining entities/documents, so I'll contribute an answer towards that. You can create a map/reduce query in Mongo that outputs to a collection. The behavior is really nice and avoids issues with reading from the newly created collection before it's "ready" (before map/reduce finishes running etc.)
To keep that collection updated I've used an external process to issue the map/reduce function on a schedule. It allows you to be a bit more arbitrary with your queries.
I suppose this would also manage consistency as each entity would be authoritative and when the temporary collection was generated again, you would see the changes. The caveat of course is that it wouldn't be real time.
Upvotes: 1