Hi Dimuthu,

I have been wondering if GraphQL will be worthwhile to explore for such bulk 
retrieval’s? I think this will be a low hanging fruit for us to try to 
integrating with something like Hasura[4] it is dominantly used for Postgres 
but they have been actively supporting MySql as well [5] 

I am not sure if this will address you point out though, since GraphQL spec 
doesn’t support recursive nested objects [6], simple one to many seems to be 
supported [7] but not bi directional.

Suresh

[4] - https://github.com/hasura/graphql-engine 
<https://github.com/hasura/graphql-engine>
[5] - https://hasura.io/docs/1.0/graphql/core/guides/mysql-preview.html 
<https://hasura.io/docs/1.0/graphql/core/guides/mysql-preview.html> 
[6] - https://github.com/graphql/graphql-spec/issues/91 
<https://github.com/graphql/graphql-spec/issues/91>
[7] - 
https://hasura.io/docs/1.0/graphql/core/schema/table-relationships/database-modelling/one-to-many.html
 
<https://hasura.io/docs/1.0/graphql/core/schema/table-relationships/database-modelling/one-to-many.html>
 

> On Sep 22, 2020, at 11:01 AM, DImuthu Upeksha <[email protected]> 
> wrote:
> 
> Hi Folks,
> 
> I just noticed that the entity relations that have bidirectional definitions 
> (OneToMany and ManyToOne) between 2 tables cause recursive object fetching 
> and it is causing a significant performance drop in database querying. For 
> example [1] and [2]. When we fetch an experiment output, I can see a stack of 
> experiment -> experiment outputs -> experiment ....
> 
> Same issue was mentioned in [3] but the solution is for spring boot json 
> parsing. As we don't use spring boot, we might have to figure out some other 
> way to stop this recursive stack creation.
> 
> [1] 
> https://github.com/apache/airavata/blob/master/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentEntity.java#L88
>  
> <https://github.com/apache/airavata/blob/master/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentEntity.java#L88>
> [2] 
> https://github.com/apache/airavata/blob/master/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentOutputEntity.java#L80
>  
> <https://github.com/apache/airavata/blob/master/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentOutputEntity.java#L80>
> [3] 
> https://medium.com/@udith.indrakantha/issue-related-with-infinite-recursive-fetching-of-data-from-relationships-between-entity-classes-ffc5fac6c816
>  
> <https://medium.com/@udith.indrakantha/issue-related-with-infinite-recursive-fetching-of-data-from-relationships-between-entity-classes-ffc5fac6c816>
> 
> Thanks
> Dimuthu

Reply via email to