WEBVTT 00:05.880 --> 00:11.560 In this video we're going to go through some other examples showing how the back end works. 00:11.580 --> 00:19.230 So in this example we are looking at the BBC websites and we checking how the BBC Web sites will show 00:19.230 --> 00:22.690 us results corresponding to a certain keyword. 00:22.710 --> 00:29.670 So I'm looking here for all articles corresponding to the keyword safari and you can see here that the 00:29.830 --> 00:39.960 website is showing results corresponding to the keyword safari so showing articles with a title containing 00:39.960 --> 00:47.320 Safari or a content containing the word Safari. 00:47.340 --> 00:52.790 So this is the URL which is sent by the user from the front end. 00:52.890 --> 01:00.780 So by the way this you are L is generated once you click on the search button and it's going to be included 01:00.780 --> 01:03.630 in the request send to the server. 01:03.630 --> 01:11.280 So once our up in the server receives this request it's going to communicate with the database by running 01:11.310 --> 01:12.090 a query. 01:12.120 --> 01:21.180 So it's looking for all rows in the articles table with a title or a body including the word Safari. 01:21.180 --> 01:27.570 So examples will include articles like that one or that one. 01:27.650 --> 01:33.010 So you've called safari in the title or inside the content. 01:33.010 --> 01:40.960 So once we find those results then the database is going to send them back to the app and then the app 01:41.050 --> 01:47.900 is going to build the search results web page and send it back to the user. 01:47.910 --> 01:49.950 Now let's have a look at another example. 01:50.100 --> 01:53.020 And that's the picks up a dot com Web site. 01:53.040 --> 01:57.910 This Web site allows you to search for images corresponding to a certain keyword. 01:57.930 --> 02:03.810 You can also look for videos if you like or specific types of images if you want to. 02:03.810 --> 02:08.880 So here you can see the search results corresponding to the keyword. 02:08.910 --> 02:09.270 See 02:12.000 --> 02:15.170 so let's understand how this works. 02:15.270 --> 02:16.430 So are the front end. 02:16.440 --> 02:25.000 The browser will send a request using the U.R.L. which is going to be received by the app. 02:25.200 --> 02:32.490 Then the app is going to break down this request and gets the keyword from the urinal and then is going 02:32.490 --> 02:35.590 to communicate with the database through a query. 02:35.640 --> 02:42.990 So the query here is going to be selecting all the rows with tags including the word c. 02:43.440 --> 02:51.060 And by the way it looks also for related keywords like ocean beach water sunsets and nature. 02:51.060 --> 02:56.090 So here is our pictures table inside picks a B. 02:56.160 --> 03:04.890 So this table is inside this database and we're looking for rows matching this query. 03:04.890 --> 03:05.630 So here we go. 03:05.640 --> 03:13.110 We've got a row there containing the words sea and ocean and of course another row there containing 03:13.110 --> 03:22.780 the word sunsets which is a related keyword to see so once the database finds all the results it's going 03:22.780 --> 03:29.110 to send them back to the app and then the app is going to build this ACMA all web page and send this 03:29.110 --> 03:30.340 box to the user. 03:30.340 --> 03:35.730 And finally the browser is going to display this web page to the user. 03:35.740 --> 03:41.410 Now one more example let's suppose does a user is trying to sign into their icon load accounts. 03:41.620 --> 03:48.160 So they provide their email address and password and a request is sent to the server. 03:48.160 --> 03:55.930 Now once our up receives the request it's going to process the requests and retrieve that email and 03:55.930 --> 04:03.850 password then using those details it's going to communicate with the database and executes a query. 04:03.850 --> 04:11.650 Now the query is going to look for all records inside the user's table matching the information provided 04:11.650 --> 04:12.850 by the user. 04:13.150 --> 04:16.590 And that's supposed to be their email and their password. 04:16.600 --> 04:22.230 Now you just need to note that passwords are not stored in a table in plaintext. 04:22.300 --> 04:29.380 They are stored in a hushed for months meaning that when the user signs up we take their email address 04:29.620 --> 04:30.540 and their password. 04:30.580 --> 04:38.470 But we saw the password as a harvest value hashing a password means that instead of storing the password 04:38.470 --> 04:45.580 itself you apply a complicated formula to the password and then use tor the outputs of that formula 04:45.850 --> 04:47.440 in the database. 04:47.440 --> 04:55.690 Now that formula is so complicated that it is almost impossible to retrieve the real password if you 04:55.690 --> 05:00.440 get the harsh value and that's the whole reason of using hashing. 05:00.490 --> 05:09.310 Basically you are doing this just in case the database gets compromised and somebody finds details of 05:09.310 --> 05:10.380 your users. 05:10.390 --> 05:17.980 So in that case even if they find the highest passwords they are not going to be able to log in to any 05:17.980 --> 05:22.900 user's account because they need the real passwords not the highest values. 05:22.900 --> 05:23.130 All right. 05:23.140 --> 05:32.020 So once our query is executed if a user is found then we are going to log our user in and then we will 05:32.020 --> 05:34.090 show them details about their accounts. 05:34.090 --> 05:36.640 Now that you are comfortable with how the back end works. 05:36.730 --> 05:39.510 Let's have a quick review before we move on. 05:39.520 --> 05:43.740 So we said that's the France and represents our clients or their browser. 05:43.780 --> 05:46.250 Now that's where the requests come from. 05:46.270 --> 05:53.620 So a request could be sent through a U.R.L. to the app which is located on our server. 05:53.650 --> 05:59.470 Now once the OP receives the request is going to process it and then it's going to decide whether it 05:59.470 --> 06:03.360 needs data to be retrieved from a database. 06:03.370 --> 06:09.730 Now in that case he's going to send a query to the database and once that query is executed the database 06:09.730 --> 06:16.390 will send a response to the app and then the app is going to process that response and then is going 06:16.390 --> 06:19.660 to do whatever it needs to do with that response. 06:19.690 --> 06:22.370 It could be creating a web page. 06:22.420 --> 06:24.820 It could be anything else. 06:24.970 --> 06:27.060 So let's say it is creating a web page. 06:27.130 --> 06:33.760 All it needs to do now is send the web page as a response to the browser and then the browser is going 06:33.760 --> 06:36.480 to render the web page for our user. 06:37.300 --> 06:38.920 So that's how it works. 06:38.980 --> 06:46.660 Now we need to learn how to build this up and that's going to be the focus in the coming videos. 06:46.660 --> 06:53.890 So there are plenty of technologies you can use to build server side apps or apps hosted on a server 06:54.490 --> 06:56.290 the technology or platform. 06:56.290 --> 07:02.680 We're going to use in this course is going to be no genius in the next video you're going to get introduced 07:02.680 --> 07:07.500 to new ideas and start building up using this powerful platform.