What I learned developing real-time web applications

Posted by Dr. Hastings

I developed a system that processes approximately 29 messages per second, averaging 3KB each.

It's optimal to update the DOM all at once with one function if you can. Target specific elements rather than broad updates by wrapping changeable values in spans with IDs.

Do NOT rely heavily on the front-end for logical reasoning. Data validation and state management should occur server-side before reaching the view layer.

Google Chrome limits the number of open sockets to 6. Using Chrome's developer tools, we noticed that the event source, for every message, continued to grow in size.

We implemented two event sources running in parallel on the client. The first event source listens for critical status messages while the other listens for applicable data based on the user's page.

This was the most challenging and most fun project that I've worked on to date.

Trackbacks

Use the following link to trackback from your own site:

https://tom.hastings.dev/trackbacks?article_id=24

Leave a comment

Leave a comment

(show email/url »)