Fork me on GitHub

Realtime Data Client with Redis, Websockets, and D3

October 13, 2013

tags: code tetris

what i’ve got

An old php app for data entry to capture results of multiplayer Tetris.

what i wanted

Realtime feedback, reports, visualizations while playing Tetris. It should be separate from the data entry application.

These visualizations could be on a second screen or tablet for the group to see between matches.

what i did

After a new match is validated and saved, I took each player’s individual performance and published the details to a redis pub-sub channel called “tetris:performances”. This could allow for a range of consumers each reacting to new matches in different ways.

When a new performance arrives I emit the details to any connected clients.

The first web client I made was a d3 scatterplot.


Points are added to the scatterplot in real time when they are submitted via the data entry app.

Check out the project code.

what would come next

More web clients consuming the websocket events. Or a dashboard of graphics each using the data in different ways or listening for subsets of the data.

Discussion, links, and tweets

a small avatar image of Tom

I am a software developer in Los Angeles.