Nine application scenarios using WebSockets Technology

Source: Internet
Author: User

No other technology can provide real two-way communication like WebSocket, and many web developers still rely on ajax long polling. Lack of enthusiasm for Websocket may be due to its fragile security, or lack of browser support. In any case, these two problems have been solved.

 

It's easy to decide whether to use WebSocket Technology for the job at hand:

  • Does your application provide communication between multiple users?
  • Is your application displaying frequently changed data on the server?

If your answer is yes, consider using WebSocket. If you are still unsure and want more inspiration, there are some killer cases.

1. Social subscription

One benefit to social networking applications is the ability to instantly know what your friends are doing. Although it sounds terrible, we all like this. You don't want to know the news about a family member winning the pie contest or getting engaged by a friend in a matter of minutes. You are online, so your subscription update should be real-time.

2. multi-player games

The network is rapidly becoming a gaming platform. Without using plug-ins (I am referring to Flash), network developers can now implement and experience high-performance games in browsers. Whether you are dealing with DOM elements, CSS animations, HTML5 canvas, or trying to use WebGL, the interaction efficiency between players is crucial. I don't want my opponent to move after I trigger the trigger.

3. Collaborative Editing/programming

We live in the era of distributed development teams. You can use a copy of a document to meet your work requirements. However, you need to merge all the edited copies. Version control systems, such as Git, can help process certain files, but when Git finds a conflict that it cannot solve, you still need to track people's modification history. Through a collaborative solution, such as WebSocket, we can work in the same document to save all merged versions. This makes it easy to see who is editing or who you are modifying the same part of the document at the same time.

4. Click Stream Data

Analyzing the interaction between users and your website is the key to improving your website. The HTTP overhead allows us to prioritize and collect the most important data. Then, after six months of offline analysis, we realized that we should collect a different judgment criterion-a decision that seems not so important, but now affects a key decision. Compared with the HTTP request overhead mode, you can use Websocket to send unrestricted data by the client. Want to track the movement of the mouse in addition to page loading? You only need to send the data to the server through the WebSocket connection and store it in your favorite NoSQL database (MongoDB is suitable for recording such events ). Now you can play back the user's actions on the page to clearly understand what happened.

5. stock fund quotation

The financial sector is changing-almost every millisecond. Our human brain cannot process so much data at that speed, so we have written algorithms to help us deal with these things. Although you are not necessarily dealing with high-frequency transactions, outdated information can only cause losses. When you have a display disk to track companies you are interested in, you certainly want to know their value at any time, rather than the data 10 seconds ago. You can use WebSocket to update the changes without waiting.

6. Sports status update

Now let's start to discuss a stupid thing that inspires people-sports. I am not a sports enthusiast, but I know what sports fans want. When the patriot is playing the game, my brother-in-law will be immersed in this game and cannot extricate themselves. It is a crazy and full of heart. Although I don't understand this, I admire the strong connection between them and sports. So what I can do at last is to reduce the latency in his experience. If you include sports news in your website application, WebSocket can help your users get real-time updates.

7. Multimedia chat

Video conferencing cannot be used to meet real people, but it is a good choice when you cannot see your conversation objects in the same room. Although video conferences are doing a good job in privatization, they are still cumbersome to use. I am a fan of open networks, so using the WebSockets getUserMedia API and HTML5 audio and video elements is obviously a good choice. The appearance of WebRTC is a combination that I just summarized. It looks promising, but it lacks the support of the current browser, so it is disqualified as a candidate.

8. location-based applications

More and more developers use the GPS feature of mobile devices to implement their location-based network applications. If you keep recording the user's location (such as running an application to record the motion track), you can collect more detailed data. If you want to update the network data dashboard in real time (a coach monitoring athletes), the HTTP protocol looks clumsy. You can use the WebSocket TCP link to fly data.

9. Online Education

School costs are getting more expensive, but the Internet is getting faster and cheaper. Online education is a good way to learn, especially when you can communicate with your teachers and other students. Naturally, WebSockets is a good choice for multimedia chat, text chat, and other advantages, such as working with others to draw on the public digital blackboard...

Original article address: 9-killer-uses-websockets-230771? Page = 0, 1

Link: http://www.cnblogs.com/oooweb/p/9-killer-uses-websockets.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.