FireBase database

-1

I read an article about Firebase, I find it wonderful what in theory it can do. I would like your help because I want to create a CRUD, but I have always used Mysql. For the little that I understand uses JSON (NO-sql).

How can I manually create this in NO-sql in the JSON file? I wanted to mount a table like this in CRUD, for example:

ID Nome_Produto   Unidades
0  carro             1   
1  carro2            3  
2  carro3            5    

If you can guide me some reading material to understand more about Firebase (database) would be great, thank you right away !!!

    
asked by anonymous 16.10.2017 / 19:19

1 answer

1
Hello, first of all, you should forget the logic of working in SQL databases and begin to interpret the instances of the classes in which you work directly, this is the logic of nonrelational document type databases (eg Firebase, MongoDB, MariaDB, etc ...).

When working with this type of database, objects are instantiated directly, depending on their elements. In the case of firebase (which is your choice) it does not allow you to work directly with arrays inside objects, instead it allows you to set the keys for a parent object in an orderly fashion. The result would be something like this:

{
  "carros": {
    1: { "nome": "carro", "unidades": 1 },
    2: { "nome": "carro2", "unidades": 3 },
    3: { "nome": "carro3", "unidades": 5 },
  }
}

With this structure, you no longer need to keep the table "id" inside the object because it is only a relational index and is no longer a logical reference. In case you need to use it, the firebase allows you to tell it to send the $key key to your object, which will be identified directly as if it were your "id".

I advise you to start studying Non-SQL because from now on it is the future in relation to the data storage in question at cost / benefit. Even well-used and robust databases like Oracle and MS SQLServer are not comparable to non-SQL databases when you have massive data processing and a large mass of concurrent connections.

    
31.10.2017 / 16:13