In this article, we will talk about what chats and instant messengers are.
In this case, we created a chat for the consulting company BST Consulting , which offers its users online lessons. We have also developed the entire tutorial project, but in this article we are only focusing on the chat.
Examples of using AJAX in applications and websites:
- When adding a product to the cart, your page does not reload, while the added product appears in it;
- Correspondence in a messenger, for example Telegram. You send a message to the interlocutor and he receives it in the same second and without reloading the page.
- Entering a word in a Google search engine and issuing similar options and without the need to refresh the page.
Highly loaded messengers like Telegram, Viber use server requests with a frequency of 20-30 milliseconds to receive an instant response from the interlocutor. Such an algorithm is justified for the convenient use of the program, but it loads the server capacity very heavily due to continuous requests.
Therefore, for BST Consulting, we deliberately limited the frequency of server requests to 10 seconds. Chat is not a key tool for this project and the frequency of use of the system is quite low. But if the number of users grows from 100 people per month to 10 thousand people / month, then we will reduce this request to 2 seconds and transfer the project to a more powerful server.