Real-time data is an increasingly popular topic these days. The basic idea is simple: When data in the database changes, any clients viewing the data should see the changes immediately, or in real-time. Gmail and Twitter are great examples of applications that make use of real-time data. Users of these applications don't need to refresh the page to see new email or tweets; instead, new data is pushed to the clients when it becomes available.
Originally, the only way to simulate real-time data in web applications was via some sort of polling from the browser to the web server. This was often complex and difficult to scale. Enter WebSocket, a protocol that provides two-way communication between the browser and web server in a highly efficient manner. The most common way to work with WebSocket is via Socket.IO, a JavaScript library that abstracts away some of the underlying complexity and provides better cross-browser support than native APIs.
No comments:
Post a Comment