6 videos 📅 2025-01-27 09:00:00 Africa/Blantyre
28:16
2025-01-27 13:22:37
2:15:00
2025-01-27 15:12:42
2:08:39
2025-01-27 15:41:27
2:16:52
2025-01-27 20:41:38
3:55:27
2025-01-27 20:41:42
4:47:11
2025-01-28 08:47:09

Visit the Mongo DB for Administrators course recordings page

                WEBVTT

00:00:00.820 --> 00:00:02.980
How's Akona doing there?

00:00:04.720 --> 00:00:06.860
I can see he's doing well.

00:00:07.700 --> 00:00:09.180
He's pasting something.

00:00:10.280 --> 00:00:12.520
Yeah, he's now looking at some collections.

00:00:14.100 --> 00:00:15.620
He's creating a collection.

00:00:15.740 --> 00:00:18.020
Why don't you tell him it's none of his business, please?

00:00:27.900 --> 00:00:31.940
How do I quit this IOS test?

00:00:33.700 --> 00:00:36.120
Did you try Control C?

00:00:38.040 --> 00:00:39.200
You see, I knew.

00:00:39.980 --> 00:00:40.760
You knew?

00:00:41.800 --> 00:00:43.940
Yeah, I was testing you.

00:00:44.780 --> 00:00:46.720
There's one you said we mustn't do.

00:00:46.840 --> 00:00:47.360
Which one was it?

00:00:48.840 --> 00:00:49.320
Seven?

00:00:53.200 --> 00:00:54.480
Or is it just a backup?

00:00:54.740 --> 00:00:57.000
Yeah, the backups, you don't need to do it.

00:00:57.400 --> 00:01:04.580
Wait, you mean there is the one that says creation of an SSL certificate on security and monitoring.

00:01:05.280 --> 00:01:06.600
You can leave that one.

00:01:07.660 --> 00:01:08.320
Okay.

00:01:13.400 --> 00:01:14.060
Okay.

00:01:17.240 --> 00:01:18.860
All right, cool.

00:01:19.240 --> 00:01:23.240
And then there's also the part of advanced monitoring.

00:01:23.700 --> 00:01:28.460
So it needs you to do a whole process of Prometheus and Grafana.

00:01:28.620 --> 00:01:30.300
I think that's number six and seven.

00:01:31.800 --> 00:01:33.320
Yes, that's where I was.

00:01:33.320 --> 00:01:40.000
Yeah, so you can leave that on because you need to have a new installation of Prometheus, Grafana and all that stuff.

00:01:40.220 --> 00:01:45.420
You can always do it at your own time because you still have access to these machines even after the course.

00:01:45.900 --> 00:01:47.180
Budget will be finished.

00:01:48.020 --> 00:01:48.500
Budget?

00:01:50.280 --> 00:01:51.020
Not even.

00:01:51.020 --> 00:01:55.000
So you can be able to come understand the loans, right?

00:01:55.080 --> 00:01:56.900
So it won't be part of the course anymore.

00:01:56.900 --> 00:01:57.620
Yeah.

00:02:43.780 --> 00:02:45.180
Okay.

00:03:03.120 --> 00:03:06.820
So are we doing six and seven or?

00:03:07.680 --> 00:03:09.360
Wait, hold on, hold on.

00:03:10.240 --> 00:03:13.380
We are going to continue just now.

00:03:14.200 --> 00:03:15.960
I'm going to do a theory just now.

00:03:16.600 --> 00:03:24.620
Everybody should just confirm that they are done with the security one and then we can continue.

00:03:25.780 --> 00:03:28.280
Okay, I will let us know.

00:03:32.400 --> 00:03:34.820
I think I'm good.

00:03:35.480 --> 00:03:44.460
Except when we think skipping the certain topics, do we skip the?

00:03:45.860 --> 00:03:46.680
What's this?

00:03:47.020 --> 00:03:50.740
The first one before the firewalls, before the certificate.

00:03:51.640 --> 00:03:53.240
The network one.

00:03:55.180 --> 00:03:59.360
You won't see the difference because you need to connect.

00:04:00.240 --> 00:04:01.620
What do you call this?

00:04:02.400 --> 00:04:02.920
Remotely.

00:04:03.200 --> 00:04:07.140
Yes, internally you can be able to do it, but you won't see the effect.

00:04:07.660 --> 00:04:08.460
If that makes sense.

