Hacker News new | ask | show | jobs
by nexuist 1859 days ago
The entire server-first computational model of today is a direct result of the disastrous adoption of NAT, which killed peer to peer applications and from which the P2P market is still recovering from (uPnP was one such [failed] attempt to fix the problem, now WebRTC and its friends STUN/TURN are up next).

Google Docs doesn't have to run on Google servers. It could run on any operating system and work from anywhere provided that you and whoever you want to work with have public IP addresses. But because everyone and everything is behind a corporate or residential router, this avenue is not available unless you are willing to work for it -- and in the case of a corporate network, you literally can't do anything except connect to a third party proxy (or a first party server) in order to be able to talk to your friends' computers. There's also no good way to handle the mobile phone problem, in which your IP address changes every so often as you pass between cell towers.

Ultimately, having each client connect to a centralized server and shuttling data between them server-side ended up being the much better solution instead of the far more attractive option (to users anyways) of connecting to each other directly.

1 comments

Your p2p Google Docs example is complicated. What if server applications as a paradigm won because it’s a much simpler approach? Centrally develop and release updates, keeping users all on one system. It’s especially important for network connected apps which want to handle user collaboration. You want everyone on one system, without competing versions.

Not saying it’s best for users, but just smarter and more practical from dev perspective.

Generally the way P2P applications dealt with this is by assigning one peer as the "host" that would disperse one single source of truth among all the other peers (granted there are security problems here if the host peer is running a hacked or modded client). If the host dropped, the peers would use a consensus algorithm to pick a new host, exactly the same as how database clusters pick a new writer node if the old one dies.

It may be easier for devs to use the server model, but it's also more expensive - standing up centralized servers that can scale to millions of users is $$$. I think there would be a lot more P2P software competing with server-based software if NAT wasn't a thing, because software companies would be able to build extremely scalable software without having to pay for the hosting costs themselves. While Google Docs has to handle millions of users, if I were to "host" my own document I would only care about handling my friends - maybe two or three or up to a few dozen, but it would be very rare that I would host a document for 1000+ people. Developing an application that can handle a few dozen connections would be much simpler than one that handles millions, I believe.