I’m just starting to find out that nexus-prisma is...
# orm-help
t
I’m just starting to find out that nexus-prisma is adding a massive amount of overhead to our queries. Up to 16 seconds in some cases
Here’s a somewhat recent issue talking about it: https://github.com/prisma/prisma/issues/4712
I’m just letting others know, if you’re considering nexus, because it’s clearly being recommended by the official team, stay away from it until they get performance resolved
If we hit our fargate endpoint with the query, 2 seconds, if we hit our local docker graphql server with nexus, and then hit the fargate endpoint from that local server, 18 seconds
j
😳
t
It seems to only be bad with really big queries with lots of relations. Other smaller queries are still pretty fast.
It’s only if you are constructing larger queries with whitelisted operations from nexus from your frontend
a
That's strange, I'm not seeing any such issues.
It does take time if our Lambdas are cold, but once that first hit is made it speeds up.
t
Sounds like you’re using lambdas though, are you constructing larger queries on the frontend that are whitelisted through nexus?
a
I am dealing with huge data sets. I normally keep queries to 2 nodes deep or I can cause the server to overload. My master server connects to two Prisma instances and 2 lambdas running Python implementations of GraphQL. I am using Nexus-Prisma and passing all queries and mutations through except delete Mutations. I am using GraphQL Shield as middleware.
I also have to limit the queries as we have millions of records, and there is just no point in fetching millions of records which a user will never look at, and it can overload the Lambdas size limit. I work for one of the largest data brokers in the world.
t
That’s good to hear that it’s performing that way at that scale. Ya I think we’re just going way too nested, like 7 nodes deep some times
But even still, that exact same 7 nodes deep query performs way faster moving it to the backend using the prisma client
a
If you are going 7 nodes you you are going to get exponential growth in the size, so that's X^(7y) data it's fetching. Why do you need to go so deep? If you are using Apollo Client you can just get them in small groups and it will cache the data.
The slow down is probably caused by the way Apollo Server is handling the queries, it may be breaking it up into 7 sub-queries and then executing them asynchronously.