00:04:08.540 --> 00:04:10.940
It's already connected to local host anyway.

00:04:11.860 --> 00:04:12.160
Yeah.

00:04:12.160 --> 00:04:13.560
So you won't see the effect.

00:04:13.620 --> 00:04:15.120
It needs you to be remote.

00:04:15.980 --> 00:04:16.500
Yeah.

00:04:19.280 --> 00:04:20.940
And then I'm good.

00:04:21.600 --> 00:04:22.360
Okay.

00:04:25.480 --> 00:04:26.140
Who else?

00:04:26.420 --> 00:04:27.300
Are you good?

00:04:29.620 --> 00:04:30.420
Yes.

00:04:31.140 --> 00:04:33.300
We need the lady of the house.

00:04:35.240 --> 00:04:35.880
All right, cool.

00:04:37.220 --> 00:04:41.560
So let's talk about some indexing.

00:04:44.600 --> 00:04:45.520
Web console.

00:04:46.520 --> 00:04:48.020
I said you can skip that one.

00:04:48.140 --> 00:04:49.820
You can do it at your own time.

00:04:50.260 --> 00:05:02.940
I'm going to add a bit of more information on that one because I've realized that it might need you to do a bit of work, but I'll add some stuff onto it in terms of how to do it.

00:05:03.760 --> 00:05:03.840
Right.

00:05:04.960 --> 00:05:12.940
But anyway, the web console, if you're going to be using the enterprise version of MongoDB, you get the ops manager.

00:05:14.220 --> 00:05:17.900
But there's also open source ones that you can be able to use.

00:05:17.900 --> 00:05:20.200
Key features of it, real time monitoring.

00:05:20.420 --> 00:05:23.900
You can view your metrics, your operations, your memory usage and network activity.

00:05:24.920 --> 00:05:26.000
You can set up alerts.

00:05:26.440 --> 00:05:27.840
You can perform analysis.

00:05:28.020 --> 00:05:35.260
You can analyze performance, you know, identify slow quiz, and then you can do backup and restores from the web interface.

00:05:35.520 --> 00:05:35.820
Right.

00:05:35.980 --> 00:05:39.300
That's just the advantage of the web console.

00:05:40.000 --> 00:05:42.040
Now let's talk about indexing.

00:05:42.040 --> 00:05:49.600
Indexing is where you structure your data in such a way that there is improved speed of data retrieval.

00:05:49.880 --> 00:05:55.540
So in essence, you're taking a bit of data and moving it closer for easier accessibility.

00:05:57.180 --> 00:06:02.260
You use that to be able to quickly locate documents without scanning the entire collection.

00:06:02.840 --> 00:06:09.320
So in essence, instead of you having to go through 2,000 students.

00:06:09.480 --> 00:06:09.940
Right.

00:06:09.940 --> 00:06:20.760
If you create an index, let's say for a name, right, then it won't need to go through the whole collection of students.

00:06:20.900 --> 00:06:23.080
It will just go look for the specifics in the name.

00:06:23.320 --> 00:06:24.640
That's how indexes work.

00:06:25.460 --> 00:06:32.940
And they use what you call bit trees, sort of a type of balance tree to store indexes.

00:06:33.620 --> 00:06:33.780
Right.

00:06:33.780 --> 00:06:40.140
So there is the database and then there's indexes going down.

00:06:40.700 --> 00:06:44.140
And then each index entry contains a value from the index fields.

00:06:44.820 --> 00:06:47.580
Which is used as a pointer to the corresponding document.

00:06:47.960 --> 00:06:56.380
So, for example, if you are going to use indexes of first name, which means in every document, the first name is going to be used as that.

00:06:56.440 --> 00:07:01.440
So when you want to try and search for something using the first name, it's going to be quick to retrieve.

00:07:02.020 --> 00:07:02.220
Right.

00:07:02.220 --> 00:07:08.540
And then when a query is executed, MongoDB uses that index to quickly locate the relevant documents.

00:07:08.940 --> 00:07:22.260
So in essence, what it will do is instead of going through the whole document, it goes looks for first name called Kumbulani and then bring back whatever it needs to bring back from that Kumbulani.

00:07:22.620 --> 00:07:30.360
Right. Instead of it having to go through the whole collection of documents looking for a Kumbulani, it goes first name, first name is index.

