Hey, did everyone share?
And welcome to another video.
And in this video, we'll talk a little bit detail about what we're going to build next, as well as
the modeling of the database.
Now, the next thing that we're going to build is obviously we are in the authentication section, so
we need to build an entire authentication system.
So far, any of the route is not protected.
Anybody can access it.
So we want to create a functionality where people can actually register into our application, can log
it into our application, and based on whether they are logged in or not, they can access certain routes.
So we need to provide this functionality.
So on the whole, we need to provide user registration mechanisms.
So we need to take some information from the user and that's where the modeling of the data comes in.
So let's go ahead and talk about the modeling of the data, not this kind of model, but actually what
information you'll be getting.
This is known as modeling your data or model your data.
Now, every single application need to worry about what kind of data they are going to be taking either
from the user or will be showing to the user.
This is the key point of entirety of the application.
People stress a lot less on this than they should be because this is the whole heart and the meat of
your entire application.
Whether you are making a social media application or an e-commerce application, what data you'll be
collecting from the user, what data you'll be saving to that database, which one will be shown to
the user, which will be shown to the admin?
They all need to be figured out in advance or at the very first stage and there are a lot of things.
But one of the recommendations that I can give you is always think about the single unit of the thing.
If a user signs in, then what information will be asking for him?
First name, last name, probably username, probably email, password and all those things.
And not only that, this is the information that we'll be asking from the user.
There might be more additional feel that we might want to generate.
Probably we want to generate a field based on the first name and last name he has given to us.
We want to save the entire name of the user.
Also, there can be more such things that we are going to talk in this video now.
There are so many other recommendations that comes up when you read more books.
Some books says that if there is an operation need of performing a crud, that should be a separate
entity itself.
And there are such amazing recommendations given all around the books and we won't be going too much
in depth.
But the bigger question is how we actually model that.
Now, I have modeled so many of the database write on the pen and paper.
This is how I have done in the initial days.
But as we move into the production environment, you are going to realize that there are tools available
for database modeling.
So some of the tools I can show you this is the SQL DB.
And again, it doesn't matter whether you're using SQL specific tools or you're using no skill specific
tool.
Data modeling is just data modeling.
It just what are the fields that are going to be there?
That's it.
That's all we want to do.
So whether you use any specific tool or other tool, it doesn't really matter.
Sometimes these tools help you to visualize.
As you can see in the behind the scene image, there are multiple tables available and you can just
go ahead and see the relation between the tables and everything.
It gives you a great visualization in the production grade.
In the smaller application or tutorial.
It doesn't make sense to have this, but you can see that this is how you can add all of the data and
all of that.
Some of them even actually generate you some basic scripts.
They are a good starting point, but they are not everything.
You need to tweak it a lot, in fact, a lot than you think.
So you can see that these are some of the good ones.
There is no free of them.
You have to pay for them.
That's why we won't be using any of that.
But still, I wanted to show you that this is what is being used in the production grade.
As you can see here, the diagrams are pretty amazing.
We know about the relations, how they are working up.
Is it 1 to 1, one to many, or however the database specification works on?
So this is what we got up here.
This is one of the most interesting one.
But if you're going to check for the pricing, you are going to notice that this is not cheap.
It becomes a really expensive one.
The annual license is 240.
But for the companies who are working like really amazingly, this is not too much of a big deal.
Another one on which I have recently shipped from SQL DBM is the Mood Modeler.
I loved this because this has so much of the functionality, right, baked in for the NoSQL database
as well, as well as for the SQL database as well.
So you can work with Mongo.
Postgres.
So this is one again, this is also paid one, so we won't be using it.
But I'll still show you in this one that how this you can actually work on.
So let me bring it up.
They're color coding and everything is like super amazing.
Just wanted to show you that how it works and what it actually is capable of so I can go ahead and create
a new project in this one and you can select your database and you can even choose your mongoose or
you are using Mongo.
So now you get the idea that how popular mongoose is if these kinds of tools, paid tools, are giving
you direct access that.
So this is a type mongoose.
Let me go ahead and call this one as test one.
This is test one or test two.
And let's go ahead and create a new project.
Now you have the color code reference in everything.
Let's go ahead and start with that so you can go ahead and directly say that I want to create a schema.
So in this, the ID is obviously going to be one other thing to uniquely identify that.
But apart from that, maybe you.
Want to grab a first name of the user.
So you're going to go ahead and say, hey, get me a first name, get me a last name also.
And I want to grab email of the user also, and I'll be storing the password of the user, of course,
encrypted, but you can get the idea now here you can see that I can go ahead and check that I want
to grab string object ID numbers makes all the data types that are also given to you.
Now, apart from this, if you have more tables, you can go ahead and say, I have another schema going
up here which is having a name and probably this will have a product and more information about the
product.
You can actually go ahead and reference them each other.
So this helps you to visualize this really nicely.
You can also go ahead and create script and it can actually generate you a very basic schema.
This is not really good.
You have to tweak it a lot, but a good starting point that it can help you.
Now again, the reason why I'm showing you all of this is because a whole lot of people in the industry
actually uses that at some of the startups actually miss these kinds of modeling tools because they
have never used it.
So now you know about it because you are a pro backend developer, so you know that these tools exist.
But since this is paid one, I cannot actually go ahead and use this one.
So we're going to go ahead and discard all of this.
We will be going back on to our Miro and we are going to go ahead and get started with just the mind
map.
And this is again, these tools are helpful, but you don't need absolutely that.
You can just go ahead and do that on pen and paper.
I have done that for years and it works absolutely fine.
So in the next video, we're going to talk a little bit more about our application, what's the goal
and what's the whole thing that we'll be doing and we'll be working on creating our model for this very
first application.
Let's go ahead and catch up in the next video.