News for hackers. Stuff that matters.
Re:Best practices for REST API design (2020) by throwoutttt on Monday February 22, 2021 @11:24AM (#26226304)
For comprehensive APIs,GraphQL is often more performant. 1 request that takes 500ms is far better to 5 requests that take 200ms
Re:Best practices for REST API design (2020) by cunac on Monday February 22, 2021 @01:31PM (#26228326)
depends, if all requests are parallel they should hit different instances and that would distribute load more efficiently instead of pinning to single instance. You would actually get response in 200ms not to mention that your ability to properly size each node is increased. It also enables you to have a grey area where response can be partial and not just fail/pass. As usual YMMW depending on use case.
Re:Best practices for REST API design (2020) by systemvoltage on Monday February 22, 2021 @12:49PM (#26227623)
You can create a single endpoint that's non-RESTFul to make a single call.
Re:Best practices for REST API design (2020) by adamscybot on Monday February 22, 2021 @01:13PM (#26228001)
Yes and by doing so you lost the advantages of a predictable and well organised API.

GraphQL has first class support for this scenario.

Re:Best practices for REST API design (2020) by systemvoltage on Monday February 22, 2021 @03:29PM (#26230142)
I disagree. You're shifting your "organization" to the frontend which becomes an utter cesspool of chaos. If anything changes in the backend, you will need to change the frontend as well.

The whole point of an API is to decouple. GraphQL does the exact opposite.