-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Related collections: Performance vs. supporting non-HAL formats #2829
Comments
Core Meeting DecisionWe will drop JSON+LD "support" when we have performance problems @usu makes a performance analysis of the issue mentioned above |
Else the Get endpoint of camp executes a lot of additonal queries to fetch the ContentNodes. This breaks the json-ld support for this endpoint. (See ecamp#2829) Issue: ecamp#3539
Now we have performance problems with the additional queries. Core Meeting Decision
That this is transparent, it would be good to also remove json-ld and hydra from the error formats and the input formats. |
Related to this: https://github.com/api-platform/core/pull/5675/files# was merged and should be available in api-platform 3.2 This could be a alternative solution to avoid overloading of data |
Some related collections are expensive to compute, in the sense that they require additional database queries. Examples include
Period#getContentNodes()
andDay#getScheduleEntries()
.With our current implementation, we try to support not only the HAL JSON format, but also JSON+LD and GraphQL. For HAL, we sometimes add an annotation
#[RelatedCollectionLink]
, and the API response therefore only contains a filtered link like/content_nodes?period=/periods/1a2b3c4d
, so all the contentNode data which is fetched from the database is completely ignored afterwards. So if we were only supporting HAL JSON, there would be no need to perform these additional database queries. But omitting the queries would break the JSON+LD format and possibly also GraphQL (not sure about that one).This affects all API calls where a period or day entity is normalized (e.g. when loading or patching a single period, when loading all periods, when loading a camp with embedded periods, etc.)
This issue was originally raised by @usu in #2700 (comment) and the decision might influence how to proceed in a past discussion in #2683 (comment).
We should decide how we want to proceed with such getters on our entities. Probably we should assess the performance impact of these first.
The text was updated successfully, but these errors were encountered: