How to build the architecture of a database in a web application?

Want in the form of a test to write mini social. network with node js. The only problem is that almost nowhere to be found about how to build the architecture of the database for mongodb. For relational tables around I would use this: a table user, posts, comments, messages, rooms to communicate with user(s).
And I would connect them like this: in the post I added user_id and linked; for messages I would store the id of the room and another table to link the user_id and room_id. About something like that. But for non-relational models I have a question how to write optimal architecture of the database.
June 14th 19 at 19:10
2 answers
June 14th 19 at 19:12
in General, Yes, it will fit

look in the direction of the updates, to update so that everything will be overwritten or not overwritten by the update or not everything is the main problem with nosql - Juanita17 commented on June 14th 19 at 19:18
As I understand if to keep everything in one is not good, there for her to create a user and all the settings of the user include better + room, friends and so on + posts and comments. And the second is soobsenie where you store user_id and the message(text, application, location, etc.)
The same design will be the norm well? - leda commented on June 14th 19 at 19:15
well I got the understanding of a new technology probably will not need such complexity. If only not to produce and understand how to build models on mongodb - leda commented on June 14th 19 at 19:21
June 14th 19 at 19:14
For nerealizovannyi bases the same. Mongoose, by the way, just for this and created - allows you to create a schema for the schemaless database, tying the collection together almost without effort.
For me the issue was not the creation of the schema, but as their architectural building, then not to alter. That is, first the Foundation of how to lay. About mongus and diagrams are all clear - leda commented on June 14th 19 at 19:17
Yes the answer is the same - build "architectural" in the same way as for the relational database. - Juanita17 commented on June 14th 19 at 19:20

Find more questions by tags MongoDB