Real-time web applications
Take a look through the window and see the world around you, full of information, images, words and other content. Now imagine that you’d have to refresh the view to see something new. If you forgot to do that, further life could have turned out its course. So think how much you could miss.
The situation is similar in the case of websites and applications we see on the Internet every day. Especially those services where the quick access to the information is very important. You do not need to look far for instance. Let’s take as an example the information portals that provide data from important events, articles, and comments. Why trying to check whether there are any new information you need to refresh your browser? In addition to making money from ads, there is one more important reason. Unawareness that can be otherwise.
But let start from the beginning
What are the real-time applications? The definition used in higher education is quite complex. Probably if we added to that a couple of clever diagrams and formulas, you would already stop to read this. For our purposes, because we are talking about the Internet, we specify this as a service that provides content to the user automatically when you make changes on the server side. Eg. The editor / administrator adds a new blog post, and we immediately see it and can it enter into full interaction with it. When editor finds a typo, changes it and our viewer immediately received the correct content. So there is a good chance that no one noticed the error, because the site itself has changed the content without reloading.
So why all sites are not built this way?
This question is quite complex, but the simplest reason, so far were just costs. The creation of such an application yourself would involve the preparation of multiple layers of logic in our application (for example mobile):
- HTML Templates
- App Login
- Reactive UI update system
- Native container
- Speculative client-side updates
- Client-side data store
- Custom data sync protocol
- Real-time database monitoring
- Build & update system
- Language Runtime
As you can see, this would require a lot of work and a team of developers would have a real job and a few weeks “booked” only for this issue. Fortunately, it is 2016 and we can use well known websockets and ready-made solutions such as socket.io, MeteorJS, Angular and Apollo. The last of them gives a lot of support for languages such as Ruby On Rails and Oracle databases, SQL Server.
Here in Cat in Black Software house we would not be ourselves if we won’t check MeteorJS. As seen in the above example, the number of layers to build real-time applications is huge. How does it look is the case of such framework?
- HTML Templates
- App Login
That’s it. Almost everything we can get from the package and the whole “thing” works almost immediately.
Since we already know that using specific technology solutions we can reduce costs of creating a real-time web application, it is worth to consider this option.
Let’s try to discuss a dynamic information service, where user enters the website that contains the news from his city, from around the world. He / she reads an article, and suddenly new related article appears. Thus he / she can go straight to that content. Without this user probably either leave the site or move to another section without noticing important information.
The same user on a different day re-enters the page to find the latest information on a subject, but something pulled his attention and temporarily so he abandons a page but leaves it in other browser tab.
At the same time, few interesting news appears. User will see them when he’s back on that tab. Likewise, if he was involved in an interesting conversation and commented on the article. The answers of other users will appear to him automatically without additional notifications.
Similarly, when the user accesses the page to search for reports from important events or meetings. Very often, these reports can be found as a single article, which is edited from time to time. This solution creates a kind of timeline that allows newcomer users to check what they have missed. But once again, to see the new content you need to reload the page. In the case of real-time applications even ordinary changes in the article, will be connected with the fact that the browser itself updates the content. As a result, not only do we have the feeling, but we really participate in reports conducted live in text form. It’s as if we watched the news live on television from the scene.
Imagine to have the possibility of showing notifications (with the consent of user) on the “desktop” of your computer, or the turning on of vibrations on the phone when new content appears, and we have perfect service. When we use solutions such as Meteor, this is not problematic in any way.
If you are planning to build a site or portal, you should consider as soon as possible whether it isn’t a good idea to use technology giving access to dynamic content. Imagine what possibilities this technology give for cantors, calculators, forums, information, or even pages, not to mentioning mobile applications.
Remember also, that access to dynamic content affects very positively to attract the end-user, and gives us greater control over displayed content.