Serverless functions
If your application is deployed via a "Serverless Function" or "Function-as-a-Service (FaaS)" offering and uses a standard Node.js runtime, it is a serverless app. Common deployment examples include AWS Lambda and Vercel Serverless Functions.
If Prisma’s Rust engine binaries cause large bundle sizes, slow builds, or deployment issues (for example, in serverless or edge environments), you can switch to the queryCompiler
Preview feature introduced in v6.7.0.
When enabled, Prisma Client is generated without a Rust-based query engine binary, reducing build artifacts and removing native binary dependencies:
generator client {
provider = "prisma-client-js"
previewFeatures = ["queryCompiler", "driverAdapters"]
}
Note that the driverAdapters
Preview feature is required alongside queryCompiler
.
When using this architecture:
- No Rust query engine binary is downloaded or shipped.
- The database connection pool is maintained by the native JS database driver you install (e.g.,
@prisma/adapter-pg
for PostgreSQL).
This setup can simplify deployments in:
- Serverless functions
- Edge runtimes
- Read-only filesystem environments
- CI/CD pipelines with strict size limits
Learn more in the docs here. Curious why we're moving away from the Rust engine? Take a look at why we're transitioning from Rust binary engines to an all-TypeScript approach for a faster, lighter Prisma ORM in our blog post.
Guides for Serverless Function providers
Deploy to Azure Functions
This guide explains how to avoid common issues when deploying a Node.js-based function app to Azure using Azure Functions.
Deploy to Vercel
This guide takes you through the steps to set up and deploy a serverless application that uses Prisma to Vercel.
Deploy to AWS Lambda
This guide explains how to avoid common issues when deploying a project using Prisma ORM to AWS Lambda.
Deploy to Netlify
This guide covers the steps you will need to take in order to deploy your application that uses Prisma ORM to Netlify.