Application front-end and back-end (part 2)

timer 3 min read

Back-end, i.e. technical support for the application

A back-end is a part of a web application embedded on the application provider's server. As a rule, it consists of two layers - the database or databases and the application code. While in the case of the front-end we can talk about a certain standardisation of the tools used, to a large extent imposed by web browsers available on the market, on the back-end the freedom in the choice of tools, such as programming languages or types of databases, is much greater.

Popular toolkits are collected in the form of so-called frameworks, i.e. environments comprising ready implementations of selected solutions together with modules extending their functionality (libraries), enabling faster start of work on the actual application.

Regardless of the choice of framework or individual tools, the back-end as a whole must fulfil certain tasks in the context of the application's operation. Among these tasks one can distinguish:

    • handling requests received from the customer's application - including verification of their correctness and providing a response tailored to the content of the request
    • exchange of information with the database - the application code must enable both the retrieval of data (e.g. list of recently viewed films) and its saving (e.g. registration of a new user) or editing (e.g. change of password)
    • generate the structure of the website, based on available templates and information from the database, allowing it to be displayed by the client's application

A popular solution used by many application developers is to assign a dedicated application module to perform each of these tasks. Such assumptions are the basis of, among others, probably the most widely used design pattern in web applications called MVC (model-view-controller).

In its case, the controller is responsible for contact with the client's application and management of the entire process of preparing responses, while the subordinated modules: view and model, are responsible for generating the structure of the website and contact with the database.

Is this the end?

Of course not! Many advanced applications actually use other, smaller applications during their operation, exchanging information with them or using the functionality implemented in them. To make this possible, apart from the standard connection between client and server, application developers prepare so-called APIs (application programming interface) - dedicated interfaces allowing to handle queries generated by other applications.

They work in a similar way to the connection between the back-end and the front-end - in order for them to function properly, certain standards need to be defined - a protocol and procedures that allow the two applications to understand each other's questions and answers sent to each other.

Using the API, you can add many off-the-shelf, off-the-shelf solutions to your application, used for example for user identification or making online payments.

The collection of all technological solutions used in a given application - the tools and frameworks used in the back-end and front-end, as well as additional modules connected via APIs - is called the "technology stack".

Examples of stacks used by popular web applications can be found at:

https://stackshare.io/

In the context of web applications, it is also worth mentioning "cookies" - small files stored on the user's device which contain information sent to the server with some of the requests. Thanks to them it is possible, for example, to remain logged in to the application despite closing the browser window - information about the active user is stored in the cookie file and during the next session of connecting to the server it allows to identify the user and to generate a personalised response.

A relatively new trend is the creation of web applications that can be installed on a user's device and operate without a network connection - selected data necessary for the proper functioning of the application are then stored in a cache and synchronised with the server after the connection to the network is restored. One of the precursors of such a solution is Google with its proposal of a new generation of applications - PWA (Progressive Web Application). You can read more about this project on its website:

https://web.dev/progressive-web-apps/

Comments (0)

No comments at this moment