May 15, 2024

Explore insights and improve app performance with Prisma Optimize

Introducing Prisma Optimize—a whole new way to debug performance-related issues, make your app faster, and learn about the Prisma ORM internals!

Prisma Optimize in Early Access

Have you ever wondered about the SQL queries that Prisma ORM crafts behind the scenes? Or perhaps you've aimed to enhance your application's performance and user experience? Prisma Optimize is here to transform how you understand and improve your project.

Prisma Optimize provides unprecedented access into the inner workings of the Prisma ORM, offering complete transparency over the generated SQL and operational efficiency.

We are launching Optimize in Early Access today and will add several exciting new features over the coming months. We invite you to give us feedback and help shape the future of this product.

A real-world example

To demonstrate the power of Prisma Optimize, I've taken Dub.co—a prominent open-source project utilizing the Prisma ORM—and created a video walkthrough showcasing how Prisma Optimize helps me get a handle on what is going on under the hood.

Why database performance bottlenecks cause apps to slow down

Slow applications frustrate users and can hinder business growth. Often, the root cause lies within database interactions, which can be complex and opaque. Inefficient queries, excessive data fetching, and poorly optimized database schemas are common culprits that degrade performance.

Prisma Optimize addresses these issues head-on by providing clear insights into your database operations. It enables developers to pinpoint slow queries, recognize over-fetching of data, and identify inefficient relationships in your database schema. With Prisma Optimize, you can streamline your database interactions to significantly speed up your application, ensuring a smoother and more responsive user experience.

Prisma Optimize not only helps you diagnose performance problems but also educates you on the intricacies of database management, making it an indispensable tool for developers looking to excel at optimizing application speed while learning new skills and knowledge.

A comprehensive tool for data-driven application development

Optimize is a Client Extension that can be enabled in any app that uses the Prisma ORM. It seamlessly collects performance information from your app by integrating with Prisma ORM’s robust observability and logging infrastructure. This data is then transmitted and displayed in an intuitive dashboard providing clear and actionable insights. Moving forward, as we grow the product features for Optimize, we will include features that make recommendations on how to address the issues we uncover. Stay tuned!

Prisma Optimize is a tool you use during development, and the general workflow looks something like this:

  • You identify an aspect of your app that you want to analyze. This could be a UI interaction or a background processing job.
  • You then enable Optimize and activate this part of the app - for example, by clicking around on the website or hitting an API endpoint.
  • Optimize will actively collect all executed Prisma ORM queries along with crucial performance metrics such as query latency, frequency, and any associated errors. It also provides visibility into the exact SQL generated for each query.

Try Optimize today and enhance your application's performance for free

Getting started with Prisma Optimize is quick and easy. Whether you're looking to enhance an existing application or explore its capabilities through a demo, Optimize is designed for immediate integration and rapid results.

To get started, simply install and integrate Prisma Optimize into your existing application or experiment with a sample app:

  1. Install the Optimize extension:

  2. Enable the tracing preview feature, and run npx prisma generate:

  3. Extend your Prisma Client with the Optimize extension:

  4. Run your app.

    You will be prompted to sign in with a Platform account.

  5. Check the results on your Optimize dashboard (grab the link from the terminal output).


Try Optimize now

Don’t miss the next post!

Sign up for the Prisma Newsletter