Author Archive

Spotlight Article: 5 Protocols For Event-Driven API Architectures

In this article, Kristopher Sandoval discusses 5 common-event driven APIs methods (WebSockets, WebHooks, Rest Hooks, Pub-Sub, and Server-Side Events):

The internet is a system of communication, and as such, the relationship between client and server, as well as server to server, is one of the most oft-discussed and hotly contested concepts. event-driven architecture is a methodology of defining these relationships, and creating systems within a specific set of relationships that allow for extensive functionality.

In this piece, we’re going to discuss 5 common event-driven methods — WebSocketsWebHooksREST HooksPub-Sub, and Server Sent Events. We’ll define what they fundamentally are and do, and how API providers go about using them. Additionally, we’ll provide some pros and cons on each to make choosing a solution for your platform easy and intuitive.

Full Article

Android Realtime Resources

This section highlights the realtime resources available for Android developers.


Blurimageview – BlurImageView, you can load your image progressively like Medium does. First show user a blurry image, At the same time, load the real image, once loaded, replace the blurry one automatically.

Android Chat SDK – Android Real Time Chat & Messaging SDK. Open source Android Chat SDK / Messaging SDK that lets you add real time chat and in-app messaging in your mobile (android, iOS) applications and website. Signup at https://www.applozic.com/signup.html to get the application key. Applozic One to One and Group Chat SDK.

Simple Chat – The best room chat system for Android. Real-time, IRC Style using firebase as database. We bring you a super simple room style chat that you can use in your apps and let the users communicate between themselves and/or with you.

μlogger – Android application for real-time collection and publishing of geolocation data. μlogger [micro-logger] is an android application for continuous logging of location coordinates, designed to record hiking, biking tracks and other outdoor activities. Application works in background. Track points are saved at chosen intervals and may be uploaded to dedicated server in real time. This client works with μlogger web server. Together they make a complete self owned and controlled client–server solution.

Sinch: Make app-to-app calls to a real-time list of online users – In this tutorial, you will build a calling app that displays a real-time list of online users, and only allows calls to and from those online users. You will use Sinch app-to-app calling to make the calls, and PubNub presence detection to create a real-time list of online users.

Messaging Android Chat: Android real-time group chat using Realtime Messaging (includes FCM push notifications) – Part of the The Realtime® Framework, Realtime Cloud Messaging (aka ORTC) is a secure, fast and highly scalable cloud-hosted Pub/Sub real-time message broker for web and mobile apps. If your website or mobile app has data that needs to be updated in the user’s interface as it changes (e.g. real-time stock quotes or ever changing social news feed) Realtime Cloud Messaging is the reliable, easy, unbelievably fast, “works everywhere” solution.


Specs

  • Author: Ashraff Hathibelagal
  • Date: October 2016

Resources

Synopsis

With Firebase, creating real-time social applications is a walk in the park. And the best thing about it: you don’t have to write a single line of server-side code. In this tutorial, I’ll show you how to leverage Firebase UI to create a group chat app you can share with your friends. It’s going to be a very simple app with just one chat room, which is open to all users. As you might have guessed, the app will depend on Firebase Auth to manage user registration and sign in. It will also use Firebase’s real-time database to store the group chat messages.


Build a real-time Android application with PHP and Java

Specs

  • Quora Question
  • Date: July 2017

Resources 

Synopsis

Answer: For realtime updates, you’ll need the client app to keep open a long-lived connection to your backend server. This way, when you want to push data to the client, you can send it instantly over the existing connection. There are a number of ways you can do this. WebSockets, delayed HTTP responses (streaming or long-polling), and MQTT are common choices. I created an open source project to help with implementing long-lived connections, called Pushpin. Another option is Ratchet (assuming you’re using PHP on the server side). Note that a mobile app may not always be able to maintain a connection to the server, for example if it’s been put in the background or if it’s not running at all. To send notifications to the app or wake it up, you’ll need to send through Google’s FCM/GCM service.


Retrieving real time data in Android

Specs
  • Author: Shravan I.V.
  • Date: December 2016

Resources

Synopsis

In today’s digital economy, most of our interactions, such as streaming stock exchange news, weather reports or news updates, occur in near real-time. The need for real-time data is shaping the way technology and markets are evolving currently. While the mobility trend and Android usage have grown over the past decade, combining mobility with real-time data will open up a plethora of opportunities to explore. Firebase is one cloud based platform that has great support for dealing with real-time data when it comes to Android. In this article, I will explain how to integrate Firebase with your app in Android Studio, with an illustration.


