20 points · by vladaionescu · 11y ago · 12 comments
This approach also forgoes many of the nice side-effects of having a clear slide-server boundary like avoiding leaking implementation details into your front-end code. Also, a simple REST API can be reused across platforms, so when you want a native experience on Android, iOS, etc you wont have to replicate this architecture or the underlying logic on each of those platforms.
Like SyncNinja, our architecture moves a layer of clientside code into the server. This enables more code sharing, at the cost of tight coupling between client and server (which does not matter for web but is problematic for our app clients). For use cases that need to work offline it falls apart; for that you need api's that work at the business layer and duplicate the view logic in each client.
I think SyncNinja will share difficulties we found around offline/localStorage, besides high resource usage, support for non-web clients, and all the problems you'd expect from browser differences (i.e. input prefill).
It'll also introduce a very big attack surface for malicious agents to DDoS your server and possibly exploit the server-side V8 once an appropriate vulnerability shows up.
And it'll also produce application tightly coupled to browser API emulation, which would become an obstacle to the server being able to properly support native mobile and desktop applications.
I can put these issues aside for a moment, and attribute them to me being too cynical to believe in a new way of doing things.
But let's look at the benefits. This is the example being given for the kind of client code that SyncNinja would enable:
someDatabase.lookup('users', 'john', function (err, userData) {
console.log("User's real name is " + userData.userName);
});
This is already possible to do on the client-side, in plain JS, and any kind of server, as a very, very thin wrapper around the available AJAX calls provided by the server web API.So my point is, I see no convincing examples of SyncNinja making something possible that wasn't already trivial before, and without the big overhead. Maybe you guys should work on what the value of this system is in practice.
Your "before" example doesn't show limitations of the browser, but simply a missing thin client library to abstract the AJAX calls.
Additionally, you have no prototype of this concept at all. Even a toy prototype with just one kind of event, or something. It sends the message that everything written in the paper doesn't come from experience, but it's merely hypothetical. And there's a giant leap from an idea to a working prototype.
Now to actually address it, I think it's more than just a thin wrapper. Perhaps the example shows too little, but for many developers, writing server side code and all the necessary communication is a road block. For others it's just extra stuff to maintain. And we generally like less code that does more.
I wouldn't worry about V8 vulnerabilities, there are many node servers running in production today, in general, and they are doing fine. But your DDos point is pretty fair - I can see how that could be a problem. Feel free to submit a pull request to add to caveats if you want to take credit for it.