3 ms·
I think we've all wondered this at some point in our careers. It's something you should never do. Off the top of my head: 1) Security (as has been beaten to d
by conrs 5y ago
I think we've all wondered this at some point in our careers.
It's something you should never do. Off the top of my head:
1) Security (as has been beaten to death here)
2) Interface versioning. If you expose a generalized SQL interface to your consumers directly, good luck ever making a change to your database schema. You'll have no idea whose workflows you break. This high coupling becomes very painful very fast.
3) Abstraction. The way data is stored is often not the way data should be surfaced. What about application layer data integrity, things like that? This would require the frontend client to have far too specialized of knowledge as to how the backend works.
4) Optimization. How do you optimize for queries you don't control? Someone will craft something that can bring your database to its knees under load without even trying to.
- ainiriand 5y agoTotally valid points. I think this can be solved by a change of layout. If you do use sql queries in the frontend but have a layer between your front and your database to map which queries are valid and how to map your queries to your own DB representation. You solve a big chunk of your problems that way.
- TheCoelacanth 5y agoThat sounds way harder than just defining an API for the front-end to use.