Backend
Backend is code that is run on the server and completes functions and actions whose outputs are given to the frontend (through middleware)
Think sensitive actions such as database operations, password validation, algorithms - these are all done server-side.
If you see the term 'server-side' or 'client-side' - it just means run on the server or run on the client. More simply, server-side is backend, client-side is frontend
For example, imagine if we gave users the code to access our database. I will talk about this later but a database is usually protected through a secret (stored as an environment variable). Even a stupid hacker could delete our entire database. I don't think Sabrina would be too happy with me if I did that.
Some actions are also validated by the server through authentication. For example accessing private user information would only be available to that specific user. The maths behind this is really cool - i would recommend looking into JWT or JSON Web tokens to see how it works
So a frontend system can send requests that are, in a sense, signed by the user so we know where its coming from and respond accordingly.
So, an EM specific example:
User searching for places on the map
- User Presses the "search" Button
- Frontend code then asks the server for places defined by what the user searched for
- The request reaches the server through an API
- The server then runs a function to find the places in our database and returns those places back to the front end
- the client (front end) receives the places and then proceeds to display it on a map to users
Clicking and Navigating to a specific place
- User processes a specific place on the map
- Frontend code asks server for information on that place
- The request reaches the server
- The server then runs a function to find all information on that place that is in our database (probably defined by the place id) and then returns that data back to the front end
- the front end receives all the information about that place and presents it on the website.
Both of these examples involve the backend doing database operations. That means that code must to be run on the backend (unless we want Bob the hacker to delete all the rows in my database)