1
00:00:00,090 --> 00:00:06,540
In this lecture, we are going to discuss some fire based terminology, buckets, collections and documents

2
00:00:06,540 --> 00:00:09,900
are critical concepts for working with Fire Bases Database.

3
00:00:10,290 --> 00:00:14,820
The authentication service by Firebase will store a user's email and password.

4
00:00:15,360 --> 00:00:18,300
It doesn't store the other information we have in our form.

5
00:00:18,900 --> 00:00:23,010
It would be nice if we could store the user's age, phone number or name.

6
00:00:23,400 --> 00:00:28,740
If we want to store additional information about the user will need to store it in the database.

7
00:00:29,160 --> 00:00:32,009
Firebase has another service called Fire Store.

8
00:00:32,340 --> 00:00:34,530
It's the name of their official database.

9
00:00:34,860 --> 00:00:41,460
The angular fire package we installed has full support for this database before we start writing code.

10
00:00:41,670 --> 00:00:45,750
Let's discuss some of the terminology surrounding Firebase database.

11
00:00:46,080 --> 00:00:48,870
There are three words you're going to hear me throw around.

12
00:00:49,140 --> 00:00:52,770
You may find these terms used frequently in the documentation.

13
00:00:53,130 --> 00:00:56,310
It's important we take the time to understand what they mean.

14
00:00:56,910 --> 00:01:00,120
The first term to become familiar with is called bucket.

15
00:01:00,450 --> 00:01:04,440
We've already talked about buckets when we created the Firebase application.

16
00:01:04,800 --> 00:01:06,960
I want to recap what they are quickly.

17
00:01:07,320 --> 00:01:10,740
A bucket is a physical location where your data is stored.

18
00:01:11,130 --> 00:01:15,390
Firebase allows you to create multiple buckets if you're on a premium plan.

19
00:01:15,750 --> 00:01:19,230
You may want to do this if you want to keep certain data separate.

20
00:01:19,560 --> 00:01:22,530
The app we're developing doesn't need multiple buckets.

21
00:01:23,130 --> 00:01:26,040
We can keep everything contained in a single bucket.

22
00:01:26,610 --> 00:01:32,940
A bucket has been created for our database by installing and configuring the angular fire package.

23
00:01:33,120 --> 00:01:35,760
We are connected to the bucket in Firebase.

24
00:01:36,060 --> 00:01:40,110
We don't need to take further steps for working with buckets in Firebase.

25
00:01:40,530 --> 00:01:42,840
We can move straight into collections.

26
00:01:43,320 --> 00:01:45,600
Collections are containers for your data.

27
00:01:45,870 --> 00:01:49,140
They allow us to organize data into separate locations.

28
00:01:49,410 --> 00:01:52,470
You can think of them as folders from your operating system.

29
00:01:52,980 --> 00:01:56,050
A folder system allows us to organize files.

30
00:01:56,280 --> 00:02:00,270
We wouldn't store audio files with document files or vice versa.

31
00:02:00,600 --> 00:02:03,510
The same idea can apply to data in a database.

32
00:02:03,750 --> 00:02:07,020
We don't want to mingle user data with video data.

33
00:02:07,590 --> 00:02:13,110
A collection can help us categorize data will be able to filter and sort through them.

34
00:02:13,410 --> 00:02:21,030
For example, we can create collections for a user's blog, posts, settings, videos, lyrics, etc.

35
00:02:21,390 --> 00:02:25,980
We must select a collection before performing actions on the database.

36
00:02:26,280 --> 00:02:29,670
Firebase will not allow us to proceed until we do so.

37
00:02:29,910 --> 00:02:31,140
It makes sense, right?

38
00:02:31,440 --> 00:02:35,430
We can't add data until we've selected a location to store them.

39
00:02:36,000 --> 00:02:38,040
The last term is documents.

40
00:02:38,310 --> 00:02:41,490
Documents are the individual records in a collection.

41
00:02:41,790 --> 00:02:47,010
It's the data you store in the database to go along with my folder analogy.

42
00:02:47,190 --> 00:02:50,880
You can think of documents as individual files in a folder.

43
00:02:51,270 --> 00:02:54,510
Multiple documents can be stored in a single collection.

44
00:02:55,170 --> 00:02:58,020
Documents are completely flexible in a collection.

45
00:02:58,320 --> 00:03:01,530
The structure of a document can be different from one another.

46
00:03:01,830 --> 00:03:07,200
Typically, documents in the same collection should have a similar structure to one another.

47
00:03:07,530 --> 00:03:11,970
It's considered good practice to be consistent in the next lecture.

48
00:03:12,000 --> 00:03:17,010
We are going to start creating collections and documents for storing the user's data.

