1

I need to do a application that incorporates a database and I'm thinking about using the Firebase Realtime database.

Basically the application is an information app. It has different categories, Shops, Restaurants, Attractions, ect. I've almost completed the Udacity course on firebase and It can do what I need, I'm just not sure it's the most efficient.

They way they explain the database is structured is having a key so my key would either be Shop, Restaurant or Attraction. Below the Shop key there would be "Shop1","Shop2","Shop3", ect. Now this is where my problem comes in, inside shop1 I'm planning to have the shop name, longitude, latitude, description, and other details about the shop. Each time I want to add a new shop I'm going to have to add a child of the shop then under the new child I'm going to have to manually type the key and value.

This will get very time consuming and I was wondering if this is the correct way of adding data to the database ?

Thanks

Demonic218
  • 893
  • 2
  • 15
  • 33
  • So you have two questions here 1. Is Firebase Realtime the best database available? and 2. About Database Management of manually adding products. Am I right? – Kartik Shandilya Oct 12 '17 at 14:42
  • 1
    Correct. I've looked at amazons webservice but never used it. I did read that it is mobile friendly too. My main question is the Database management and the most efficient way to populate the database – Demonic218 Oct 12 '17 at 14:48

2 Answers2

2

Is Firebase the best way to store data for an information app?

This question is primarily opinion based, but since Firebase gives you so many choices under the hood, it is becoming a pretty decent service. Being scalable and the quick response of the database is a great option.

Read more about a good Database Schema here and about populating the database, you can write cloud functions and that would be a pretty advanced level of implementation.

Kartik Shandilya
  • 3,796
  • 5
  • 24
  • 42
1

May be your question is "What is the best way to store data for an information app in Firebase?"

In your case, it will be difficult to save sequential key without keeping track the number of shop.

I would rather suggest using push(shopModel). If you're using push, the key will be automatically generated and it's guaranteed to be unique and order by time inserted.

Faruk
  • 5,438
  • 3
  • 30
  • 46
  • 1
    I will update the question, thank you. The udacity example uses the push function and It was where I was going to go with it. However my thoughts went along the lines of the information app only being able to read data as this is the one which the public would use and having a separate "admin" app that I can have a simple ui with all the required fields and a button to push to the database. I was wonderign though if there might be an easier way ? – Demonic218 Oct 12 '17 at 15:24
  • 1
    Now that can be done. So firstly you have to add some kind of authentication to your app, and then in the database rules you can give yourself explicit Permissions of both reading and writing the data. – Kartik Shandilya Oct 12 '17 at 15:40