00:07:30.360 --> 00:07:34.120
All I need to look for is Kumbulani, Kumbulani here, digital type of setup.

00:07:34.680 --> 00:07:37.520
Right. There's different types of indexes.

00:07:38.200 --> 00:07:40.520
First on being an index single field.

00:07:40.660 --> 00:07:41.940
Right. In a collection.

00:07:42.160 --> 00:07:45.580
So, for example, you create name as an index.

00:07:45.740 --> 00:07:46.160
Right.

00:07:46.720 --> 00:07:49.040
That's a single index, single field index.

00:07:49.100 --> 00:07:49.500
Right.

00:07:49.640 --> 00:07:53.680
And then you've got a compound where you can have multiple fields as indexes.

00:07:53.780 --> 00:07:58.360
So, for example, there in DB students, you've got name and then age.

00:07:58.360 --> 00:08:05.080
So in essence, if you want to retrieve something quickly, if you have name and age on it, it will be very, very quick.

00:08:06.340 --> 00:08:08.900
I'm sure in banks they use the ID number.

00:08:09.400 --> 00:08:09.760
Right.

00:08:10.360 --> 00:08:13.960
To retrieve information about you at any point.

00:08:14.180 --> 00:08:18.540
So they would index the ID number because that's something that is so different.

00:08:18.780 --> 00:08:27.700
That's that you if you index that, then it will quickly retrieve anything that's specific to that to that ID.

00:08:27.700 --> 00:08:30.480
You can also have multi key indexes.

00:08:30.840 --> 00:08:30.880
Right.

00:08:30.920 --> 00:08:31.960
Or nested documents.

00:08:32.160 --> 00:08:33.700
Let's say, for example, subjects.

00:08:34.180 --> 00:08:34.700
Right.

00:08:35.840 --> 00:08:39.280
Where you have a nested document or an array.

00:08:39.920 --> 00:08:40.260
Right.

00:08:40.460 --> 00:08:43.900
Because subjects has got many other subjects under it.

00:08:44.300 --> 00:08:44.620
Right.

00:08:44.840 --> 00:08:46.600
That you can actually add.

00:08:46.600 --> 00:08:50.460
You can actually index that array or that nested document.

00:08:50.540 --> 00:08:50.960
Right.

00:08:50.960 --> 00:09:00.520
And then you can also do text index where you can it supports text search queries or string content.

00:09:00.780 --> 00:09:00.860
Right.

00:09:00.960 --> 00:09:06.240
So in essence, you can then index name as a text.

00:09:06.440 --> 00:09:06.800
Right.

00:09:07.060 --> 00:09:12.640
So it becomes easy to be able to search first name using your text.

00:09:14.380 --> 00:09:17.260
The text type of data.

00:09:17.340 --> 00:09:17.760
Right.

00:09:17.760 --> 00:09:23.160
And then you've got your just part, which is obviously this one is used by your buzz and your bolts.

00:09:23.240 --> 00:09:23.640
Right.

00:09:24.020 --> 00:09:25.740
They index locations.

00:09:25.960 --> 00:09:26.460
Right.

00:09:26.900 --> 00:09:30.940
So location is the main thing that's used by Uber and both.

00:09:31.160 --> 00:09:32.460
So they index that.

00:09:32.560 --> 00:09:40.080
And then you've got hashed index where you can hash or you can use the hash of a field.

00:09:40.220 --> 00:09:40.660
Right.

00:09:41.000 --> 00:09:42.880
Probably the email or something.

00:09:42.940 --> 00:09:45.000
You know, it's also good for shutting.

00:09:45.000 --> 00:09:51.380
And then you've got TTL index where you automatically move documents after a specified time.

00:09:51.640 --> 00:09:55.560
So in essence, after a month.

00:09:56.000 --> 00:09:56.460
Right.

00:09:56.620 --> 00:10:00.620
You can be able to actually remove those documents if you want to.

00:10:00.720 --> 00:10:00.880
Right.

00:10:00.940 --> 00:10:02.620
So you can index them that way.

00:10:03.360 --> 00:10:03.880
Right.

00:10:04.280 --> 00:10:05.420
And then managing index.

00:10:05.520 --> 00:10:06.980
What do you do in managing index?

00:10:07.100 --> 00:10:08.000
You can create indexes.

00:10:08.600 --> 00:10:08.900
Right.

00:10:09.100 --> 00:10:11.420
Which could be a single field index.

