can apps using prisma only for the client/query be...
# prisma-client
k
can apps using prisma only for the client/query be deployed without the sidecar binaries now that node-api method is the default for accessing the engine?
1
r
No, node-api makes the connection direct as there was an HTTP server previously to connect to the binary. So the binary is still there but it will be faster.
k
No, node-api makes the connection direct as there was an HTTP server previously to connect to the binary.
So the binary is still there but it will be faster.
That's interesting. My understanding was that it is now in the form of a native node module (running in process) and separate from the query engine binary. Prisma also seems to be using napi-rs which is used to build native node modules using rust. Also, compiling prisma engines generates the binary and also the native node module. Continuing to use the external binary would severely limit the benefits of using node api, no?
The prisma docs seem to support this understanding: https://www.prisma.io/docs/concepts/components/prisma-engines/query-engine The docs make it seem that the node-api library and the binary are not dependant on each other but are mutually exclusive
r
The prisma docs seem to support this understanding: https://www.prisma.io/docs/concepts/components/prisma-engines/query-engine
If you see the diagram where
PrismaClient
connects to the Query Engine, that used to happen over HTTP. Node-API makes this a native connection removing the need for an HTTP connection that had an overhead.
This is the library that’s used instead of the executable. The executable binary is replaced with this one.
The query engine still remains in this form. Instead of a binary, it’s this.
k
I see what you mean. It's possible we're both saying the same thing! The highlighted file is exactly what I'm talking about. That's the native node extension that's used by the client in the node-api mode. This is different from the earlier engines which were standalone executables. The question I originally asked was whether we can avoid deploying the standalone executables (all four of them) when using prisma only for querying in the node-api mode (I understand we'll have to deployed the file highlighted above). I realise now that I could have worded the original question better..
💯 1
r
Yes only the query engine is needed to be bundled, be it in an executable or NodeAPI mode
🙏 1