K
K
Konstantin2020-03-24 17:05:26
Node.js
Konstantin, 2020-03-24 17:05:26

Websocket for a page or for the entire site?

Hello. I decided to learn Node.js and rewrite my online store from php to node.js + express.js. Along the way, there is an idea to implement a real-time basket. The essence of such a basket is that it is a kind of "room" for the manager and the client. Client access is provided via the link. It is necessary that the client sees all the changes in this virtual basket without reloading the page. The manager throws the goods for the client, and at the end he can place an order by clicking the button to place an order.

But the essence of the matter is different. Since the site has a flow of customers and it is increasing. Will websocket + site take out together? If not, all of a sudden, is it possible to somehow raise a web socket for one page, and the rest would work without a bunch.

I hope it's not hard to explain. Thank you for your attention

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleh, 2020-03-26
@linkinkov

Do you have RPS metrics and overall metrics? Without them, it's stupid to give recommendations, but in 99% socket.io will take out your "highload". Moreover, socket processing is not entirely related to the tasks of the site, they have a different context.
Summarizing, I can say for sure that the load will not be as significant as you think. Unless you store socket subscription data not in LRU (memory), but immediately use redis, memcache, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question