In this lecture, we are going to discuss some fire based terminology, buckets, collections and documents
are critical concepts for working with Fire Bases Database.
The authentication service by Firebase will store a user's email and password.
It doesn't store the other information we have in our form.
It would be nice if we could store the user's age, phone number or name.
If we want to store additional information about the user will need to store it in the database.
Firebase has another service called Fire Store.
It's the name of their official database.
The angular fire package we installed has full support for this database before we start writing code.
Let's discuss some of the terminology surrounding Firebase database.
There are three words you're going to hear me throw around.
You may find these terms used frequently in the documentation.
It's important we take the time to understand what they mean.
The first term to become familiar with is called bucket.
We've already talked about buckets when we created the Firebase application.
I want to recap what they are quickly.
A bucket is a physical location where your data is stored.
Firebase allows you to create multiple buckets if you're on a premium plan.
You may want to do this if you want to keep certain data separate.
The app we're developing doesn't need multiple buckets.
We can keep everything contained in a single bucket.
A bucket has been created for our database by installing and configuring the angular fire package.
We are connected to the bucket in Firebase.
We don't need to take further steps for working with buckets in Firebase.
We can move straight into collections.
Collections are containers for your data.
They allow us to organize data into separate locations.
You can think of them as folders from your operating system.
A folder system allows us to organize files.
We wouldn't store audio files with document files or vice versa.
The same idea can apply to data in a database.
We don't want to mingle user data with video data.
A collection can help us categorize data will be able to filter and sort through them.
For example, we can create collections for a user's blog, posts, settings, videos, lyrics, etc.
We must select a collection before performing actions on the database.
Firebase will not allow us to proceed until we do so.
It makes sense, right?
We can't add data until we've selected a location to store them.
The last term is documents.
Documents are the individual records in a collection.
It's the data you store in the database to go along with my folder analogy.
You can think of documents as individual files in a folder.
Multiple documents can be stored in a single collection.
Documents are completely flexible in a collection.
The structure of a document can be different from one another.
Typically, documents in the same collection should have a similar structure to one another.
It's considered good practice to be consistent in the next lecture.
We are going to start creating collections and documents for storing the user's data.