Integrating Firebase Realtime Database
It's time to integrate Firebase in our application. Though we have already seen the detailed description and features of Firebase Realtime Database in Chapter 2, Connecting React to Redux and Firebase, we will see key concepts for JSON data architecture and best practices for the same. Firebase database stores data as a JSON tree.
Take into consideration this example:
{ "seats" : { "seat-1" : { "number" : 1, "price" : 400, "rowNo" : 1, "status" : "booked" }, "seat-2" : { "number" : 2, "price" : 400, "rowNo" : 1, "status" : "booked" }, "seat-3" : { "number" : 3, "price" : 400, "rowNo" : 1, "status" : "booked" }, "seat-4" : { "number" : 4, "price" : 400, "rowNo" : 1, "status" : "available" }, ... } }
The database uses a JSON tree, but data stored in the database can be represented as certain native types to help you write...