Realtime Infrastructure Services

  • Realtime API Infrastructure – Realtime API infrastructure specifically allows developers to build realtime data push into their existing APIs.  Typically, you would not need to modify your existing API contracts, as the streaming server would serve as a proxy. The proxy design allows these services to fit nicely within an API stack. This means it can inherit other facilities from your REST API, such as authentication, logging, throttling, etc. It can be combined with an API management system.  In the case of WebSocket messages being proxied out as HTTP requests, the messages may be handled statelessly by the backend. Messages from a single connection can even be load balanced across a set of backend instances.
    • Fanout/Pushpin – Fanout is a real-time API development kit that helps you push data to connected devices easily. Fanout is a cross between a reverse proxy and a message broker. Pushpin is the open source version.
    • Streamdata.io – Streamdata.io a SaaS API proxy tool that converts standard API requests into a streaming API. In other words, it provides a proxy as a service for any HTTP API by polling and acting as a streaming API.
    • LiveResource – LiveResource is a protocol specification and JavaScript reference library for receiving live updates of web resources. It has the following principles:
  • Realtime Application Infrastructure – Realtime app infrastructure sends data to browsers and clients. It typically uses pub/sub messaging, webhooks, and/or websockets — and is separate from an application or service’s main API.
    • Firebase – Firebase is a BaaS (Backend-as-a-Service) that allows developers to create web applications with no server-side programming required.
    • Pubnub – PubNub is a programmable Data Stream Network (DSN) and realtime infrastructure-as-a-service (IaaS) company. Primarily, they are a messaging solution hosted on a cloud service that allows developers to publish data instantly to one or multiple devices.
    • Pusher – Pusher is a hosted service that allows developers to add realtime bi-directional functionality via WebSockets (with HTTP-based fallbacks) to the web and mobile apps.
    • Ably – Ably is a realtime data delivery platform that provides creators the tools to create, deliver, and manage projects. Their main realtime functionality consists of pub/sub, presence, authentication, encryption, and connection state recovery.

iOS Realtime Resources

This section highlights the realtime resources available for iOS developers.


Quick Chat for iOS: Real time chat app written in Swift 3 using Firebase – Quick Chat for iOS is a real time chat app based on Firebase developed by Haik Aslanyan and written in Swift 3. Quick Chat allows to send and receive text messages, photos & location.

Applozic-iOS-SDK: iOS Real Time Chat & Messaging SDK – Open source iOS Chat and Messaging SDK that lets you add real time messaging in your mobile (android, iOS) applications and website. Signup at https://www.applozic.com/signup.html to get the application key. Works for both Objective-C and Swift. It is a light weight Objective-C Chat and Messenger SDK. Applozic One to One and Group Chat SDK.

EZAudio – An iOS and macOS audio visualization framework built upon Core Audio useful for anyone doing real-time, low-latency audio processing and visualizations. EZAudio has recently been deprecated in favor of AudioKit. However, since some people are still forking and using EZAudio I’ve decided to restore the README as it was. Check out the note below.

Traits – Modify your native iOS app properties in real time – Traits allows you to modify the design and behavior of native iOS apps without having to restart them, even across the globe. Wouldn’t it be great if we could adjust designs of our native apps without having to sit back to Xcode, change code, recompile and navigate back to the screen we were at? Traits is a library that provides you the ability to change many properties of your apps (not only design) without having to recompile the application, even via network across the globe.

Snsrlog: An iOS app to view, record and stream sensor data in real-time – During the recording of movements, one can label the data so that it’s easy to distinguish the different parts of a signal at a later point. Furthermore, the sensor data can be streamed (via WiFi or Bluetooth) to another device running snsrlog, so that labeling can be performed remotely.

Realtidsinfo – Displays time left to SL departures for a bus stop, in realtime.

Messaging Swift 3 Chat: The Swift 3 chat example + iOS rich push notifications – This sample app built using the Swift 3 language uses the Realtime® Framework Messaging service to send and receive chat messages organized into groups (includes iOS 10+ Rich Push Notifications support).


Real-Time Communication with Streams Tutorial for iOS

Specs

  • Author: Luke Parham
  • Date: July 2017

Resources

Synopsis

But what about when you want the server to be able to tell your app about something? Doing so doesn’t really map to HTTP very well. Of course, you can make it work by continually pinging the server and seeing if it has updates, aka polling, or you can get a little more crafty and use a technique like long-polling, but these techniques can feel a little unnatural and each has its own pitfalls. At the end of the day, why limit yourself to this request-response paradigm if it’s not the right tool for the job?
In this streams tutorial, you’ll learn how you can drop down a level of abstraction and use sockets directly to create a real-time chatroom application.


RealmContent: Add Real-time Updates to your iOS App in 5 Min

Specs

  • Author: Marin Todorov
  • Date: July 2017

Resources: 

Synopsis:

The best aspect of using RealmContent is that you can modify the displayed content at any time – all changes will be synchronized in real-time to all connected users. (And upon connecting for all users who aren’t connected in this very moment of course.) You can easily use the Realm Browser app to add or remove new pages, add, re-arrange, and otherwise modify blocks of content, and more. You can even change the accent color of your headings and links.


Build A Real-Time Chat App With Firebase And Swift

Specs

  • Author: Reinder de Vries
  • Date: June 2017

Resources

Synopsis

