Newbie to NoSQL, Schema design?

Hi all :wave: ,

I would like to ask a few questions about schema design because I’m currently using Atlas + Realm to play around and learn.

The one thing that is confusing to me is why and when we need to split data up in collections because theoretically, my whole application could be one giant schema which is 1 collection.

I will use Trello as an example to explain what I mean. Hope you all know what Trello is and how it works, basically, users can create boards and every board is an own project management platform so to say where you can add stuff like todos, here how I would build the Schema for the whole Trello clone in 1 collection.

Collection Name is Boards.

   {
  "title": "board",
  "properties": {
    "_id": {
      "bsonType": "objectId"
    },
    "lanes": {
      "bsonType": "array",
      "items": {
        "bsonType": "object",
        "properties": {
          "cards": {
            "bsonType": "array",
            "items": {
              "bsonType": "object",
              "properties": {
                "description": {
                  "bsonType": "string"
                },
                "id": {
                  "bsonType": "objectId"
                },
                "label": {
                  "bsonType": "string"
                },
                "title": {
                  "bsonType": "string"
                }
              }
            }
          },
          "id": {
            "bsonType": "objectId"
          },
          "label": {
            "bsonType": "string"
          },
          "title": {
            "bsonType": "string"
          }
        }
      }
    }
  }
}

This is how you could build a whole application with 1Schema but I assume it is not the right way to do it, so why and when and how do I know when to split it up in a new collection?

Thanks

An entity’s data can be stored in one or more collections. The data stored can have relationships, like the one-to-one and one-to-many between entity’s attributes. In MongoDB’s flexible document based model, these relationships can be in terms of data embedding within the same document or referencing in another collection.

This design depends upon the application’s needs. For example, the nature of data (like size and relationships), and the data’s usage (the application’s functionality, the kind of queries and updates).

Some related info can be found at: