Hacker News new | ask | show | jobs
by austin-cheney 792 days ago
Do it the way the database wants you to do it. Don’t use HTTP. Instead use TCP sockets (WebSockets when in the browser). Then put a tigger on the tables you care about.

Every time the table changes the DB sends a message to the browser in real time. Super simple.

1 comments

It's super simple for a simple demo app, not easy for a large scale.
It remains just as simple. The transmission model does not change as the size of application code changes.

The only thing to worry about is load balancing socket restoration when the server recovers from an outage so it’s not overwhelmed reopening all sockets simultaneously.

As for the database side you should only be concerned with changes to a select few tables and not the entirety of data. That could also be centrally managed with a script.