A query table every second for notification. Is this a good practice?

I have a project with notification features, and I figured out how to get a real-time notification. My idea is to query the table every second. I have a notification table, so whenever a client adds something, it will be inserted into the notification table, and then another client receives a notification requesting it. I am using ajax for this.

Is it good to query the table every second or bad programming practice? I use this only in localhost, and that is normal. Can such an idea negatively affect the site?

in advance for your answers.

+4
source share

Source: https://habr.com/ru/post/1526564/


All Articles