Mongo storage space problem

  mongodb, question

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?

  1. Record type format

    {
     “playerId”:1234,
     “username”:“bob”
     “desc”:“play game”
     }
  2. Array format:

{1234,“bob”,“play game”}

Problem extension

  1. 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)?

  2. 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

  1. 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.

  2. The first format is more friendly to queries.

  3. 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.