5 ms·
Ugh, no. The problems of just exposing your database really come out after you try living with it. We wanted to make schema changes on the back-end, but the fr
by ericb 5y ago
Ugh, no. The problems of just exposing your database really come out after you try living with it.
We wanted to make schema changes on the back-end, but the front-end queries were tied to it. Those queries were in apps run by different groups, with different goals and timetables, but we couldn't break them. If we had a defined API, we could be free to modify any back-end implementation details that weren't directly exposed. We couldn't because every detail was baked into consuming apps. What was our API, and where did it end? Now it was the entire database!
When we had to source data from elsewhere, or provide it via logical abstraction, we ended up piling hacks on top of the data structure's "API" from the back end that was now replicated in the front-end in order to "maintain it". Maintaining it really meant "providing an API that was the haunted ghost of our previous database schema "API" because now other apps/clients expected that "API".
- littlestymaar 5y agoYou're not exposing your database though (or at least you shouldn't be): you're exposing views. The set of views that you expose are your API. But it's not tied to your database schema than any kind of API (not less either though, if your database schema really doesn't match your API, your performances are likely to suffer sometimes, but that's true with any kind of API). (I am in no way a GraphQL evangelist btw)
- 8note 5y agoAWS makes it way to easy to connect a database directly to an API, both for API gateway and app sync.
- orf 5y agoWho’s exposing their database? Why? You’re exposing a view over your data that may or may not live in a database. None of your points apply directly to grapple, all apply to a REST based architecture. More so, I’d say.
- 8note 5y agoIt sounds like your main problem is that you cant get your callers prioritize making changes. Using rest doesn mean you can stop supporting a call pattern because you feel like it. Somebody else still needs to do work before you can drop your translation layer