Every website can be split up into twoparts, the front end and the back end. Thefront end is all the visual stuff yousee on the web page, and the back end iswhat saves and manages your data, forexample, if you are on amazon.com thebackend would store your order history,your profile, it would load searchresults, and much more. In this videowe're going to take a look at thetechnologies that are used in the backend of a website and in another video weexplore the front end technologies.As an example, let's say that we're onamazon.com, and we do some shopping, andnow we're ready to make an order.When I click place order what happens?We're going to start from the ground up.Any computer that's connected to theinternet, including your computer and mycomputer, can send a message across theinternet to another computer, that's alsoconnected to the internet. So to simplifythings, amazon has a computer in theiroffice building somewhere, and ourcomputer is going to send a messagecontaining our order to that amazoncomputer.In this scenario the computer that issending the message is called the client,and the computer that is receiving themessage is called the server,but before this happens, computers theycan't receive messages from the internetby default. We have to program them to beable to receive messages. To do that weneed a back end programming language.Almost every programming language has afeature that turns a computer into aserver and allows it to receive messages.Popular backend programming languagesare javascript, sometimes called node.js,python, ruby, and java.However, using a backend programminglanguage by itself is actually reallydifficult, and requires a huge amount ofcode. So there are two tools that we useto help with this.A back-end framework and a packagemanager.A back-end framework helps us create aserver much easier and with a lot lesscode.Each backend programming language has afew different frameworks to choose from,but the most popular ones are express jsfor javascript, python django, ruby onrails, and java spring.In the back end we also use a lot ofcode that other people have written,called packages, to do common tasks likedoing calculations, talking to a database,and setting up user login andauthentication. We typically use a lot ofpackages in our back end and in order toinstall and manage all these packages weuse something called a package manager.Each language has its own packagemanager, the most popular ones are npmfor javascript, pip for python, bundlerfor ruby, and maven for java.These are all the technologies we needto create our backend server.The next problem we have is we needsomewhere to save the data for ourwebsite. Going back to our amazon example,data could mean our user data like thelogin information, order history, as wellas data for all the products that arebeing sold on amazon, the descriptions,the ratings, and the reviews.To do this we use a database. A databasehelps us store and manage data, it's justa piece of software that usually runs ona different computer, and we have to dosome setup so that our backend cancommunicate with the database.The most popular databases are mysql,postgres, and mongodb. Alright so ifyou're just starting out this isbasically all you need for the back end.You can build most of your projects withjust a server and a database. For example,here's how our amazon scenario couldwork.When the customer places an order in thefront end, the front end sends a messagecontaining the order to the back end, thebackend then saves the order to adatabase, and sends back a message to thefront end confirming that the order wascreated. The message at the front endsends to the back end is known as arequest, and the message that the backendsends back, is known as a response.This is called a request response cycleand this is generally how webapplications work.Here's another example, let's say thatyou're in the amazon warehouse. Thewarehouse might have a different frontend that sends a request to the back endto get our order. The back end then getsour order from the database, and sends itback to the warehouse front end, and thenthey go ahead and prepare our order.Now that we've seen the overall flow,we're going to dive deeper and take alook at what's inside a request.Here's a simplified example of a requestto create an amazon order.Ff we read over it we can see that it'sactually really easy to understand. Wehave the items that we ordered, thequantities, and some other informationabout our amazon order.At the top we have the type of therequest, the domain name, and the url path.This describes where this request isgoing, and what type of request this is.First of all amazon the company hasbought the domain name amazon.com, andthey configured it so that any requestsgoing to amazon.com will be redirectedto that server in their office building.So that's why we're sending this requestto amazon.com.The type and the url path identify whatkind of requests this is.So in this example this is a postrequest to /orders.In the back end we use our programminglanguage and back-end framework todefine what types of requests areallowed and how we should handle theserequests. For example we can allow a postslash orders request and whenever we geta post slash orders request, we willcreate an order using our programminglanguage, and save it to our database. Wecan also allow a get slash order requestand in this case we will retrieve theorder history from the database, and sendit back as a response. Another example isa delete slash order request where wewill cancel the order. So this list ofall the different types of requests thatthe backend allows is called an api,application programming interface. Theapi is one of the most importantconcepts in back-end programming. If yousend a request that is not allowed bythe api, the backend will respond with anerror.So we mentioned earlier that we canidentify requests using a type and a urlpath. There are several types we canchoose from such as post, get, put, anddelete, and the url path can be anythingwe want.So why in this example do we choose postslash orders?This is just a naming convention for ourrequests, and this naming convention iscalled rest. Representational statetransfer.In rest the type of request has aspecial meaning, so post means to createsomething, in this case post orders meansto create an order, get means to getsomething, and delete means to deletesomething, and so on. An api that uses therest naming convention is called a restapi.Rest is the most common convention thatwe use for our apis, but there areseveral other conventions that we coulduse.One of them is called graphql which usespost slash graphql for all of ourrequests and another one is called rpcwhich uses post and a more detailed urlpath like post slash create order orpost slash get order history.So that is what a request is, what an apiis, and what rest means. Now let's talkabout infrastructure.Nowadays, instead of companies purchasingtheir own computers to run theirwebsites, they rent computers from acloud computing company. The biggestcloud computing companies are aws, amazonweb services, gcp, google cloud platform,and microsoft azure. The basic idea ofcloud computing is you're renting abunch of computers. This is also known asiaas infrastructure as a service. Behindthe scenes, aws has a giant, powerfulcomputerand inside its software it's runningmany smaller computers and we'reactually renting one of these smallercomputers.And these smaller computers only existin the software so we call them virtualmachines, or vms. So to run our website, werent a vm from aws to run our back end,and we also rent another vm to run ourdatabase.Another problem we have to solve is whatif our website gets really popularduring the holiday season, and we startgetting a lot of requests and internettraffic that our server can't handle?With cloud computing, we can set upmultiple vms running the same back-endcode, and then set up a special vm infront of these called a load balancer,and the load balancer will distributerequests evenly across our vms. Once theholiday season is over, we can just shutoff our vms when we don't need them. Thisis a lot easier than having to buyphysical computers, where if the holidayseason is over you still have thephysical computers that you paid for. Butwe still have another problem, we nowhave a lot of vms that we need to createand set up, and it takes a lot of timeand effort.Cloud computing companies offer anotherservice called a paas a platform as aservice.A paas just lets us upload our backendcode, it will set up all the vmsincluding the load balancer andintegrate everything for us. The threemost popular paas are elastic beanstalk for aws,app engine for gcp, and app service formicrosoft azure. The next concept we'regoing to look at is micro services.For our amazon example, let's say thatour backend contains code that saves anorder to the database, charges the user'scredit card, and sends an emailconfirmation.In the real world this back end can bemillions of lines of code, so we splitthis up into three code bases. Then eachof these code bases will have their ownbackend, each with the load balancer, andsometimes their own database. Then whenwe need to send an email, our ordersbackend will send a request to the emailbackend, which will send the email. Sosplitting up our back end into separatebackends like this is calledmicroservices, and it helps keep our codebase smaller and more focused. Eachmicroservice does not have to use thesame programming language and database.One microservice can be using javascriptand mongodb, while another microservicecan be using python and mysql.Now to make this even easier, there arecompanies out there like twilio who havealready created an email service. Sotwilio provides a backend and an api forsending emails so instead of us creatingour own email microservice, our backendcan just send requests to twilio'sback-end. When a company provides aback-end and an api that outsideapplications can use, this is called asaas software as a service. Pretty mucheverything you do in the back end that'scomplicated there's probably a saascompany out there that already providesthat service and you just use thatservice instead of building your ownmicroservice.So these three concepts we just lookedatinfrastructure as a service, platform asa service, and software as a service, arethe three foundations of cloud computing.These days most companies use cloudcomputing to run the backend for theirwebsites instead of buying and managingphysical servers themselves.In this last section I want to introducesome additional technologies you mightsee in the back end. Previously wementioned the databases mysql, postgres,and mongodb.These are sometimes called primarydatabases because they're the maindatabase that our website uses.Generally we start our backend with aserver and a primary database and thenbring in these additional technologiesif we need to.If we allow our users to upload images, aprimary database is not good for storingimages, so we would use a blob store likeaws s3, and a cdn like cloudfront tostore and load user uploaded images.If we want to allow text searchprimary databases are very slow at textsearch so we would bring in a searchdatabase like elasticsearch.If our website is getting a lot oftraffic and we need to take some stressoff our primary database, we would add acache like redis to improve performance.If we want to do data science we don'twant to do the data analysis using ourprimary database, it's busy running ourwebsite. So we would copy all of our datainto an analytical database likesnowflake, which is really good for doingdata science on the side.If you want to schedule a task for later,for example, amazon might want to emailtheir users before their amazon primesubscription renews, we would use a jobqueue like rabbitmq to schedule this taskfor the future, and there's a bunch moretechnologies like these out there thatare made to solve specific problems. Sothese are all the backend technologiesthat we covered in this video,if you're just starting out you mostlyjust need to know how to use cloudcomputing, a backend framework, and aprimary database.These other technologies are things thatyou may or may not use. You would addthem to your backend depending on whatkind of website and features you'retrying to make.Thanks for watching my name is Simonfrom supersimple.dev I want to make atech career possible for anyone. If youhave any questions or comments pleaseleave them down below and I'll see youin the next one.