In this guide, you’re going to build a chat app for iOS with Xcode 9, Swift 4 and Firebase. When you’re done, you can chat real-time with multiple users! Firebase is perfect for a chat app. It’s easy to use, can store a ton of data, and you can observe data changes in real-time! This app can serve as the foundation for your own messaging app, like iMessage, or you can follow along as a learning project. Ready to get started? Here’s a quick overview of the steps:


Realtime Infrastructure Services

  • Realtime API Infrastructure – Realtime API infrastructure specifically allows developers to build realtime data push into their existing APIs.  Typically, you would not need to modify your existing API contracts, as the streaming server would serve as a proxy. The proxy design allows these services to fit nicely within an API stack. This means it can inherit other facilities from your REST API, such as authentication, logging, throttling, etc. It can be combined with an API management system.  In the case of WebSocket messages being proxied out as HTTP requests, the messages may be handled statelessly by the backend. Messages from a single connection can even be load balanced across a set of backend instances.
    • Fanout/Pushpin – Fanout is a real-time API development kit that helps you push data to connected devices easily. Fanout is a cross between a reverse proxy and a message broker. Pushpin is the open source version.
    • Streamdata.io – Streamdata.io a SaaS API proxy tool that converts standard API requests into a streaming API. In other words, it provides a proxy as a service for any HTTP API by polling and acting as a streaming API.
    • LiveResource – LiveResource is a protocol specification and JavaScript reference library for receiving live updates of web resources. It has the following principles:
  • Realtime Application Infrastructure – Realtime app infrastructure sends data to browsers and clients. It typically uses pub/sub messaging, webhooks, and/or websockets — and is separate from an application or service’s main API.
    • Firebase – Firebase is a BaaS (Backend-as-a-Service) that allows developers to create web applications with no server-side programming required.
    • Pubnub – PubNub is a programmable Data Stream Network (DSN) and realtime infrastructure-as-a-service (IaaS) company. Primarily, they are a messaging solution hosted on a cloud service that allows developers to publish data instantly to one or multiple devices.
    • Pusher – Pusher is a hosted service that allows developers to add realtime bi-directional functionality via WebSockets (with HTTP-based fallbacks) to the web and mobile apps.
    • Ably – Ably is a realtime data delivery platform that provides creators the tools to create, deliver, and manage projects. Their main realtime functionality consists of pub/sub, presence, authentication, encryption, and connection state recovery.

Javascript Realtime Resources

This section highlights the realtime resources available for Javascript developers.


Realtime Javascript Libraries

Horizon: Realtime, open-source backend for JavaScript apps – Horizon is an open-source developer platform for building sophisticated realtime apps. It provides a complete backend that makes it dramatically simpler to build, deploy, manage, and scale engaging JavaScript web and mobile apps. Horizon is extensible, integrates with the Node.js stack, and allows building modern, arbitrarily complex applications.

Gun: A realtime, decentralized, offline-first, graph database engine – GUN is a realtime, distributed, offline-first, graph database engine. Doing 20M+ ops/sec in just ~9KB gzipped.

Smoothie Charts: smooooooth JavaScript charts for realtime streaming data – Smoothie Charts is a really small charting library designed for live streaming data. I built it to reduce the headaches I was getting from watching charts jerkily updating every second.

GeoFire for JavaScript: Realtime location queries with Firebase – GeoFire is an open-source library that allows you to store and query a set of keys based on their geographic location. At its heart, GeoFire simply stores locations with string keys. Its main benefit, however, is the possibility of retrieving only those keys within a given geographic area – all in realtime.

Lip: Realtime Message Bus for the Web. Javascript Implementation – This is Jet for Javasript. Jet is the hybrid of an In-Memory Database and a Realtime Push-Framework. Node and Browsers are supported (using Browserify).

FireEdit: A real-time text editor which allows programmers work simultaneously – A real-time editor built with JavaScript and Firebase. Real-time collaboration is enhanced by Firebase. Access the editor, personalize it by naming it and by choosing the theme your prefer, share the URL and start the collaboration. A complete tutorial which explains step by step how this application has been created is available here.

Reactivemaps: A data aware UI components library for building realtime maps – Reactivemaps is a React based components library for building realtime maps. It is built on top of the appbase.io realtime DB service and ships with 20+ components for Lists, Dropdowns, Numeric Range, Sliders, Data Search, Places Search, Distance Slider and Dropdowns, Calendars, Feeds and Maps.

Chimp: Develop acceptance tests & end-to-end tests with realtime feedback – An awesome developer-centric experience to writing tests with realtime feedback using Mocha, Jasmine or Cucumber.js. Chimp can be used with any technology stack as it allows your to write your test automation in the language of the web: JavaScript.

Bitlistein: Realtime Bitcoin transaction visualizer – Current version hosted at BitListen.com. Project formerly known as “Listen to Bitcoin” (ListenToBitcoin.com has been sold.) Realtime Bitcoin transaction visualizer written in HTML/Javascript. See and hear new transactions and blocks as they propagate through the Bitcoin Network.

