Hacker News new | ask | show | jobs
by Blahah 1109 days ago
It sounds like you've got a working solution already - is that right? If so, the old adage "if it ain't broke, don't fix it" applies.

Beyond that, if you're looking at whether to use these technologies in enhancing what you've got or solving problems that you have or expect with high confidence, then there are clear wins to be had.

Automerge and y.js are absolutely great for collaboration on blocks of text or structured documents (or anything that can be modelled as such). They are purely for conflict resolution, so if you don't have conflicts, or your use case manages to make the impact of conflicts negligible, don't bother with them. They are very easy to implement if you do need them - the barrier most people face is understanding them enough to decide if and how to use them. Just keep it simple.

Hypercore is a p2p solution for synchronising streams of data. It can be used raw, for streaming updates, or you can use the abstractions over it to keep filesystems or databases in sync. There's a significant difference between the decision about hypercore vs CRDTs - hypercore can potentially remove the need for you to maintain and operate a specific server, allowing all clients to be servers. This also reduces the dependency of the user on infrastructure - your servers, the Internet, a friendly government, etc. If that might be useful to you or your users, it's worth considering. Unlike PouchDB, it's a low level abstraction that can open up really new ways of thinking about shared information. PouchDB by contrast is 'just' a p2p syncing database. Also important: hypercore doesn't require its own process - you can roll it into your code directly, or have it in a separate process if you want.

Of all the things you mentioned, I'd say that hypercore is the only one worth diving into regardless of whether you seem to need it. You'll be a better systems designer and engineer once you understand it, and will have an expanded landscape of possibility when you can leverage it.

As for php vs node etc - that hasn't been an issue for a long time. Node is supported everywhere.

1 comments

>As for php vs node etc - that hasn't been an issue for a long time. Node is supported everywhere.

I would guess what's being referred to for PHP is the ultra-cheap shared hosting where your account is running in the same OS instance as other people's accounts. You can get node.js to work, but it's harder to deal with since it's binding to a specific ip/port, and single ip addresses are shared by many customers. PHP has more options to make shared hosting look like a normal webserver to the outside. Shared hosts often use the LightSpeed webserver with "lsapi" that makes a shared webserver a little more configurable/performant on a per-account basis.