I am starting to look into NoSQL databases.
I think I got the main concept which is to store the data as “maps” i.e. as key-value pairs which the NoSQL distinguishes via a unique id.
At this point I am confused (in relation to when designing the database).
Does this (that the data are stored as “maps”) imply that the data we store in a Collection of a NoSQL must be “homogenous”?
Same as a Map in Java for instance where the keys are all of the same type and the values are all of the same type?
Also is the concept of referential integrity supported in NoSQL databases? Or Since they are stored as maps, I will have to
write code to manually update any related collection?
If we’re talking about MongoDB:
There is no referential integrity enforcement on the DB side. You have to do it in the application code. Triggers and cascade update/delete are also on you.
Documents can be complex tree-like structures, where keys are strings and values can be of different types.
Documents are not required to be homogenous. The same collection can contain documents of any structure and field set.