I've been looking at JSON API and keep getting hung up on scalability scenarios. Lets say you have a large collection (1000) of models, each with 3 or 4 relationships each.
From my understanding, JSON API requires you to specify at least the relationships with their associated id(s) (and optionally sideload the relationship with include). If that collection of 1000 models has to do a JOIN for every single relationship to be able to populate the valid JSON API payload like below:
...
{
"some_relationship_name": {
data: [
{ id: 1, type: "derp" }
...
]
}
}
I don't see how this can possibly scale in any reasonable way.
Aucun commentaire:
Enregistrer un commentaire