Skypad – Simple, real time collaborative notepad on the cloud. Handy – Create a pad instantly. Simple UI – Neat, undistracting and responsive. Easy Sharing – Share by URL, Twitter or FB. Collaboration – Real time sync across all platforms. Auto Save – Changes saved on the cloud automatically. Syntax Highligting – Support JavaScript, C, HTML and CSS. More comming.


FireEdit: Realtime Editor with Javascript & Firebase

Specs

  • Author: Johnny B.
  • Date: February 2017

Resources

Synopsis

I’ve always been excited about real-time applications on the web. A few years ago, my first attempts consisted of implementing recurring requests, which would eventually fetch information from the server simulating real-time behavior. It worked, but it wasn’t efficient. Since then, I’ve learned about web sockets.

I heard developers talking about something called Firebase. Recently, Emma — a good friend, fellow programmer, and amazing human being — needed help with Firebase, and we decided to learn it together.

Now, we are not experts, but since we are good enough at it, we thought we’d show you how to build an app using Firebase and JavaScript — specifically, a real-time text editor which lives in your browser.


HTML5 & Javascript Dynamic Charts

Specs

  • CanvasJS
  • 2013

Resources

Synopsis

CanvasJS allows you to create dynamic charts that update at a given interval. Dynamic charts are useful in displaying data that changes with time like stock price, temperature, etc. Dynamic updates are supported by all chart types including line, area, column, bar, pie, etc. Below are some examples of HTML5 & JavaScript based dynamic charts. Dynamic charts are also referred to as live charts or real-time charts. Examples include source code for all the graphs.


Real-time Web Applications with Stratified Javascript

Specs

  • Author: Alexander Fritze
  • July 2014

Resources

Synopsis

Alexander Fritze shows how to build real-time web app with Conductance, a web app server built on Stratified JavaScript which includes support for modularity and composability of asynchronous code.


Realtime Infrastructure Services

  • Realtime API Infrastructure – Realtime API infrastructure specifically allows developers to build realtime data push into their existing APIs.  Typically, you would not need to modify your existing API contracts, as the streaming server would serve as a proxy. The proxy design allows these services to fit nicely within an API stack. This means it can inherit other facilities from your REST API, such as authentication, logging, throttling, etc. It can be combined with an API management system.  In the case of WebSocket messages being proxied out as HTTP requests, the messages may be handled statelessly by the backend. Messages from a single connection can even be load balanced across a set of backend instances.
    • Fanout/Pushpin – Fanout is a real-time API development kit that helps you push data to connected devices easily. Fanout is a cross between a reverse proxy and a message broker. Pushpin is the open source version.
    • Streamdata.io – Streamdata.io a SaaS API proxy tool that converts standard API requests into a streaming API. In other words, it provides a proxy as a service for any HTTP API by polling and acting as a streaming API.
    • LiveResource – LiveResource is a protocol specification and JavaScript reference library for receiving live updates of web resources. It has the following principles:
  • Realtime Application Infrastructure – Realtime app infrastructure sends data to browsers and clients. It typically uses pub/sub messaging, webhooks, and/or websockets — and is separate from an application or service’s main API.
    • Firebase – Firebase is a BaaS (Backend-as-a-Service) that allows developers to create web applications with no server-side programming required.
    • Pubnub – PubNub is a programmable Data Stream Network (DSN) and realtime infrastructure-as-a-service (IaaS) company. Primarily, they are a messaging solution hosted on a cloud service that allows developers to publish data instantly to one or multiple devices.
    • Pusher – Pusher is a hosted service that allows developers to add realtime bi-directional functionality via WebSockets (with HTTP-based fallbacks) to the web and mobile apps.
    • Ably – Ably is a realtime data delivery platform that provides creators the tools to create, deliver, and manage projects. Their main realtime functionality consists of pub/sub, presence, authentication, encryption, and connection state recovery.

Node.js Realtime Resources

This section highlights the realtime resources available for Node.js developers.


Realtime Node.js Libraries

Realtime application framework (Node.JS server) – Socket.IO enables real-time bidirectional event-based communication. It consists in: a Node.js server (this repository), a Javascript client library for the browser (or a Node.js client). Some implementations in other languages are also available.

Sails – Sails.js is a web framework that makes it easy to build custom, enterprise-grade Node.js apps. It is designed to resemble the MVC architecture from frameworks like Ruby on Rails, but with support for the more modern, data-oriented style of web app & API development. It’s especially good for building realtime features like chat.

Racer: Realtime model synchronization engine for Node.js – Racer is a realtime model synchronization engine for Node.js. By leveraging ShareDB, multiple users can interact with the same data in realtime via Operational Transformation, a sophisticated conflict resolution algorithm that works in realtime and with offline clients. ShareDB also supports PubSub across multiple servers for horizontal scaling. Clients can express data subscriptions and fetches in terms of queries and specific documents, so different clients can be subscribed to different overlapping sets of data. On top of this sophisticated backend, Racer provides a simple model and event interface for writing application logic.