00:10:11.840 --> 00:10:13.220
You use the create index.

00:10:13.220 --> 00:10:14.220
You can list indexes.

00:10:15.320 --> 00:10:18.940
To see within your collection, what is it that's indexed?

00:10:18.940 --> 00:10:20.220
And then you can drop indexes.

00:10:21.340 --> 00:10:22.360
You no more want that index.

00:10:22.420 --> 00:10:23.540
Then you can drop it.

00:10:23.600 --> 00:10:27.600
Or you can rebuild indexes where you do the DB students re-index.

00:10:27.680 --> 00:10:32.180
So in essence, it will rebuild all the indexes in the collection.

00:10:33.340 --> 00:10:33.780
Right.

00:10:34.280 --> 00:10:41.340
So some information about or some talking about the indexing internals.

00:10:41.460 --> 00:10:41.720
Right.

00:10:41.720 --> 00:10:42.980
You're B structure.

00:10:43.100 --> 00:10:47.740
So as you said, it uses B structure, B tree structure to store your indexes.

00:10:48.040 --> 00:10:50.820
In essence, it's got something like a tree.

00:10:51.060 --> 00:10:53.600
And when you're speaking about Linux, right.

00:10:53.840 --> 00:10:59.360
The tree is where you've got the mother and then the child, the children as they follow below.

00:11:01.020 --> 00:11:07.200
And usually it's balanced trees that allow efficient insertion, deletion and search operations.

00:11:07.200 --> 00:11:14.100
So your database will be on the one or your collection will be on being the highest and then your documents being under there.

00:11:14.580 --> 00:11:14.760
Right.

00:11:14.940 --> 00:11:19.600
And each node in the B2 contains multiple keys and pointers to child nodes.

00:11:20.240 --> 00:11:20.660
Right.

00:11:21.380 --> 00:11:26.480
And then index storage indexes are stored in separate data files within the DB path.

00:11:26.500 --> 00:11:35.320
So they create smaller file indexes, create smaller files where each index will contain the indexed field value.

00:11:35.320 --> 00:11:38.300
And then a pointer to the corresponding document.

00:11:39.060 --> 00:11:39.260
Right.

00:11:39.500 --> 00:11:42.500
You've created an index of ID number.

00:11:42.800 --> 00:11:43.240
Right.

00:11:43.500 --> 00:11:44.840
It will index that field.

00:11:45.240 --> 00:11:45.580
Right.

00:11:45.740 --> 00:11:49.960
Of the ID number and a pointer to the correct document.

00:11:51.440 --> 00:11:51.640
Right.

00:11:52.040 --> 00:11:53.320
And then you've got index selectivity.

00:11:54.220 --> 00:11:54.460
Right.

00:11:54.560 --> 00:11:58.740
Where it refers to how unique the values in an indexed field are.

00:11:59.240 --> 00:12:01.580
So you've got what you call high selectivity.

00:12:01.900 --> 00:12:02.180
Right.

00:12:02.180 --> 00:12:04.620
Where there's better performance that way.

00:12:04.620 --> 00:12:10.860
Then there's low selectivity, which may reduce the effectiveness sometimes of the index.

00:12:11.120 --> 00:12:13.580
But you'll have many duplicate values.

00:12:14.400 --> 00:12:14.640
Right.

00:12:15.260 --> 00:12:18.300
Where high selectivity is involved, it's a unique value.

00:12:18.500 --> 00:12:22.320
So there is never the same, which makes it, which makes life easier.

00:12:22.700 --> 00:12:28.540
And then you've got cardinality where it refers to the number of unique values in an indexed field.

00:12:28.700 --> 00:12:29.060
Right.

00:12:29.060 --> 00:12:32.200
Where you've got high cardinality field.

00:12:33.040 --> 00:12:33.080
Right.

00:12:33.340 --> 00:12:34.180
E.G.

00:12:34.500 --> 00:12:34.860
Email.

00:12:37.020 --> 00:12:37.320
Right.

00:12:37.420 --> 00:12:39.600
There's so many unique values in that field.

00:12:39.880 --> 00:12:40.780
It's very, very good.

00:12:41.120 --> 00:12:46.700
But where you've got low cardinality gender, gender is either male or female.

00:12:47.000 --> 00:12:47.300
Right.

00:12:47.300 --> 00:12:47.940
And that's it.

