Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The requirements on clients are fundamentally different than on the server. On clients, you want at least:

1. Batching, to avoid network waterfalls (a consequence of network use being more expensive on clients than on the server).

3. Data dependencies, so the framework knows how to stitch queries together when batching them.

3. Consistency, so all UIs update when an update comes in (a consequence of SPAs being long-lived, as opposed to the typical stateless server request).

These all take some code/framework overhead. It’s valuable to pay that cost on clients, but is unnecessarily verbose for the server.

People have been trying to unify local and remote function calls for years, and it’s a similar problem: the two are fundamentally different.



I is just me or does anyone else have to keep endless models and endpoints and commands and clients in sync in different languages?


Have you tried Swagger, or another solution to codegen client endpoints/schemas from server definitions?


"code/framework overhead" is fine as long as its hidden in a library. Too many people re-implement a data layer client-side that is always a poor mapping to the server data model. My frontend should act as if its running off a local database and sync with the server. It could batch together all requests made to this database that it cannot fulfil or that are stale.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: