3 ms·
Ive been wondering for a while now -- tell me, do we really need specialized server logic for every little functionality? In my last project, almost half the s
by devxpy 6y ago
Ive been wondering for a while now -- tell me, do we really need specialized server logic for every little functionality?
In my last project, almost half the server code is really just converting REST to SQL. Why don't we just use SQL on the client directly?
If its just about authorisation, why not write an auth system for SQL and be done with all this unnecessary server code, once and for all?
I mean graphql sounds so stupid in this context because it's just cruft over SQL.
- mmillin 6y agoThere's a lot of good reasons why you shouldn't just connect straight to the database from client-side code. [1] So you'll always need some form of server sitting in between. Maybe you could store it in a new database system built entirely for this, which handles all of the nuances. However, you nearly always have more complicated logic and constraints that need to be enforced beyond what can be specified in a database schema, and you can't rely on clients maintaining that. [1]: https://security.stackexchange.com/q/229954 https://security.stackexchange.com/q/229954
- devxpy 6y agoI agree that direct connection to a database might not be the best idea, but I dont see anything particularly wrong with sending SQL over the wire. I'm suggesting something like a hassura that isn't based on graphql, but works directly on SQL. And ofcourse for specific logic, you can always run a traditional server in tandem.