00:12:48.220 --> 00:12:53.520
You probably won't get that much benefit out of indexing because it's either

00:12:53.520 --> 00:12:54.240
male or female.

00:12:54.460 --> 00:12:58.960
And if you had to pull anything that's male related, you can get half the database

00:12:58.960 --> 00:13:01.420
or 80 percent of the database, you know.

00:13:01.660 --> 00:13:07.200
But if it's email and it's looking for kumbulani T at Gmail dot com, that's the only one that is going to look for.

00:13:07.360 --> 00:13:07.820
Right.

00:13:08.020 --> 00:13:13.980
And then also indexes consume additional storage space because remember it creates files.

00:13:14.480 --> 00:13:14.820
Right.

00:13:15.780 --> 00:13:19.900
Um, number one, what does the size of the index depend on?

00:13:20.180 --> 00:13:23.160
Um, the size of the indexed field of fields.

00:13:23.420 --> 00:13:23.760
Right.

00:13:23.760 --> 00:13:30.800
If it's a very huge, um, if it's a field for very huge information, then it would be big.

00:13:30.820 --> 00:13:32.860
And then the number of documents in the collection.

00:13:33.060 --> 00:13:45.520
So the bigger the more the number of documents that are linked to a specific indexed field, the more obviously the index file becomes bigger.

00:13:46.860 --> 00:13:47.080
Right.

00:13:47.260 --> 00:13:49.560
And then some best practices for that.

00:13:51.180 --> 00:13:54.320
Index only frequently queried fields.

00:13:54.880 --> 00:13:54.980
Right.

00:13:54.980 --> 00:14:01.120
As an example, as I said, in a bank, the very first thing that they ask you is your ID number so that they can pull your profile.

00:14:01.300 --> 00:14:10.240
You can index that, you know, if they are going to use maybe card number, for example, you can index that.

00:14:10.340 --> 00:14:19.540
Then it pulls much, much quicker, you know, because then anybody that comes in needs to query using probably an ID number or a cell phone number.

00:14:19.540 --> 00:14:24.500
Or a card number, you know, and use compound indexes wisely.

00:14:24.560 --> 00:14:26.920
Don't just put them right.

00:14:27.040 --> 00:14:30.280
Make sure you use them in a in a very clever way.

00:14:30.420 --> 00:14:37.260
Um, where you can be able to filter for on multiple films, but use them very, very wisely.

00:14:37.260 --> 00:14:47.960
You don't want to have a situation where it ends up confusing you and then avoid over indexing because then it can consume storage and then it can slow down your right operation.

00:14:47.960 --> 00:14:51.260
Right. And then monitor your index usage.

00:14:51.460 --> 00:14:55.980
Use the index stats aggregation stage, the stage to monitor index usage.

00:14:56.140 --> 00:14:57.320
It's very, very important.

00:14:57.780 --> 00:15:01.960
Make sure that you monitor your index usage and then use covered queries.

00:15:03.060 --> 00:15:07.760
Um, the way it is covered, if it can be satisfied entirely using the index.

00:15:07.780 --> 00:15:13.380
So if you can use the index, then make sure just use the index and not really go all over the place.

00:15:13.380 --> 00:15:21.120
You know, um, it's for part of it uses an index and part of it has to go and search in other documents and whatnot.

00:15:21.300 --> 00:15:22.400
It wouldn't make sense.

00:15:22.400 --> 00:15:30.440
So make sure that if you're going to entirely use indexes in your query, use indexes the most right.

00:15:31.540 --> 00:15:37.940
Some single field index where you've got a single field as an index right on a single field in a collection.

00:15:37.940 --> 00:15:41.960
Right. That one very easy to use.

00:15:42.780 --> 00:15:49.900
Um, speeds up quiz that that do things like filtering, sorting, aggregate based on that field.

00:15:50.060 --> 00:15:54.000
Right. You can aggregate based on that field, your totals, your sum and all that stuff.

00:15:54.780 --> 00:16:01.940
Obviously, each entry in the index contains a value of the index field and then a pointer to the corresponding document.

00:16:03.100 --> 00:16:08.740
Um, for example, they when you have, um, this part, right.

00:16:08.940 --> 00:16:16.160
Uh, where you've got, uh, where's my pen now?

00:16:17.460 --> 00:16:22.700
Um, this part, so you're creating on, um, on names.

00:16:23.000 --> 00:16:29.140
Uh, that's your index, you know, um, and when it's one, it's ascending order.

00:16:29.140 --> 00:16:31.140
When it's minus one, it's descending order.

00:16:31.640 --> 00:16:35.260
Use cases of it, filtering or sorting by a single field.

00:16:35.980 --> 00:16:40.400
When you want to find all students with a specific name or sorting students by age.

00:16:40.580 --> 00:16:42.080
That's another way you can do that.

00:16:42.400 --> 00:16:49.340
Then there's the compound one where you've got a combination of multiple fields in a connection in a collection that you want to index.

00:16:50.160 --> 00:16:52.320
Right. Um, multiple fields.

00:16:52.320 --> 00:16:57.420
And then it helps, especially when you do things like filter your sort aggregation.

00:16:57.420 --> 00:17:05.060
Right. Uh, same thing, um, creates a B structure, um, B tree structure for the combination of fields.

00:17:05.440 --> 00:17:09.500
And then the order of the field in the index is it matters.

00:17:09.660 --> 00:17:11.400
Right. Queries can be used to index.

00:17:11.440 --> 00:17:14.260
They include the prefix of the index field.

00:17:14.640 --> 00:17:24.780
Right. An example is if you index on name and age, right, then you can be able to, um, use queries on name or age or name and age.

00:17:24.780 --> 00:17:31.380
Right. Um, that's how you can, um, be able to utilize them.

00:17:31.580 --> 00:17:38.120
So it's either you can use name or you can use name and age or you can't use just age.

00:17:38.320 --> 00:17:43.280
So there is that precedence of the order of how you're using it.

00:17:43.280 --> 00:17:47.300
Name and age, name or name and age, but not age.

00:17:48.040 --> 00:17:53.780
Right. Um, compound, compound index when you're creating it, it's just as simple as

00:17:53.800 --> 00:18:00.300
adding the two. Right. And then use cases when you want to filter or sort by multiple fields.

00:18:00.540 --> 00:18:09.780
And then, for example, if you want to find all students with a specific name and age range, then you can be able to use that.

00:18:10.500 --> 00:18:20.300
Right. Geospatial, as I said, geospatial, as I said, is where you're using coordinates, your geospatial data,

00:18:20.300 --> 00:18:26.920
um, 2D for flat 2D coordinates, your 2D sphere. And I think there's 3D now.

00:18:27.300 --> 00:18:34.380
Um, and how does it work? It uses like it uses special specialized data structure, which is geohashing.

00:18:34.780 --> 00:18:41.440
Right. To index your geospatial, geospatial data. Um, example, Uber and all that stuff.

00:18:41.680 --> 00:18:47.760
And then, for an example, you can be able to create an index using location.

00:18:47.760 --> 00:18:55.540
Right. Which is 2D sphere. Um, and then how can you be able to use it?

00:18:55.660 --> 00:18:59.480
An example is finding all places within a certain distance from a point.

00:19:01.160 --> 00:19:08.820
Best practices when it comes to single field index is used for filtering or sorting by a single field.

00:19:09.380 --> 00:19:16.440
Right. Um, where you want to index email for user authentication, where you use your email, for example,

00:19:16.440 --> 00:19:24.660
for authentication. That's a single field. And then compound is where you want to filter or sort by multiple fields.

00:19:25.480 --> 00:19:30.380
Right. And then ensure the order of the field matches the query patterns. That's very important.

00:19:30.880 --> 00:19:37.800
Geospatial, when you want to use for location based queries, you know,

00:19:37.800 --> 00:19:47.140
use 2D sphere for spherical geometry, for example, its surfaces and then avoid over indexing.

00:19:47.420 --> 00:19:53.860
It's very, very important or else it will slow down operation to use up your storage and then monitor.

00:19:54.620 --> 00:19:58.640
Always monitor. Monitoring is going to be a word that we will hear all the time.

00:19:59.000 --> 00:20:00.800
Now, any questions on indexing?

00:20:00.800 --> 00:20:02.160
That's too good my side.

00:20:05.060 --> 00:20:07.320
Everyone else? Oh, good.

00:20:08.800 --> 00:20:16.840
Now we can now go and do number five and then exercise number one exercise day one.

00:20:17.480 --> 00:20:24.380
So if we go and look at number five, it says indexing so we can look at the indexing there.

00:20:24.380 --> 00:20:32.060
It still uses the same database, which is university, to do some indexing.

00:20:32.180 --> 00:20:37.520
You're going to create some index. You're going to create compound indexes, geospatial.

00:20:38.080 --> 00:20:43.700
But I don't think you might really it might really be worth it.

00:20:43.720 --> 00:20:46.160
But you can try it. I don't think it will work though.

00:20:46.400 --> 00:20:54.200
But then you also look at query optimization, where you find a student by email and you optimize by a single field.

00:20:54.200 --> 00:21:04.320
Or you then look at putting using a compound index, you know, putting geospatial not really using any coordinates or anything.

00:21:04.320 --> 00:21:07.320
So it might be really tricky. You can try it, but I don't think it will work.

00:21:07.320 --> 00:21:17.060
It might give you an error. And then there's something called what you call this query profile that you can be able to use.

00:21:17.300 --> 00:21:19.960
So also have a look at that.

00:21:19.960 --> 00:21:24.420
It also helps in terms of query optimization and all that stuff.

00:21:25.320 --> 00:21:30.360
And then, yeah, after that, there's exercise day one, right?

00:21:30.540 --> 00:21:37.780
Exercise day one is more or less what we've spoke about the whole entire time.

00:21:38.280 --> 00:21:45.960
There's going to be some insert. There's going to be some deletion, updating and then some operations that you need to do.

00:21:45.960 --> 00:21:55.960
For example, checking stats, creating an index, a bit of advanced where you probably need to change one or two configurations and then be able to see how it works.

00:21:56.300 --> 00:22:04.680
But then you find that most of the stuff that we spoke about or that we try to do might actually be there, for example.

00:22:05.380 --> 00:22:11.040
Yes. Are you sharing screen or we must just follow on the site? Oh, I wasn't sharing my screen.

00:22:11.040 --> 00:22:14.700
But OK, let me share my screen with you.

00:22:15.360 --> 00:22:17.780
Where is my machine?

00:22:25.800 --> 00:22:29.540
This one. OK, I think I got it now.

00:22:30.800 --> 00:22:31.580
We knew.

00:22:34.040 --> 00:22:35.680
Can you see my screen now?

00:22:36.160 --> 00:22:37.460
Yes. OK, cool.

00:22:37.460 --> 00:22:48.620
So I was saying that so indexing is more or less you're going to create an index using the existing database that database that is there, which is the university one.

00:22:48.820 --> 00:22:53.380
Create your complex query, your compound indexing.

00:22:53.700 --> 00:22:59.480
And then you do some query optimization, use a query profiler and all that stuff.

00:22:59.740 --> 00:23:02.460
Right. And after that, there's exercise day one.

00:23:02.720 --> 00:23:12.420
Right. There are some things that you probably have done already, like you've created the university database already.

00:23:12.760 --> 00:23:15.160
And then you need to insert some documents.

00:23:15.700 --> 00:23:22.080
Be mindful of the names. It might be names that are existing, the existing change it or use upset.

00:23:22.100 --> 00:23:29.560
It's up to you. And then query finding some courses, some crude operations where you need to delete something,

00:23:30.260 --> 00:23:37.540
you know, some intermediate operations, some collecting of stats and then some indexing also.

00:23:37.880 --> 00:23:48.100
And then a bit of advanced stuff, for example, where you're going to do security, storage path, you know, system logs.

00:23:48.620 --> 00:23:54.720
This might not really you might not really worry about it because already it's connecting on local host, so there's no need to worry.

00:23:54.720 --> 00:24:00.100
But in terms of the rest of the stuff, start Mongo with the configuration file.

00:24:01.060 --> 00:24:07.520
If you want to create a separate configuration file and put this, then you can be able to start it that way.

00:24:07.940 --> 00:24:11.520
And yeah, most of the stuff is just what we spoke about.

00:24:12.620 --> 00:24:22.720
Hardware and file system, you might not be able to do that because obviously you can't add any any SSD, but you can be able to add journaling.

00:24:22.720 --> 00:24:26.500
Right. And then see what could be happening within the journaling.

00:24:26.880 --> 00:24:33.720
And then there's some security aspect of it that we did already some security deployment recommendations.

00:24:34.640 --> 00:24:36.820
These are just the recommendations. Right.

00:24:37.240 --> 00:24:43.220
And then you do some monitoring and then you be done for that day for the day.

