Accelerate & Edge

Preview — 3 of 10 questions

What does Prisma Accelerate provide beyond standard Prisma Client?

AAccelerate replaces Prisma Client entirely and rewrites queries in a faster language
BAccelerate only adds connection pooling; caching is handled by a separate Prisma Cache extension
CAccelerate is a globally-distributed connection pooler and query cache layer; it provides connection pooling (eliminating cold start connection exhaustion in serverless), global caching with configurable TTL per query, and stale-while-revalidate semantics
DAccelerate is only available for MongoDB; PostgreSQL uses Prisma Pulse instead

How do you configure Prisma to use models across multiple PostgreSQL schemas?

ACreate separate schema.prisma files for each PostgreSQL schema
BMulti-schema is not supported in Prisma; use FDW (Foreign Data Wrappers) instead
CEnable previewFeatures = ["multiSchema"] in the generator block, add schemas to the datasource block, and use @@schema("schema_name") on each model
DSet schema = ["public", "billing"] directly on the datasource URL

How do you implement Row-Level Security with Prisma in a multi-tenant application?

AUse Prisma middleware to add WHERE tenant_id = ? to every query automatically
BUse Prisma's built-in tenantId field type that automatically enforces isolation
CPass tenantId as a parameter to every Prisma query using the where clause — RLS cannot be used with Prisma
DUse prisma.$executeRaw(Prisma.sqlSET app.current_tenant_id = ${tenantId}) at the start of each request to set a session variable, then configure RLS policies in PostgreSQL to use current_setting('app.current_tenant_id')

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.