Keeping it Real(time)

By: Mike Lehan

As people carry out more of their daily interactions online, giving them the best experience possible is our key focus as web software engineers. One way we can do that is providing views which can update dynamically as information changes – train times that adapt to delays without a page refresh, new comments on social media items engaging users by appearing in real time, bids on ecommerce websites updating as the market changes. It’s not just chat apps that can benefit from real time components.

Websockets allows a persistent 2-way connection between client and server that you can use to adapt faster to changing data. WebRTC provides a universal API for two browsers to establish a direct link, no servers involved (sort of ) to stream audio, video or files direct.

In the talk we’ll walk through where these real time services come from, and what you can use them for. We’ll look at client and server side APIs, including the popular PHP event library React and PHP Websocket client Ratchet. We’ll drill into the difference between 2-way interactions and existing so-called dynamic web technologies like AJAX, and explore how real-time event based protocols could take on a lot of what we presume only HTTP can do. Finally we’ll see some common pitfalls when integrating both Websockets and WebRTC into your own applications, including monitoring, logging and 3rd party tools.