Realtime Multiplayer in HTML5 – An example using node.js, socket.io and HTML5 Canvas to explain and demonstrate realtime multiplayer games in the browser.

Straw: Realtime processing framework for Node.js – Straw lets you run a Topology of worker Nodes that consume, process, generate and emit messages. Use it anywhere you need data processed in real-time. Straw is ideal for building flux style reactive webapps. You create processing nodes that pass messages to each other or the outside world. Straw’s approach makes it easy to break your problem down in to small steps and develop iteratively.

Express-Status-Monitor – Simple, self-hosted module based on Socket.io and Chart.js to report realtime server metrics for Express-based node servers.


Real-Time Analytics Dashboard with NodeJs, Socket.io, VueJs

Specs

  • Coligo
  • March 2016

Resources

Synopsis

In this tutorial we’ll be using NodeJs, Socket.io, and VueJs to build a real-time web analytics dashboard, similar to what you would find on Google Analytics. Have a look at the demo to see what the end product will look like and feel free to clone the GitHub repository which has the completed code for this tutorial.


Specs

  • Author: Krasmir Tsonev
  • Date: May 2013

Resources

Synopsis

NodeJS gives me the ability to write back-end code in one of my favorite languages: JavaScript. It’s the perfect technology for building real time applications. In this tutorial, I’ll show you how to build a web chat application, using ExpressJS and Socket.io.


Feathers – Instant Realtime and Rest APIs with Node.js

Specs

  • Site: Feathers

Resources

Synopsis

With Feathers you can build prototypes in minutes and production ready real-time backends and REST APIs in days.


Why the Hell Would You Use Node.js

Specs

  • Author: Node.js Foundation
  • February 2017

Resources

Synopsis

In one sentence: Node.js shines in real-time web applications employing push technology over websockets. What is so revolutionary about that? Well, after over 20 years of stateless-web based on the stateless request-response paradigm, we finally have web applications with real-time, two-way connections, where both the client and server can initiate communication, allowing them to exchange data freely.


Realtime Infrastructure Services

  • Realtime API Infrastructure – Realtime API infrastructure specifically allows developers to build realtime data push into their existing APIs.  Typically, you would not need to modify your existing API contracts, as the streaming server would serve as a proxy. The proxy design allows these services to fit nicely within an API stack. This means it can inherit other facilities from your REST API, such as authentication, logging, throttling, etc. It can be combined with an API management system.  In the case of WebSocket messages being proxied out as HTTP requests, the messages may be handled statelessly by the backend. Messages from a single connection can even be load balanced across a set of backend instances.
    • Fanout/Pushpin – Fanout is a real-time API development kit that helps you push data to connected devices easily. Fanout is a cross between a reverse proxy and a message broker. Pushpin is the open source version.
    • Streamdata.io – Streamdata.io a SaaS API proxy tool that converts standard API requests into a streaming API. In other words, it provides a proxy as a service for any HTTP API by polling and acting as a streaming API.
    • LiveResource – LiveResource is a protocol specification and JavaScript reference library for receiving live updates of web resources. It has the following principles:
  • Realtime Application Infrastructure – Realtime app infrastructure sends data to browsers and clients. It typically uses pub/sub messaging, webhooks, and/or websockets — and is separate from an application or service’s main API.
    • Firebase – Firebase is a BaaS (Backend-as-a-Service) that allows developers to create web applications with no server-side programming required.
    • Pubnub – PubNub is a programmable Data Stream Network (DSN) and realtime infrastructure-as-a-service (IaaS) company. Primarily, they are a messaging solution hosted on a cloud service that allows developers to publish data instantly to one or multiple devices.
    • Pusher – Pusher is a hosted service that allows developers to add realtime bi-directional functionality via WebSockets (with HTTP-based fallbacks) to the web and mobile apps.
    • Ably – Ably is a realtime data delivery platform that provides creators the tools to create, deliver, and manage projects. Their main realtime functionality consists of pub/sub, presence, authentication, encryption, and connection state recovery.

PHP Realtime Resources

This section highlights the realtime resources available for PHP developers.


PHP Realtime Libraries

PushRadar’s official PHP library, wrapping the PushRadar API – PushRadar is a realtime notifications API service for the web. The service uses a simple publish-subscribe model, allowing you to broadcast “notifications” on “channels” that are subscribed to by one or more clients. Notifications are pushed in realtime to those clients.

Real-time log debugger – Simple and Lightweight real-time log debugger via Websocket with Nodejs, SocketIO and Restful API to feed log (PHP, Python…)

This project turnkey is distributed as a middleware to expose RATP realtime data as REST resources – This project turnkey is distributed as a middleware to expose RATP data as REST resources. You can retrieve real time schedules for any given RER (train), Metro, Tramway, Bus or Noctilien stop in real time.

A PHP API wrapper for ORTC  – It’s an unofficial client for ORTC (Open Real-Time Connectivity, realtime & cloud-based pub/sub framework from realtime.cofor PHP 5.4+), but yet powerful, composer based and compatible with psr-1, psr-2 and psr-4.

