Janet is a tech enthusiast and a software developer with a key interest in emerging technologies. She takes great joy in writing & travel.
The back end consists of databases, servers, APIs, operating systems and routing which work together to complete a request-response cycle. It is the code running on the server side which receives requests from clients and contains the logic that sends the appropriate data back to the client.
The back end of an application varies from one app to another. Some may utilise cloud-based servers (e.g Microsoft Azure and AWS), data warehouses, Backend-as-a-Service (BaaS), containerization (e.g Docker) or APIs to aid or replace more complex processes.
Servers are an important part of the whole back-end infrastructure. A server is a computer or software that provides functionality to other devices or programs. Clients can connect to a server through a local area network or a wide area network such as the internet. There are different types of servers. They include:
- Application servers - hosts web apps.
- Computing server - share computing resources over a network.
- Database server - maintains and shares any form of databases over a network.
- Web server - hosts web apps and is the backbone of the world wide web.
- Proxy servers - acts as an intermediary between a client and a server.
- Virtual server - shares hardware and software resources with other virtual servers.
How servers work.
When you enter a URL into a browser, you are sending a request to a server. Your computer communicates with the server hosting that website and pulls the response data back to your machine. The server cannot initiate a response if no request has been sent. Let's have a look at what happens when a client makes a request and how the entire request-response cycle works.
Say you plan on purchasing a new mouse for your laptop. You visit an e-commerce site on your browser. You click on an image of a mouse that catches your attention and the following URL runs:
This URL returns a GET request that is sent to the server of the e-commerce site asking for more information about the mouse.
/mouse/901243/ - shows that the client wants more information about the product with the id 901243.
The server receives the request and event listeners are triggered. A middleware runs between the request and the response. The server then makes a database query to fetch data related to the product. Such data include the product price, its brand, image and user reviews. The database then sends this data to the server. At this point, the server is ready to construct and send its response back to the client.
A response is sent with a header that contains HTTP status code 200 to show the request has succeeded. The browser receives the response and renders a view which is then shown to you, the client.
Mapping of requests.
Requests are in form of a URL. This URL gives the server all the information it requires in order to process a request. A basic URL looks like this:
Let's have a look at the breakdown of the URL:
- http:// - protocol that tells the server if the request is encrypted. HTTP is a standard non-encrypted request while HTTPS is an encrypted request.
- example.com - this is the host/domain name. It tells the internet which server to send the requests to.
- path - tells the server what the client wants and finds which section of code should be run in order to get the right response.
- ?query=value - it is used by a specific section of the server to alter the string response. It is broken into specific query parameters which can augment the way a server responds to a request for a specific path.
Responses that a server sends.
A server depending on the clients' request may return either a HTML file, data in form of JSON or a HTTP status code such as the 404 error code that is thrown when the URI does not exist.
Here are some of the most common HTTP status codes:
|HTTP Status Codes.||Meaning.|
Internal Server Error.
Other Back-end Tools.
- Middleware - Middleware forms a middle layer between the apps and the network, server, operating system, and the database. It is server-side software that facilitates client-server connectivity. Middleware can be multi-layered, organized into different layers of a site, whether it’s the presentation layer or the business layer. This is also where Web APIs can play into the stack, providing a bridge between the business layer and the presentation layer.
- APIs - An Application Programming Interface interprets the response data sent from the server and presents it in a readable way. As a piece of productized software, APIs go through the software development cycle of designing, testing, building, managing and versioning. They are treated more like products that code and adhere to standards such as HTTP and REST which are developer friendly.
Skills needed to work with Back-end.
- Knowledge of server-side languages e.g PHP, Java, C#.
- Database technologies e.g MySQL, SQL.
- Knowhow on writing RESTful APIs.
- Knowledge of back-end development.( configuration, administration and management of servers and databases.
© 2021 Janet Mutua