Presented by
Abdalla Arbab
The Communication Between Front-End and Back-End
The way our websites work today, they rely on the communication of two parties, the client (web browser), and the server (remote computer). In the process some of the information is being stored permanently or temporarily on the browser and others are being stored on servers with a focus of the availability for this information to the user at any moment.
The organizations and corporations behind the existence of our today’s browsers have always been keeping ways for this communication to occur. And it's the developer’s job to make use of these technologies and determine which method fits best for each case during the process of problem solving building a website.
The process of operating software in servers highly depends on the way we send the information.
The development process require some arrangements between both who are responsible of this connection to occur. Which usually are the front-end developer and the backend developer.
The frontend is everything a user sees and interacts with when they click on a link or type in a web address to open a website.
The web address is also known as URL (Uniform Resource Locator) and it tells which web page should load and appear in your browser.
Backend development deals with the technologies responsible for securely receiving, storing and processing user data.
It’s the part associated with all the hidden logic when users interact with a front-end web page.
Back-end is considered any operation that happens outside of the web browser.
Website basically contains static content. The user of website only can read the content of website but not manipulate it.
Web application is designed for interaction with end users. The user of web application can read the content of web application and also manipulate the data.
The user-agent is any tool that acts on behalf of the user. This role is primarily performed by the Web browser, but it may also be performed by programs used by developers and engineers to debug and test their websites or web applications.
On the hardware side, a web server connects to the internet, which enables it to exchange data or files between other clients that are likewise connected to the internet. This data can come in different forms, such as HTML files, images, JavaScript files, CSS stylesheets ...etc. Web server hardware also stores web server software.
Web server software controls how web users access hosted files. It consists of several components, housing at least an HTTP server. An HTTP server is software that can understand different kind of requests and URLs.
For this communication to happen both front-end and back-kend need to use a standard protocol that’s supported and known by each of them, to make sure the data is being sent in a way both of them are able to understand.
Currently HTTP has many versions v1.0, v1.1, v2.0, v3.0 - Browser support varies https://caniuse.com/?search=http
HTTP is the major method of communication. HTTP is a protocol for fetching resources. It's the foundation of any data exchange on the web.
HTTP is a client-server protocol, that means requests are initiated by the recipient which is usually the client side web browser.
A web request is a communicative message that is transmitted between the client to the servers. This request is essential in providing the user with the correct and preferred webpage and content that then will be displayed on the user’s interface.
Other types of URL schemes can be found here https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
action
and method
attributes which should result into navigating away from the web page to the action
URL.XMLHttpRequest is technology that is used to transfer data between a server and a client without refreshing the whole web page. It can send and receive information in various formats, including JSON, XML, HTML, and text files.
Server-sent events are a push technology that allows the client to receive data automatically from the server through an HTTP connection after an HTTP connection has been established between the server and the client, the server then can send automatic updates. SSEs are unidirectional, so they allow sending data from the server to the client only.
WebSocket is a communication protocol that provides bidirectional communication channels. A WebSocket connection starts as a normal HTTP connection which then is upgraded to a WebSocket connection through the WebSocket handshake. The client can send data to the server and the server can also send data back to the client.
XMLHttpRequest | Server-Sent Events | WebSocket | |
---|---|---|---|
Request streaming | no | no | yes |
Response streaming | limited | yes | yes |
Framing mechanism | HTTP | event stream | binary framing |
Binary data transfers | yes | no (base64) | yes |
Compression | yes | yes | limited |
Application transport protocol | HTTP | HTTP | WebSocket |
Network transport protocol | TCP | TCP | TCP |
Streaming is a technique that allows a web server to continuously send data to a client (or vice versa) over a single connection that remains open indefinitely
Binary framing is breaking the communication between the client and server into small chunks and creates an interleaved bidirectional stream of communication.
An API, or application programming interface, is a set of rules that define how applications or devices can connect to and communicate with each other.
There are five methods that are commonly used in a REST-based Architecture i.e., POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations respectively. There are other methods which are less frequently used like OPTIONS and HEAD.
GraphQL is a query language and server-side runtime for application programming interfaces (APIs) that prioritizes giving clients exactly the data they request and no more.
It's designed to make APIs fast, flexible, and developer-friendly. As an alternative to REST, GraphQL lets developers construct requests that pull data from multiple data sources in a single API call.
gRPC is a robust open-source RPC (Remote Procedure Call) framework used to build scalable and fast APIs. It allows the client and server applications to communicate transparently and develop connected systems. Many leading tech firms have adopted gRPC, such as Google, Netflix, IBM. This framework relies on HTTP/2, protocol buffers, and other modern technology stacks to ensure maximum API security, performance, and scalability.
https://www.freecodecamp.org/news/frontend-vs-backend-whats-the-difference/
https://www.geeksforgeeks.org/difference-between-web-application-and-website
https://iq.opengenus.org/types-of-client-server-communication/
https://sourcedefense.com/glossary/web-request/
https://hpbn.co/primer-on-browser-networking/
https://www.hostinger.com/tutorials/what-is-a-web-server
https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
https://mulloverthing.com/what-protocols-do-browsers-support/
https://blog.logrocket.com/server-sent-events-vs-websockets/
https://www.cloudflare.com/learning/serverless/glossary/client-side-vs-server-side/
- How DNS Work
http://howdns.works/
- What is HTTPS
https://howhttps.works/
- Push vs Polling vs Long Polling
https://hvalls.dev/posts/polling-long-polling-push/
- HTTP Push vs HTTP Pull
https://medium.com/@intmainco/http-push-and-pull-introduction-nlogn-c726c012662