4 ms·
Along with what kenrose said, imagine the flexibility of being able to request the exact view that you need from the server for any client you have in mind. A p
by tepidandroid 7y ago
Along with what kenrose said, imagine the flexibility of being able to request the exact view that you need from the server for any client you have in mind. A perfect view fetched in a single trip -no overfetching or underfetching, no bespoke HTTP endpoints for every new use-case and a self documenting API + type-safety to boot.
Some trade-offs are things like more backend complexity, querying complex data (like deeply nested or recursive data structures) becomes harder, limiting exponential query complexity as the data branches out, etc. It also becomes more difficult to predict resource usage and to monitor performance, as the article mentions.
- lkrubner 7y agoThere is something badly broken with your process for denormalization if you think bespoke endpoints are more work than GraphQL. Presumably you have to denormalize for many internal uses, as well as external ones, so it pays to automate that process till it is both flexible and easily configured and automatic.
- thom 7y agoBut you’ve just described a bunch of work to do to achieve what’s GraphQL gives you for free, surely?
- dmitriid 7y agoThere’s nothing free. Requesting “any view for any potential client” will most likely cripple your backend because you can’t optimise ad-hoc queries.
- thom 7y agoSo in the presumably rare case that this happens can one not just add a new view, map it in the GraphQL schema and still come out far ahead on development time? I just feel like a huge number of people are going to accept lower complexity in the short term with some optimisation to do later. That seems like an fairly sensible and defensible tradeoff. I’ll admit I’m not picturing public APIs though.
- lkrubner 7y agoAre you sure? GraphQL, with no extra effort, gives your Business Intelligence unit everything they need? GraphQL, "for free", populates a hot cache of your 10% most active data? GraphQL, with no effort, feeds historical data to your AI prediction engine, and also provides a high level summary to your CEO, and combines multiple databases into a unified view of inventory? Most companies have denormalize data to a great many materialized views, to support multiple use cases. I don't see how GraphQL gives you those materialized views for free. I admit, I have not worked with GraphQL since 2017, and maybe the eco-system has come a long way. But at the time, we were doing all the work ourselves, and much of it was redundant with other efforts we had ongoing.
- lkrubner 7y agoAre you sure? GraphQL, with no extra effort, gives your Business Intelligence unit everything they need? GraphQL, "for free", populates a hot cache of your 10% most active data? GraphQL, with no effort, feeds historical data to your AI prediction engine, and also provides a high level summary to your CEO, and combines multiple databases into a unified view of inventory? Most companies have denormalize data to a great many materialized views, to support multiple use cases. I don't see how GraphQL gives you those materialized views for free. I admit, I have not worked with GraphQL since 2017, and maybe the eco-system has come a long way. But at the time, we were doing all the work ourselves, and much of it was redundant with other efforts we had ongoing.
- thom 7y agoIf GraphQL advocates (and dare I say consultants) are suggesting you build every single part of your business off of GraphQL then yes that seems absurd. That’s not really how I’ve seen it used though.
- kthejoker2 7y agoSo ... assuming you have an OLAP engine or as a fallback some analytics-friendly MVs, couldn't GraphQL be laid on top of those, too? Why does it have to be either/or?