How to best structure Firebasedata

Asked by At

I'm making an app for the office for organizing our many storagerooms, and all their content.
Here's the json, and I will try to explain the idea below:

{
  "objects" : {
    "2402542239543" : {
      "objectAmount" : "1",
      "objectName" : "Copy paper",
      "objectUnit" : "Pack"
    },
    "7047160337563" : {
      "objectAmount" : "1",
      "objectName" : "Toner",
      "objectUnit" : "Pcs"
    }
  },
  "users" : {
    "fROjFkxrj8UTmBiUxjF6Pdc5xYY2" : {
      "Address" : "Road 1",
      "Email" : "[email protected]",
      "Name" : "Peter Parker",
      "Phone" : "123456789",
      "userDatabases" : {
        "Office 1" : {
          "Dry Storrage" {
           "2402542239543" : {
            "objectAmount" : 8,
            "objectName" : "Copy paper",
            "objectUnit" : "Pack"
          },
          "7047160337563" : {
            "objectAmount" : 11,
            "objectName" : "Toner",
            "objectUnit" : "Pcs"
          }    
         }
        },
        "locations" : {
          "LehNFuBz1siW4YHv12d" : "Office 1",
          "LehNFuBz1siW4YHvds1" : "Office 2",
          "LehNFuBz1siW4YHvme3" : "Office 3"
        },
        "typeLocations" : {
          "LehNFuBz1siW4YHmIn7t" : "Storageroom 2 in basement",
          "LehNFuBz1siW4YHlgd9" : "Dry Storrage",
          "LehNFuBz1siW4YHvlnP" : "Cooler",
          "LehNFuBz1siW4YgUilM" : "Storageroom 1 in basement"
        }
      }
    }
  }
}

So, the "object" node is a database of all the goods. The 13 digit number is the part number of a particular commodity, and hereunder the name, the amount it comes in when bought, and in what unit it comes in.
All the goods is manually entered in the database.

We are a big company, with many offices, and different storagerooms, so the app will have many users who is responsible for their own storage(s).

The idea is that every user can generate their own locations and storagerooms in the database. In this way the users can pick a location and a storeroom for that location and then add or remove goods from it.

In the example below the user has generated/added 3 locations and 4 storagerooms, and he has stored 2 items in "Office 1"/"Dry Storage".

Hope I have managed to explain what I'm after somewhat understandable..

While this setup works, I am worried that the data I to nested and when finished consume much data traffic for the users?
We have thousands of goods, and with time just expand. And if this is a success, we will have upwards to 1000 users with their own storages that can contain thousands of goods

0 Answers