Live mission control using Node.js and Redis

Bart Szablowski
zappit
Published in
2 min readOct 24, 2016

Introduction

As a kid when watching cartoons I was always fascinated by these crazy mission control rooms owned by vigilantes, allowing them to see more than other characters in the movie. Now as a grown up and a developer I thought to myself how awesome it would be to have a “mission control” panel myself. This one isn’t used for evil aspirations, though.

Our status page allows us to see to see things like:

  • CPU, RAM and disk usage on different AWS instances
  • Number of current device connections to our platform
  • Top performing campaigns and displays across all accounts
  • Last time an instance was updated (GIT)

And all of that in realtime.

La création and challenges.

After thoroughly analysing and drawing out the requirements of this project I had to think about how to get data from different sources/servers without any use of AJAX and show it in real-time. I decided to build it on top of Node.js and Redis.

This sketch should give you a basic understanding of how this works.

From right to left, many servers issue PUBLISH and SET commands to Redis server, but only when the value changes. Node.js server is continuously SUBSCRIBED to dashboard channel, listening for messages published by other servers. Once server.js receives a new message it is immediately sent to the frontend using Socket.io library, the rest is handled by CSS3 animations and jQuery.

Conclusions

It was a cool and fun little project to work on. In my opinion every tech company should have one of those live dashboards. Not only does it look cool, it also gives our team a quick insight into what’s going on across all of our infrastructure.

If you owned a running app you could display the number of kilometres run today, number of current users, or heck.. even add live-moving charts! The possibilities are endless.

--

--