How do the frontend and backend communicate with each other?

retrocanvas

New member
Frontend-backend communication is defined by two main technologies.
  1. HTTP communication
This is the conventional means of communication between the frontend and backend. In this example, the frontend, which is the browser, sends an HTTP request to the server, which then responds with the requested information. The database is generally searched for pertinent information during server-side communication. Repeated HTTP queries, on the other hand, can be time demanding. As a result, programmers have designed a new client-server communication model.
  1. AJAX communication
AJAX stands for Asynchronous JavaScript And XML, and it's a client-server communication technology that aims to speed up interactions. Each time a server communication occurs in AJAX, the entire webpage is not reloaded. Instead, only the reloadable component of the webpage is updated asynchronously using XML. Of course, JSON messages are now widely used. However, the two modes of communication mentioned above are not the only ones used by the frontend and backend today. The gap between the two ends of a website is slowly closing thanks to advances in technology.
  1. Isomorphic apps
Apps that may be rendered wholly on the client-side as well as the server-side are known as client-side apps. The apps in this architecture communicate with the server and the client via HTML and AJAX.
  1. Standalone frontends
These programs, also known as progressive web apps, can be loaded once from the backend and then executed wholly in the frontend. The browser may load and operate all program components, including the database. The majority of the logic is also incorporated in the frontend, with only little backend connectivity required for updates.

Lightweight backends
Backends are becoming lighter than ever thanks to graph databases and document stores. Sqlite, for example, is a database server that runs solely on the client. Endpoint systems are used to offload server-side processing in these applications. As a result, website processing efficiency improves.
 
D

Deleted member 28127

Guest
Not all the technologies are using AJAX or DOM it is the case of Visual C# applications which leads to a desktop application. Or Dark which leads to Android or IOS applications.
 

moonchild

VIP Contributor
Depending on the type of the technology that you use, if you use graphQL or other query language, method of communication between frontend and backend might change, also you can create a REST Api and consume the endpoints through fetch API, Ajax is also a ideal way to connect the both ends.

what stands out is the two type of connection between frontend and backend which are known as 1) Monolithic and 2) Decoupled, Monolithic is when you write your backend in your frontend, making use of ajax to call your endpoints, these is common with server side languages like PHP and on the other hand we have the decoupled interaction, where you build a stand alone backend using REST API and then consume through end points, this is easier for both developers and it is also more neater and easier to maintain because it is mostly plug and play from the frontend.
 

MayaBright

New member
The frontend and backend communicate with each other through an Application Programming Interface (API). The API is a set of protocols, routines, and tools that allow two applications to communicate with each other. The frontend sends requests to the backend, which then processes the requests and sends back the appropriate response. The API also allows the frontend and backend to exchange data, such as user input, in a structured format.
 
Top