An useful PHP script to provide user friendly JSON result for Tainan Bus realtime data – With this api, you can get the realtime position of all the bus in Tainan!

Intaro Pinboard – Intaro Pinboard (Pinba Board) is a realtime PHP monitoring system which aggregates and displays pinba data. Developed on Silex framework and works with PHP 5.3.3 or later.

PHPench: Realtime benchmarks for PHP code – PHPench creates a graphical output for a PHP benchmark. Plot the runtime of any function in realtime with GnuPlot and create an image out of the result. Algorithms are beautiful. Sometimes the difference between two algorithms is hard to explain but easy to show. For instance, take two sorting algorithms which both have a best-case runtime of O(n*log n). Depending on the input, one can be much faster than the other. This tools helps you see what’s going on.

PHP-long-polling: An extremely simple example of a “real-time” self-updating page using long-polling – A very simple demonstration of long-polling with AJAX (jQuery) and PHP. Long-polling makes near “real-time” applications possible. The client does not request new data every X seconds/minutes, the client gets new data delivered when there is new data (push-notification style).

PHP-gif: Easy generating (real-time) GIF images with PHP – An ideal solution for sending e-mails with real-time data to customers. E-mail clients give you the opportunity to load images by URL and so everytime the client re-opens the e-mail message, the GIF will be re-generated with real-time data.

Laravel-pushover: A Laravel wrapper for Pushover – Pushover makes it easy to get real-time notifications on your Android, iPhone, iPad, and Desktop (Pebble, Android Wear, and Apple watches, too!)

PHPchess – Chess website script for real-time and correspondence play using mysql5 and php 5+

Laravel Micro Manager – Oversee jobs you have put into the queue. Track status, completion % and other job information in real time.


Real-Time Web applications with PHP and Ratchet

Specs

  • Author: Smart Gamma
  • Date: June 2016

Resources

Synopsis

This post is a set of approaches and rules that SmartGamma uses for building real-time web applications. Our real-time solutions mostly based on articles and recommendations of Phil Leggetter — a real-time web evangelist and consultant. His articles give us a very clear understanding of real-time web technologies that we can use to build such real-time applications.


Ratchet

Specs

  • Websockets for PHP

Resources

Synopsis

Ratchet is a loosely coupled PHP library providing developers with tools to create real time, bi-directional applications between clients and servers over WebSockets. This is not your Grandfather’s Internet.


Real Time Notifications With PHP

Specs

  • Author: Gonzalo Ayuso
  • Date: March 2011

Resources

Synopsis

Normally when we are speaking about real-time communications, all the people are thinking about a chat application. I want to build a simpler application. A want to detect when someone clicks on a link. Because of that I will need a combination of HTML, PHP and JavaScript. Let’s start:

For the example I’ll use jquery library, so we need to include the library in our HTML file. It will be a blend of JavaScript and PHP.


Realtime Infrastructure Services

  • Realtime API Infrastructure – Realtime API infrastructure specifically allows developers to build realtime data push into their existing APIs.  Typically, you would not need to modify your existing API contracts, as the streaming server would serve as a proxy. The proxy design allows these services to fit nicely within an API stack. This means it can inherit other facilities from your REST API, such as authentication, logging, throttling, etc. It can be combined with an API management system.  In the case of WebSocket messages being proxied out as HTTP requests, the messages may be handled statelessly by the backend. Messages from a single connection can even be load balanced across a set of backend instances.
    • Fanout/Pushpin – Fanout is a real-time API development kit that helps you push data to connected devices easily. Fanout is a cross between a reverse proxy and a message broker. Pushpin is the open source version.
    • Streamdata.io – Streamdata.io a SaaS API proxy tool that converts standard API requests into a streaming API. In other words, it provides a proxy as a service for any HTTP API by polling and acting as a streaming API.
    • LiveResource – LiveResource is a protocol specification and JavaScript reference library for receiving live updates of web resources. It has the following principles:
  • Realtime Application Infrastructure – Realtime app infrastructure sends data to browsers and clients. It typically uses pub/sub messaging, webhooks, and/or websockets — and is separate from an application or service’s main API.
    • Firebase – Firebase is a BaaS (Backend-as-a-Service) that allows developers to create web applications with no server-side programming required.
    • Pubnub – PubNub is a programmable Data Stream Network (DSN) and realtime infrastructure-as-a-service (IaaS) company. Primarily, they are a messaging solution hosted on a cloud service that allows developers to publish data instantly to one or multiple devices.
    • Pusher – Pusher is a hosted service that allows developers to add realtime bi-directional functionality via WebSockets (with HTTP-based fallbacks) to the web and mobile apps.
    • Ably – Ably is a realtime data delivery platform that provides creators the tools to create, deliver, and manage projects. Their main realtime functionality consists of pub/sub, presence, authentication, encryption, and connection state recovery.

Python Realtime Resources

