R
R
Roman Korolyov2019-01-27 18:06:25
Node.js
Roman Korolyov, 2019-01-27 18:06:25

Socket IO how to implement connection to Mysql?

Friends, hello.
I'm learning websocket, so far I just started, so all the skills that I have add up to a simple chat. I analyzed various projects that work with real time mode and found that they use a database connection and send this data to the client.
For example:
upx . cash ( lottery site )
nvuti . live (table with games)
Question:
How can I implement getting data from the database in Socket IO and updating the table? (On the sites that are above, femmes fly every second, and they come from the database)
As I think:
1) Connect to the database in the node
2) send this data to the socket
But how to send it constantly so that performance does not suffer

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2019-01-27
@VitteDev

But how to send them constantly so that performance does not suffer

learn to store data correctly in the database and use indexes, partitions, etc.
https://ru.wikipedia.org/wiki/%D0%9D%D0%BE%D1%80%D...
https://ru.wikipedia.org/wiki/%D0%98%D0%BD% D0%B4%D...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question