0

I'm planning to build my own app. It's a home service App to link users with other providers.
I'm recently used a NoSQL database, Firebase, and I am stuck with the design of the database for my app. The question is how to structure the databases in this way with NoSQL, like a JSON tree?

Like

{
"uID":"01",
"username":"John",
"Booking":[{
       "Bid":"01",
       "BDetails":"Cleaner Rooms",
       "Baddress":"America",
        "providerID":"023",
        "timestamp":"1-Mar-2019"
       ....
       ....
      }]
}

Is that right?

closed as too broad by mustaccio, John Eisbrener, hot2use, LowlyDBA, Colin 't Hart Mar 5 at 20:12

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

0

your database should look something like this object:

{
  users : { uid, ... },
  bookings: { id, uid, ... },
}

And you access each user's bookings by querying with a condition that the column uid matches the user's id, by using firebase.auth().currentUser if you're using firebase. btw you should Cloud Firestore for better scalability and faster queries.

  • Great, actually, I'm use real-time DB, is that good? – DevAS Mar 1 at 16:37
  • Yes but I prefer firebase just because it takes care of everything in the background, no need to worry about servers and what not, it's also got some pretty handy features, especially when it comes to saving images, you should take a look. – mohshbool Mar 1 at 22:13
  • you mean firestore right? – DevAS Mar 2 at 13:35
  • Yes, firebase offers services such as cloud firestore, file storage, analytics and much more! its very useful – mohshbool Mar 3 at 19:04
  • Yes, I will use them if you have time can you chat with me on FB I have some stuck about the structure the DB, – DevAS Mar 3 at 19:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.