Kul
09/11/2021, 7:56 AMRyan
09/13/2021, 5:55 AMKul
09/14/2021, 7:02 AMNo, 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?
Kul
09/14/2021, 7:13 AMRyan
09/14/2021, 7:42 AMThe prisma docs seem to support this understanding: https://www.prisma.io/docs/concepts/components/prisma-engines/query-engineIf 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.Ryan
09/14/2021, 7:45 AMRyan
09/14/2021, 7:46 AMKul
09/14/2021, 8:40 AMRyan
09/14/2021, 9:42 AM