I have just entered the development of the hand-held tour service terminal, and I am currently following a project in which mongo db is mainly used to store data. In the past two days, I have been struggling with the problem of mongo storage space: using array format to store data or record type format to store data, which storage is more space-saving?
Record type format
｛ “playerId”:1234， “username”:“bob” “desc”:“play game” ｝
Will the check-out and check-in in array format be out of order? Such as warehousing
｛1，2，3｝, read out will become
｛2，3，1｝The current tests do not seem to be out of order. I would like to know some basic principles of mongo, what are the good recommendations (websites, books, q&a)?
Which format do you prefer to use to store data? Why?
Maybe the question is not very good, please forgive me.
In favor of the first
Don’t care so much about the storage space. At present, the data of 5KW in the project is about 10 key per piece, and the total storage space of index and data is not very large, probably not more than 100G.
The first format is more friendly to queries.
Mongo itself is a document database, and the data will be stored in bson structure (similar to json).
Arrays out of order. this won’t.