This section highlights the realtime resources available for Python developers.


Realtime Python libraries

Slack Developer Kit for Python – Whether you’re building a custom app for your team, or integrating a third party service into your Slack workflows, Slack Developer Kit for Python allows you to leverage the flexibility of Python to get your project up and running as quickly as possible.

Python library for interacting with SolrCloud – solrcloudpy is a python library for interacting with SolrCloud. This library aims to take advantage of the following features of Solr: Distributed indexing and searching and transparent failover. Full JSON api. Centralized index management. Near-realtime search

Realtime data processing and plotting pipelines in Python – PyRealtime is a package that simplifies building realtime pipeline systems Python. It is designed to be simple enough to start visualizing data in just a few lines and scalable enough to support more complex workflows. It supports realtime plotting (Matplotlib), serial communication (Pyserial), and socket connections out of the box. It uses a declarative data flow syntax, which means you specify how the pipeline should behave and then you run the pipeline. For example, you can build a real time plot of data coming from a serial port in just three lines.

Realtime social media data analytics with Apache Spark, Python, Kafka, Pandas, etc – Project uses Apache Spark functionalities (SparkSQL, Spark Streaming, MLib) to build machine learning models (Batch Processing-Slow) and then apply the model with (Spark Streaming-Fast) to predict new output.

Realtime Streaming with the Raspberry Pi and Plot.ly Python Library – A tutorial on streaming with Raspberry Pi.

Facebook Messenger Bot with realtime weather updates (Python) – A Python bot, that contains a Flask server designed to be deployed on Heroku. The application uses a bot made using the Python API from Wit.ai and the Facebook Messenger API. The bot is designed to provide real-time weather updates on Messenger using the pywapi wrapper for the Weather.com API.


Python and Real-Time Web

Specs

  • Real-time Web: Python Introduction
  • Author: Serge S. Koval.
  • 2013

Resources

Synopsis

“I decided to write elaborate blog post instead, in which I will try to cover basics, give short introduction into asynchronous programming in Python, etc.”


Tutorial: Consuming Twitter’s real-time stream API in Python

Specs

  • Ryan Paul
  • April 2010

Resources

Synopsis

“This tutorial will show you how to consume and process data from Twitter’s new streaming API. The code examples, which are written in the Python programming language, demonstrate how to establish a long-lived HTTP connection with PyCurl, buffer the incoming data, and process it to perform the basic message display functions of a Twitter client application.”


Working with streaming data: Using the Twitter API to capture tweets

Specs

  • Vik Paruchuri
  • September 2016

Resources

Synopsis

“Being able to work with streaming data is a critical skill for any aspiring data scientist. In this post, we’ll talk about strategies for working with streaming data, and walk through an example where we stream and store data from Twitter.”


Realtime Infrastructure Services

  • Realtime API Infrastructure – Realtime API infrastructure specifically allows developers to build realtime data push into their existing APIs.  Typically, you would not need to modify your existing API contracts, as the streaming server would serve as a proxy. The proxy design allows these services to fit nicely within an API stack. This means it can inherit other facilities from your REST API, such as authentication, logging, throttling, etc. It can be combined with an API management system.  In the case of WebSocket messages being proxied out as HTTP requests, the messages may be handled statelessly by the backend. Messages from a single connection can even be load balanced across a set of backend instances.
    • Fanout/Pushpin – Fanout is a real-time API development kit that helps you push data to connected devices easily. Fanout is a cross between a reverse proxy and a message broker. Pushpin is the open source version.
    • Streamdata.io – Streamdata.io a SaaS API proxy tool that converts standard API requests into a streaming API. In other words, it provides a proxy as a service for any HTTP API by polling and acting as a streaming API.
    • LiveResource – LiveResource is a protocol specification and JavaScript reference library for receiving live updates of web resources. It has the following principles:
  • Realtime Application Infrastructure – Realtime app infrastructure sends data to browsers and clients. It typically uses pub/sub messaging, webhooks, and/or websockets — and is separate from an application or service’s main API.
    • Firebase – Firebase is a BaaS (Backend-as-a-Service) that allows developers to create web applications with no server-side programming required.
    • Pubnub – PubNub is a programmable Data Stream Network (DSN) and realtime infrastructure-as-a-service (IaaS) company. Primarily, they are a messaging solution hosted on a cloud service that allows developers to publish data instantly to one or multiple devices.
    • Pusher – Pusher is a hosted service that allows developers to add realtime bi-directional functionality via WebSockets (with HTTP-based fallbacks) to the web and mobile apps.
    • Ably – Ably is a realtime data delivery platform that provides creators the tools to create, deliver, and manage projects. Their main realtime functionality consists of pub/sub, presence, authentication, encryption, and connection state recovery.

Realtime API Demos – Overview List

Check out all these realtime demos on Realtime Hub and other sites:

  1. Todo List – Django/React
  2. Leaderboard – RethinkDB, Django, React
  3. Headline – Django
  4. Chat App – Django Eventstream

