4 ms·
> It is unclear that the total impact on performance would be significantly negative compared to the typical GraphQL API. Some of the problems also apply to Gra
by namelosw 7y ago
> It is unclear that the total impact on performance would be significantly negative compared to the typical GraphQL API.
Some of the problems also apply to GraphQL, people just need to constrain the query complexity in the end.
But yeah, it would bite Datalog more if not designed well enough, and it's harder to tackle Datalog than to GraphQL.
Other thoughts on this topic:
I love GraphQL but I would love Datalog more if the toolchain is as good as GraphQL.
There's a spectrum on API of simplicity and power -- on the left, there is HTTP/REST which could be seen as a primitive/naive way of describing API it's not consumer-driven at all. On the right there's Datalog which is a powerful way of describing API, it can maximize the flexibility of both the server and the client.
Things like 'map' and 'filter' became well-known to average programmers not very long time ago, though the elite programmers already knew them well half a centry ago. Datalog is definitely a very good idea for API, but I'm afraid it wound't be as popular as GraphQL if Facebook chose this route instead.
That being said, the industry always adopts things in a very passive manner, usually because the current solution is too painful to use, or almost couldn't solve the problem on new problem scale. There's a documentary[0] for GraphQL, the creators had enough of REST, they ended up with inventing GraphQL. It originally was to solving their data fetching problems, in the meantime it would solve others too. Meanwhile, it pushed the common understanding of API for average programmer from left to right on the spectrum. If it's close enough to the right, more and more people would discover Datalog and buzz other people to use it.
Just like type system, it's hard to expect the industry have a deep understanding on the topic itself. Type systems similar to Java dominates the industry for a long time, though ML already existed almost half a centry. Recently, languages like TypeScript tookoff because people need to type existing JavaScript. Then people would discover that the type system they used to is far from enough to describe existing code design. It's like a pandora box, new type operator would came out every release, until people realize there's a spectrum of type system (Lambda Cube[1]), and Dependent T
ype would be on the same spot as Datalog on the spectrum.
[0] https://youtu.be/783ccP__No8?t=645 https://youtu.be/783ccP__No8?t=645
[1] https://en.wikipedia.org/wiki/Lambda_cube https://en.wikipedia.org/wiki/Lambda_cube