WEBVTT

00:03.850 --> 00:05.410
Hey, did everyone share?

00:05.410 --> 00:06.610
And welcome to another video.

00:06.610 --> 00:11.530
And in this video, we'll talk a little bit detail about what we're going to build next, as well as

00:11.530 --> 00:13.180
the modeling of the database.

00:13.360 --> 00:17.710
Now, the next thing that we're going to build is obviously we are in the authentication section, so

00:17.710 --> 00:20.050
we need to build an entire authentication system.

00:20.050 --> 00:22.780
So far, any of the route is not protected.

00:22.780 --> 00:24.070
Anybody can access it.

00:24.070 --> 00:29.200
So we want to create a functionality where people can actually register into our application, can log

00:29.200 --> 00:33.850
it into our application, and based on whether they are logged in or not, they can access certain routes.

00:33.850 --> 00:35.800
So we need to provide this functionality.

00:36.040 --> 00:39.580
So on the whole, we need to provide user registration mechanisms.

00:39.580 --> 00:44.770
So we need to take some information from the user and that's where the modeling of the data comes in.

00:44.770 --> 00:49.660
So let's go ahead and talk about the modeling of the data, not this kind of model, but actually what

00:49.660 --> 00:51.220
information you'll be getting.

00:51.220 --> 00:54.820
This is known as modeling your data or model your data.

00:55.030 --> 00:59.860
Now, every single application need to worry about what kind of data they are going to be taking either

00:59.860 --> 01:02.080
from the user or will be showing to the user.

01:02.080 --> 01:04.990
This is the key point of entirety of the application.

01:04.990 --> 01:10.690
People stress a lot less on this than they should be because this is the whole heart and the meat of

01:10.690 --> 01:11.980
your entire application.

01:11.980 --> 01:16.930
Whether you are making a social media application or an e-commerce application, what data you'll be

01:16.930 --> 01:21.670
collecting from the user, what data you'll be saving to that database, which one will be shown to

01:21.670 --> 01:23.650
the user, which will be shown to the admin?

01:23.650 --> 01:29.620
They all need to be figured out in advance or at the very first stage and there are a lot of things.

01:29.620 --> 01:34.630
But one of the recommendations that I can give you is always think about the single unit of the thing.

01:34.630 --> 01:38.140
If a user signs in, then what information will be asking for him?

01:38.140 --> 01:43.450
First name, last name, probably username, probably email, password and all those things.

01:43.450 --> 01:46.840
And not only that, this is the information that we'll be asking from the user.

01:46.840 --> 01:50.140
There might be more additional feel that we might want to generate.

01:50.140 --> 01:54.910
Probably we want to generate a field based on the first name and last name he has given to us.

01:54.910 --> 01:58.240
We want to save the entire name of the user.

01:58.240 --> 02:02.320
Also, there can be more such things that we are going to talk in this video now.

02:02.320 --> 02:06.100
There are so many other recommendations that comes up when you read more books.

02:06.100 --> 02:11.050
Some books says that if there is an operation need of performing a crud, that should be a separate

02:11.050 --> 02:11.830
entity itself.

02:11.830 --> 02:17.110
And there are such amazing recommendations given all around the books and we won't be going too much

02:17.110 --> 02:17.680
in depth.

02:17.710 --> 02:20.500
But the bigger question is how we actually model that.

02:20.500 --> 02:24.160
Now, I have modeled so many of the database write on the pen and paper.

02:24.160 --> 02:26.320
This is how I have done in the initial days.

02:26.320 --> 02:31.060
But as we move into the production environment, you are going to realize that there are tools available

02:31.060 --> 02:32.410
for database modeling.

02:32.410 --> 02:36.070
So some of the tools I can show you this is the SQL DB.

02:36.070 --> 02:41.200
And again, it doesn't matter whether you're using SQL specific tools or you're using no skill specific

02:41.200 --> 02:41.470
tool.

02:41.470 --> 02:43.570
Data modeling is just data modeling.

02:43.570 --> 02:46.060
It just what are the fields that are going to be there?

02:46.330 --> 02:46.810
That's it.

02:46.810 --> 02:47.920
That's all we want to do.

02:47.920 --> 02:51.580
So whether you use any specific tool or other tool, it doesn't really matter.

02:51.580 --> 02:53.680
Sometimes these tools help you to visualize.

02:53.680 --> 02:58.210
As you can see in the behind the scene image, there are multiple tables available and you can just

02:58.210 --> 03:00.940
go ahead and see the relation between the tables and everything.

03:00.940 --> 03:03.790
It gives you a great visualization in the production grade.

03:03.790 --> 03:05.560
In the smaller application or tutorial.

03:05.560 --> 03:10.150
It doesn't make sense to have this, but you can see that this is how you can add all of the data and

03:10.150 --> 03:10.750
all of that.

03:10.750 --> 03:14.080
Some of them even actually generate you some basic scripts.

03:14.080 --> 03:16.660
They are a good starting point, but they are not everything.

03:16.660 --> 03:19.960
You need to tweak it a lot, in fact, a lot than you think.

03:19.960 --> 03:22.240
So you can see that these are some of the good ones.

03:22.540 --> 03:24.160
There is no free of them.

03:24.160 --> 03:25.480
You have to pay for them.

03:25.480 --> 03:27.160
That's why we won't be using any of that.

03:27.160 --> 03:31.450
But still, I wanted to show you that this is what is being used in the production grade.

03:31.450 --> 03:34.270
As you can see here, the diagrams are pretty amazing.

03:34.270 --> 03:36.700
We know about the relations, how they are working up.

03:36.700 --> 03:40.900
Is it 1 to 1, one to many, or however the database specification works on?

03:40.900 --> 03:42.640
So this is what we got up here.

03:43.360 --> 03:45.100
This is one of the most interesting one.

03:45.100 --> 03:49.840
But if you're going to check for the pricing, you are going to notice that this is not cheap.

03:49.840 --> 03:51.580
It becomes a really expensive one.

03:51.580 --> 03:52.940
The annual license is 240.

03:52.960 --> 03:58.240
But for the companies who are working like really amazingly, this is not too much of a big deal.

03:58.390 --> 04:03.100
Another one on which I have recently shipped from SQL DBM is the Mood Modeler.

04:03.100 --> 04:09.010
I loved this because this has so much of the functionality, right, baked in for the NoSQL database

04:09.010 --> 04:11.650
as well, as well as for the SQL database as well.

04:11.650 --> 04:13.180
So you can work with Mongo.

04:13.180 --> 04:13.630
Postgres.

04:13.630 --> 04:17.950
So this is one again, this is also paid one, so we won't be using it.

04:17.950 --> 04:21.580
But I'll still show you in this one that how this you can actually work on.

04:21.580 --> 04:22.810
So let me bring it up.

04:22.810 --> 04:25.570
They're color coding and everything is like super amazing.

04:25.570 --> 04:30.460
Just wanted to show you that how it works and what it actually is capable of so I can go ahead and create

04:30.460 --> 04:35.080
a new project in this one and you can select your database and you can even choose your mongoose or

04:35.080 --> 04:36.010
you are using Mongo.

04:36.010 --> 04:40.720
So now you get the idea that how popular mongoose is if these kinds of tools, paid tools, are giving

04:40.720 --> 04:41.920
you direct access that.

04:41.920 --> 04:43.300
So this is a type mongoose.

04:43.300 --> 04:45.280
Let me go ahead and call this one as test one.

04:45.280 --> 04:46.960
This is test one or test two.

04:46.960 --> 04:48.970
And let's go ahead and create a new project.

04:49.360 --> 04:51.610
Now you have the color code reference in everything.

04:51.610 --> 04:55.960
Let's go ahead and start with that so you can go ahead and directly say that I want to create a schema.

04:55.960 --> 05:00.220
So in this, the ID is obviously going to be one other thing to uniquely identify that.

05:00.220 --> 05:01.720
But apart from that, maybe you.

05:01.820 --> 05:03.980
Want to grab a first name of the user.

05:03.980 --> 05:11.090
So you're going to go ahead and say, hey, get me a first name, get me a last name also.

05:11.090 --> 05:16.040
And I want to grab email of the user also, and I'll be storing the password of the user, of course,

05:16.040 --> 05:21.710
encrypted, but you can get the idea now here you can see that I can go ahead and check that I want

05:21.710 --> 05:26.480
to grab string object ID numbers makes all the data types that are also given to you.

05:26.750 --> 05:31.430
Now, apart from this, if you have more tables, you can go ahead and say, I have another schema going

05:31.430 --> 05:37.340
up here which is having a name and probably this will have a product and more information about the

05:37.340 --> 05:37.820
product.

05:37.820 --> 05:40.220
You can actually go ahead and reference them each other.

05:40.220 --> 05:42.710
So this helps you to visualize this really nicely.

05:42.800 --> 05:47.420
You can also go ahead and create script and it can actually generate you a very basic schema.

05:47.420 --> 05:48.410
This is not really good.

05:48.410 --> 05:52.640
You have to tweak it a lot, but a good starting point that it can help you.

05:52.670 --> 05:58.820
Now again, the reason why I'm showing you all of this is because a whole lot of people in the industry

05:58.820 --> 06:02.840
actually uses that at some of the startups actually miss these kinds of modeling tools because they

06:02.840 --> 06:03.800
have never used it.

06:03.800 --> 06:08.390
So now you know about it because you are a pro backend developer, so you know that these tools exist.

06:08.390 --> 06:12.530
But since this is paid one, I cannot actually go ahead and use this one.

06:12.530 --> 06:14.690
So we're going to go ahead and discard all of this.

06:14.690 --> 06:19.460
We will be going back on to our Miro and we are going to go ahead and get started with just the mind

06:19.460 --> 06:19.730
map.

06:19.730 --> 06:23.990
And this is again, these tools are helpful, but you don't need absolutely that.

06:23.990 --> 06:26.120
You can just go ahead and do that on pen and paper.

06:26.120 --> 06:29.420
I have done that for years and it works absolutely fine.

06:29.420 --> 06:33.680
So in the next video, we're going to talk a little bit more about our application, what's the goal

06:33.680 --> 06:39.290
and what's the whole thing that we'll be doing and we'll be working on creating our model for this very

06:39.290 --> 06:40.280
first application.

06:40.280 --> 06:42.230
Let's go ahead and catch up in the next video.
