How to transform the architecture based on Rest polling into the real-time push mechanism of websocket?

item is a digital currency quotation query APP.

the previous architecture is: front-end-- php-- (mysql)-- nodejs-- exchange API. What the exchange provides here is the webscoket interface, which is stored in the database after receiving the data through node. The front end polls every 5 seconds to obtain database data through the Restful API provided by PHP.

now we want to change to the front end to accept the data pushed by the third party in real time. Do you have any good suggestions?

it should be noted that there are dozens of docking exchanges, for example, each exchange will push the real-time price of bitcoin, and the front end may be the "real-time price" of these prices calculated by a certain algorithm. in addition, it is necessary to present some high-level data calculated from the original data of the exchange, so it is necessary to keep it in the database.

Menu