How we built Pusher-JS 2.0 – part 2 – implementation
In this technical retrospective (2013), @knes shares practical architectural lessons learned from running, scaling, or migrating production software under lean constraints.
Core Principles for Independent Builders:
Defaulting to simpler architectures (such as monolithic frameworks, SQLite, or managed VPS) prevents early engineering bankruptcy.
Evaluating true compute and egress costs reveals that high cloud bills can often be slashed by 80%+ through judicious re-platforming.
Code you write at 2 AM as a solo engineer must be easy to debug six months later without complex microservice dependencies.
Community Debate Themes:
HN engineers debated the tradeoffs between cloud convenience and raw server economics, database indexing strategies, and resisting premature architectural complexity.
CATEGORY Frugal Engineering →
HISTORICAL ERA Web 2.0 Genesis (2007–2013)
COMMUNITY SCORE 33 points
TOTAL DISCUSSIONS 2 comments
This is a great write-up! We learned a lot of these lessons at Poll Everywhere for http://firehose.io/ ↗, which is basically an open source version of Pusher. We do things a few things differently though:
* We only have two transport layers: http and ws. We don't bother with a Flash polyfill.
* We start the connection via HTTP long polling and upgrade to WS if its (a) present in the client and (b) the network supports it. We've seen a lot of firewalls kill WS connections, so long polling always works.
* We treat our "push" channels more like a push edge cache. Because of flakey connections you want to hang on to the past 50-100 messages published to a channel so that flakey clients can get messages if their connection drops.
Source code is up at https://github.com/polleverywhere/firehose ↗ and you can install it as a gem and have it running in 2 seconds.
I'm happy to answer questions on here if anybody's got them about building a realtime transport layer like Pusher & Firehose!