Data Structure of Firebase
- Dominic Ng
- Oct 28, 2018
- 2 min read
Updated: Feb 6, 2019
This is the first blog post as the Application Developer of Gastronome. After coming out with ideas and features for the application for Gastronome, my team and I had to design the data structure of the database. As Gastronome requires authentication, database and it can communicate with mobile application, web application as well as the python program. We decided to utilize Firebase as our back-end database to store the Recipes, User Details, Favourites as well as Logs.
As this was my first time working on such a huge application that stores a lot of data and functions had to call data from different child, it was rather confusing and difficult to retrieve data that I want and display in the application at first. However, after trying many various structures to store our data neatly and efficiently, we designed our data structure to be stored can be displayed in the screenshot below.
The thinking process when designing the data structure was what do we need in each node and how are we going to store them. Firstly, for the user’s node, as Gastronome requires user details such as weight, height, age, etc to estimate their weight after following the weekly meal plan, we had to store it into the database. In addition, although we had used Firebase Authentication for the authentication of the application, Firebase Auth could not store additional information of each specific users and hence we stored them in the database.
After designing the data structure of the Android application, I took on the role to work on the Home Page, where I had to work on pulling the data of every recipes in the database and displaying it in the Home Page of the application. I will be documenting my progress on the displaying of recipes in my next blog!

Comments