You are on page 1of 1

ABC plans to use Socket.IO for real-time updates on a live dashboard.

On the client-side, React may be used for its efficient UI rendering. While real-time updates can be
implemented without React, using WebSockets with Socket.IO is likely more efficient for a live dashboard that requires real-time updates. AJAX can be used for parts of the
application that don’t require real-time updates.
-----------------------------------------------------------------------------------------------------------------------------------
Server-side (Socket.IO): The server-side application is set up with Socket.IO to listen for changes in the underlying data. When a change occurs, the server emits a message
through a socket connection. This message contains the updated data.

Client-side (JavaScript): On the client-side, your JavaScript application maintains a socket connection with the server. It listens for messages from the server through this
socket connection.

Data Flow: When the server emits a message (due to a change in data), the client’s socket connection receives this message. The JavaScript application then updates its state
(you can use variables in JavaScript to keep track of state) with the new data received from the server.

if client is doing any interaction with website then api for get and

UI Update: You can then use JavaScript to manipulate the DOM and update your webpage with the new data.
----------------------------------------------------------------------------------------------------------------------------------------------
working of socket.io
Socket.IO enables real-time communication between a server and its clients using WebSockets.
It falls back to other methods if needed. Both can emit and listen for events, allowing real-time data exchange. An open WebSocket connection allows instant messaging. When
the server database updates, it emits an event, and the clients update their front-end data in response.
----------------------------------------------------------------------------------------------------------------------------------------------
dynamic data loading
Socket.IO enables real-time communication between a server and its clients using WebSockets. It falls back to other methods if needed. Both can emit and listen for events,
allowing real-time data exchange. An open WebSocket connection allows instant messaging. When the server database updates, it emits an event, and the clients update their
front-end data in response.
----------------------------------------------------------------------------------------------------------------------------------------------
high level archtitecture of my website

database is accessed through api..so we can use socket in db also..wheneever there is change in data ...it will tell server and send it back to clinet

You might also like