前端、後端、資料庫是什麼?它們如何溝通?實際範例解說

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Before I start, I want to ask a question . If you think you should learn html first or database I want to start learning before I don’t know what role and function each technology plays. This will lead to the situation of learning from the east and learning from the west. In the end , I will not know anything. So today I will clarify these things and explain the front-end and back-end. What do the terms database mean? After watching this video, you will understand what is front-end , what is back-end, what is database and what do you need to learn? Let 's use an example to substitute it . Suppose I downloaded twitter on my mobile phone today. The size of the app is more than 100 MB . After you open it, you can perform actions such as logging in and viewing other people's posts. Have you ever thought about how to log in and view other people's posts? If you want to Login means this app needs to know your account password and he can check if the account password you entered is correct. If you want to display a new post , it means this app must have the post data somewhere. So it shows that the more than 100 MB downloaded at the beginning contains your account password and all the posts in the world It is constantly downloading data on the Internet. For example, when you want to see the latest post, the Twitter app will go to their server to grab the latest post data , and it will only be displayed on your phone after it is caught. On the screen, where exactly do these data come from? The answer is the API server . We usually call this part the backend. In this example, the Twitter App with more than 100 MB downloaded at the beginning is what our front -end does. It is responsible for displaying the user interface. In this process, it will need to communicate with the back-end and send a request to the back-end, that is, request to obtain the required data and display it . What the back-end does is to process the operation and logic of the application according to the request sent by the front-end. And provide the information required by the front end. Let’s look at the process of viewing the latest posts again. After opening the app, we want to see the latest posts. At this time, the mobile app will send a request to the back-end API server to request the latest post information. At this time, the back-end will prepare the data and send it back to the front-end. The front -end will display the data on the screen, so you can see these posts. After reading this example, the concept of the front -end and back-end should be much clearer, but there is still one part that is missing . Speaking of which is the database. In the example just now, since the backend can prepare the post data to be displayed, does it mean that the posts of all users are stored in the backend? Otherwise , how can we get it? To this data, if the number of users is very small, it may be feasible to store the data on the back-end machine , but when the amount of data becomes larger and larger , it becomes very difficult to store the data in the back-end, except for the difficulty of developing a good management format. In addition, there will also be effective performance problems. Therefore, we will have another place that is solely responsible for storing data. This is the database . The database will optimize the data access method, so even if the amount of data is very large , it can efficiently read what you need. Part of it will also make the maintenance and backup of the data easier , so in the example of the latest post, the database may have a table to store all the user's post data. After the backend receives the frontend request, it will actually be obtained from the database. You need to post the information and then send the information back to the front-end to this side. You should already understand what the front-end and back- end databases are responsible for. Seeing this, you have already watched half of the video. If you think this video is good , for you Helpful, remember to click the like for me so that the algorithm will be recommended to more people. Let 's take a look at the example process of login mentioned above. After reading it, the whole process should be clearer. When we want to login in the twitter app When you enter the account and password, a screen will appear that requires you to enter the account and password. After you enter the account and password, the front-end App will transmit the information of your account and password to the back-end. At this time, the back-end needs to check whether the account and password are correct. How to check? There will be a table in the database to store the account and password data of all members, so the backend will ask the database if there is a data account that matches the account entered by the user. If not, of course, the login will fail, but if there is one, the This information is captured and then compared to see if the password is correct. If it is correct, the backend will generate a string of text and send it to the frontend . After getting this string of text, the frontend will be successfully logged in, and the frontend will enter the Twitter user interface. String of text We call it token . About how token works, I will introduce it in a later video. Ok now, everyone should fully understand the respective functions of front-end, back-end and database . The front-end does not have to be a mobile app , it can be a web page or a desktop program. For example, twitter itself has a web version. After opening twitter.com, the browser will download the front-end code including html, JavaScript and css to your browser. The above things are also responsible for displaying the interface, and the front-end code during use will also request data from the back-end API server. Next, I will introduce the tools that are usually used for the front-end and back-end databases to implement the front-end . For example, if it is presented as a web page, html , css and JavaScript will be used to make development easier and faster . Now there are some JavaScripts. The framework or library of ript is like react view angular, etc. If it is a mobile app, this method is usually divided into Android and iOS apps. Android usually uses kotlin language to write , and iOS is written in swift language, but now There are also some cross-platform technologies. For example, react native and flutter use these things to complete Android, iOS, and even web-based apps. As for computer-based apps, there are options such as electron.net core. In terms of back-end, basically most programming languages ​​can be used to write, unlike the front-end of web pages that can only use JavaScript . Of course, each language has its advantages and disadvantages. These more common languages ​​include JavaScript , golang, Java , C#, Python, etc. Each language also has its own framework. Each language and framework have their own shortcomings , but basically the structure and function are not too different. After mastering one, it will be easier to learn the other. Finally , the database Databases are divided into SQL and NoSQL . SQL has MySQL, postgreSQL, Oracle , etc. NoSQL has mangoDB, Firebase , Redis, etc. Back to the beginning of the question , should you learn HTML or database first? Everyone who sees this should know why HTML and information are strange. The library functions are completely different, it is very strange to compare things , and engineers who specialize in the front end don't need to touch the database part. If you specialize in the back end, you don't necessarily need to touch the front end, but the point is to start learning Before you know what function you are learning and what role it plays in the entire technology stack, you won't spend a lot of time learning but don't know what you are learning. Today 's video is here. If you think this video is not bad, it 's for you Helpful, remember to like and subscribe for me and then share it with everyone , then we will see you in the next video bye bye
Info
Channel: 走歪的工程師James
Views: 343,481
Rating: undefined out of 5
Keywords: 軟體開發, 工程師, 前端, 後端, 資料庫, 網頁開發, 網頁工程
Id: G-Ks1XYGyaY
Channel Id: undefined
Length: 8min 58sec (538 seconds)
Published: Mon Sep 19 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.