Does the front and back end of non-instant messaging app, use http interaction or socket??

socket, put the request in the redis queue, even if the background hangs, it can be executed after the service reply, but some daily requests that are asynchronous will pile up in the queue. In http"s words, Synchronize returns success and failure. Which one should I use to describe the ~-sharp-sharp-sharp problem

Feb.14,2022

look at the usage scenario. If you use socket , you can actively notify app when there is a data update at the backend. Using http requires regular polling of backend APIs but is easy to use.

non-instant messaging app is still recommended to use socket to get user messages. Reason:

  1. avoid heavy query pressure caused by frequent requests. http request method will exert greater pressure on DB when concurrent queries. socket can take turns to process messages, and the initiative is at the backend
  2. .
  3. when the network is poor, socket is easier to use than http . In the case of poor network, http three-way handshake is very slow. Carelessness will cause requests to pile up
  4. .
  5. it is very convenient to count the number of people online
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e47865-4c347.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e47865-4c347.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?