- Overview
- Transcript
2.1 Firebase Data
In this lesson, you’ll learn what Firebase data is and how to structure app data.
Related Links
1.Introduction2 lessons, 02:21
1.1Introduction00:34
1.2What Is Firebase?01:47
2.Firebase in Vanilla JavaScript6 lessons, 46:10
2.1Firebase Data02:05
2.2Save Data14:46
2.3Retrieve and Display Data08:17
2.4Update and Delete Data08:22
2.5Firebase Authentication08:58
2.6Firebase Hosting03:42
3.Firebase and AngularJS6 lessons, 29:17
3.1Set Up the Foundation for Apps Project04:33
3.2Controller and `myAuth` Service04:14
3.3Register User Page and `userService`07:35
3.4Login Page and Controller05:20
3.5Home Page05:56
3.6Deploy the App01:39
4.Conclusion1 lesson, 00:47
4.1Conclusion00:47
2.1 Firebase Data
Hello, everyone. This is Reggie Dawson. Welcome to the use firebase as your back in course for Tuts+. In this video, we're going to talk about firebase data. Firebase is desirable as a back end because it frees us from setting up a server to support our apps. In keeping with that, firebase use a no sequel database to store your data. In order to write to our database, we just have to create a reference to our Firebase app. Our Firebase data stored as a JSON object. When we add data it becomes a key in the existing JSON data. In our app, we're going to create a child node called products where we'll save our product listings. Therefore in order to access the products we would have to use this path. We will talk more about children nodes and how to save to them in the next video. We will also look at the data in the dashboard to better understand the structure of the Firebase data. Another thing to understand is that Firebase does not have support for a raise. Although we can send data to Firebase as an array the JavaScript Client will save it as an object. So if we send in array such as this, Firebase will actually save an object. Fortunately Firebase includes methods that will return our data as array, but it is important to understand this especially if you are getting the data back that you expects. Lastly it is suggested that use a flattened data structure. What this means is that data is arranged in such a way that we don't have to download all of our data to get information. For example we are building a catalog of products that will allow authorized users to add, update and delete products. If the user is just going to our site to buy a product they do not need to download any user information. As a result well create separate child nodes name users were authorized user logons could be stored with the at we build this will be the cases who use firebase authentication. But if we were creating something like a social media app with a lot of information shared across users we would definitely need to flatten our data in order for our app to run efficiently. We will better understand the data structure as we build our app. In the next video, we will get started by setting up our app and saving data to Firebase.