Prisma Data Proxy vs Drizzle

Has anyone tried Prisma's data proxy? I'm currently just using Prisma regularly and it takes ~ 3 - 5 seconds to fetch a simple array from my DB and it's extremely inconsistent with response times varying, I use nextJS to write my API call
export async function GET(request: Request) {
  try {
    const url = new URL(request.url);
    const topicId = parseInt(url.searchParams.get("topicId") ?? "", 10);
    console.log("Received topicId:", topicId);

    const topic = await db.topic.findUnique({
      where: {
        id: topicId,
      },
      include: {
        subtopics: {
          select: {
            name: true,
          },
        },
      },
    });

    if (!topic) {
      return new Response(null, { status: 404 });
    }

    const subtopicNames = topic.subtopics.map((subtopic) => subtopic.name);

    return new Response(JSON.stringify(subtopicNames));
  } catch (error) {
    return new Response(null, { status: 500 });
  }
}

Client Side:
This call takes around 3-5 seconds from making the request to rendering it on the client side (I use react query on the client side). I was wondering if I use Prisma's data proxy would this be noticably faster? I'm aiming for around < 1s to 1s but as long as it's faster idm. Prisma's data proxy allows you to use the edge with Prisma which I'd rather do instead of switching to Drizzle however if Prisma's data proxy is still significantly slower than Drizzle I'd rather make the switch.

The biggest issue rn is cold starts which is why I want to use the edge, in their docs Prisma advertises "Faster cold starts" but I'm not sure how much faster it'll be. I console logged the time the response would take and the first (cold start) req takes: 2640.547416985035 milliseconds (2.6s) and after that it takes 487.4787500202656 milliseconds (0.487s). Is it worth using Prisma's data proxy or should I just switch to Drizzle?

Thanks
Was this page helpful?