Todo List – Django/React

This demo is a live version of TodoMVC, using HTTP long-polling for updates.  It demonstrates a realtime permutation of a ‘todo’ app.

pushpin fanout django react todo app

 

Leaderboard – RethinkDB, Django, React

RethinkDB is a modern NoSQL database that makes it easy to build realtime web services. One of its standout features is called Changefeeds. Applications can query tables for ongoing changes, and RethinkDB will push any changes to applications as they happen. The Changefeeds feature is interesting for many reasons:

  • You don’t need a separate message queue to wake up workers that operate on new data.
  • Database writes made from anywhere will propagate out as changes. Use the RethinkDB dashboard to muck with data? Run a migration script? Listeners will hear about it.
  • Filtering/squashing of change events within RethinkDB. In many cases it may be easier to filter events using ReQL than using a message queue and filtering workers.

This makes RethinkDB a compelling part of a realtime web service stack. In this article, we’ll describe how to use RethinkDB to implement a leaderboard API with realtime updates. Emphasis on API. Unlike other leaderboard examples you may have seen elsewhere, the focus here will be to create a clean API definition and use RethinkDB as part of the implementation. If you’re not sure what it means for an API to have realtime capabilities, check out this guide.

rethinkdb fanout pushpin realtime api example app

Read the rest of the article here.

 

Headline – Django

Django is an awesome framework for building web services using the Python language. However, it is not well-suited for handling long-lived connections, which are needed for realtime data push. In this article we’ll explain how to pair Django with Fanout Cloud to reach realtime nirvana.

How it works

The Fanout Cloud gives web services realtime superpowers. The architecture is similar to a traditional caching CDN, except that Fanout Cloud is designed for pushing data rather than caching. Django applications can run behind Fanout Cloud to easily support realtime behaviors such as WebSockets, HTTP streaming, and HTTP long-polling.

djfanout

The django-grip library is used to communicate with Fanout Cloud. “GRIP” is the name of Fanout’s open protocol for communication between Fanout Cloud and the backend application.

Read the rest of the article here,

 

Chat App – Django Eventstream

A simple chatroom built with Django with updates that are sent using HTTP streaming.

Resources

GitHub Repo

Live App


Realtime Chat

Realtime chats are the most common realtime applications. If there is a realtime service, they offer realtime chat in some capacity or form.

WebSockets are the most preferred mechanism to create realtime chat because they are bi-directional, meaning messages can be sent back and forth between a client and a server.

Realtime - Realtime chat

Live Chat vs. Realtime Chat

Sometimes people confused realtime chat and live chat. Live chat is a popular term for online chat applications that provide assistance to a user. Live chat is more of a support mechanism on most sites. Realtime chat involves the instantaneous delivery of messages from a sender to a receiver.

Real World Applications

Realtime chat programs:

  • iMessage
  • Google Talk
  • Skype
  • Slack
  • WhatsApp
  • Windows Live Messenger
  • AOL
  • Google+ hangouts
  • Tinychat

Demo

If you want to see a realtime chat in live action, check out Socket.IO’s chat demo here.

Resources

Citing Techopedia: “The first real-time chat system was known as Talkomatic, developed by David R. Woolley and Doug Brown in 1973. It provided quite a few channels, each of which was able to support as many as five people, with messages from all users showing up on the screens character-by-character as they were typed. CompuServe CB Simulator, launched in 1980, was the first dedicated real-time chat service made available to the public.”

Firebase Tutorial: Real-Time Chat

Creating a Real Time Chat API with Node, Express, Socket.io, and MongoDB

IoT

The Internet of Things (IoT) is the inter-networking of physical devices, digital machines, mechanical machines, objects, vehicles, buildings, or people that are embedded with electronics that transfer data over a network. Sensors connected with other IoT objects can provide immediate information to multiple devices. This makes it a great use case for realtime services. There is many ways IoT devices can be brought up to speed and scale with realtime.

Realtime Data

Real-time data often needs to be pushed to multiple devices. Talend offers a platform where you can stream connected devices with external data such as the weather. Realtime can also help stop credit card theft and prevent medical device failures by streaming the proper data to the correct devices. And of course, the most obvious example, you can use realtime services to stream messages to multiple connected devices as well.

Resources

Citing Hackernoon, “Imagine we have a data warehouse like hive having petabytes of data in it. But it allows us to just analyze our historical data and predict future. So processing of huge volumes of data is not enough. We need to process them in real-time so that any organization can take business decisions immediately whenever any important event occurs. This is required in Intelligence and surveillance systems, fraud detection etc.

Citing Computerworld, “It is only human nature. Once consumers and businesses have a taste of the Internet of Things and real-time analytics benefits, they’ll want more of it. In fact, it has been said that along with the influx of data, by 2017 more than 50 percent of analytics implementations will make use of event data streams generated from instrumented machines, applications, and/or individuals. How can companies keep up with this real-time analytics demand? By changing how analytics is currently done to fit the new digital need, including:”