00:24:43.620 --> 00:24:49.340
So let's do number five. And then after that, do exercise number one exercise day one.

00:24:49.340 --> 00:24:52.420
Sorry, it's super clean. Cool.

00:24:52.560 --> 00:24:57.280
So we're doing five and exercise day one.

00:24:58.860 --> 00:25:00.460
OK, OK, cool.

00:25:00.860 --> 00:25:05.900
So I've lost you there when you said so you said to say something.

00:25:08.020 --> 00:25:16.340
When you mentioned geospatial, yeah, geospatial because we're not we're not we don't have any data that relates to geospatial.

00:25:16.360 --> 00:25:19.360
Right. Like coordinates at any point. Right.

00:25:20.080 --> 00:25:25.140
We in that we you probably might not see anything that's not no effect.

00:25:25.560 --> 00:25:33.740
Rather, if I if that makes sense, because we don't have that data, we don't have any way that needs that data like location.

00:25:33.820 --> 00:25:40.320
For example, we don't have a situation like it's an application or data.

00:25:40.580 --> 00:25:42.540
We don't have that within our database.

00:25:43.840 --> 00:25:50.520
We can I can always create a script that can create that data if you if you want.

00:25:50.920 --> 00:25:58.440
But it's like you might not really see the effect besides just showing you the information in itself.

00:25:58.960 --> 00:26:03.660
The effect of it speeding up works when there's an application that needs to access the location.

00:26:04.100 --> 00:26:06.200
Right. But we don't have that application.

00:26:06.200 --> 00:26:09.800
So it's it really would be too much admin to have that.

00:26:09.800 --> 00:26:13.700
It's just the run commands for for nothing.

00:26:14.760 --> 00:26:16.700
Yeah, you.

00:26:18.140 --> 00:26:19.700
It's obvious.

00:26:20.340 --> 00:26:22.560
Comparison starts with errors.

00:26:23.440 --> 00:26:24.700
What is started with errors?

00:26:28.100 --> 00:26:30.120
Unexpected token limit.

00:26:32.780 --> 00:26:40.400
Number five point one point one five point one point one.

00:26:40.800 --> 00:26:42.140
Well, what are you getting?

00:26:42.820 --> 00:26:44.000
Who is this now?

00:26:44.620 --> 00:26:45.600
Unexpected token.

00:26:47.220 --> 00:26:49.300
I'm also getting the same error.

00:26:50.760 --> 00:26:55.260
Well, I can see the I can see the issue before I even tell you you're not logged into your database.

00:26:56.740 --> 00:26:58.140
Yes, sir.

00:26:58.200 --> 00:26:59.360
Log into your database.

00:26:59.400 --> 00:26:59.720
Mongo.

00:27:00.160 --> 00:27:00.260
Yes.

00:27:01.980 --> 00:27:05.280
And then you can then run those.

00:27:06.800 --> 00:27:09.160
You can now copy and paste.

00:27:11.100 --> 00:27:19.200
Anything that that has a use this or DB something should know that you need to run it within the database.

00:27:19.700 --> 00:27:20.200
Right.

00:27:21.700 --> 00:27:24.660
You need to you need to authenticate.

00:27:26.840 --> 00:27:28.460
You need to authenticate.

00:27:30.020 --> 00:27:31.960
So exit and then authenticate.

00:27:31.960 --> 00:27:37.080
Right. And just go up arrow until you get to the part where it's supposed to.

00:27:38.240 --> 00:27:38.920
Yeah, that one.

00:27:40.340 --> 00:27:40.700
Yeah.

00:27:41.640 --> 00:27:42.200
Yeah.

00:27:43.500 --> 00:27:45.920
And then now you can try and run those.

00:27:47.080 --> 00:27:48.120
Those commands.

00:27:49.140 --> 00:27:51.420
Use investee and yeah.

00:27:53.060 --> 00:27:54.220
Did you see that?

00:27:54.500 --> 00:27:55.920
Are you sorted Winnie?

00:27:58.000 --> 00:27:59.020
No, I'm not sorted.

00:27:59.580 --> 00:28:01.320
OK, I'll come to your screen just now.

00:28:02.900 --> 00:28:05.720
This is going to be interesting to figure out.

00:28:06.840 --> 00:28:13.000
You're not authorized to do what you did, which means the user that you're using is not authorized to do that.