Skip to main content

19 posts tagged with "prisma"

View All Tags

Prisma vs Drizzle vs ZenStack: Choosing a TypeScript ORM in 2026

· 16 min read
Yiming
Co-founder of ZenStack

Cover image

If you've built a TypeScript backend in the last few years, you've probably used Prisma. It earned its place as the default choice — a clean schema language, an intuitive query API, and type safety that felt almost magical at the time.

But the TypeScript ORM space has quietly matured. Drizzle emerged as a serious alternative for developers who felt Prisma was too opinionated. And ZenStack v3 just completed a full rewrite that positions it not just as an ORM, but as a full-stack data layer.

Three tools, three distinct bets on what "great database access" means in 2026. This post breaks them down so you can pick the right one for your project.

ZenStack V3: The Perfect Prisma ORM Alternative

· 7 min read
Yiming
Co-founder of ZenStack

Cover Image

Prisma won the hearts of many TypeScript developers with its excellent developer experience - the elegant schema language, the intuitive query API, and the unmatched type-safety. However, as time went by, its focus shifted, and innovation in the ORM space slowed down considerably. Many successful OSS projects indeed struggle to meet the ever-growing demands, but you'll be surprised to find that many seemingly fundamental features that have been requested for years are still missing today, such as:

Typing Those JSON Fields? Yes, You Can!

· 5 min read
Yiming
Co-founder of ZenStack

Cover Image

SQL databases provide us with many benefits, the most important of which is strong schema enforcement. Yes, you pay the cost of migration when the schema changes, but the gain is far more significant - your code is clean because it can assume all data are in correct shapes.

However, once in a while, we want to break free from such strong guarantees for valid reasons. You may have some tiny objects that you want to attach to the main entities (e.g., metadata of an image) without formalizing them into a separate table. Or you need to store records with many possible sparse fields but want to avoid creating wide tables.

Building an Admin Console With Minimum Code Using React-Admin, Prisma, and ZenStack

· 13 min read
Yiming
Co-founder of ZenStack

Cover Image

Building a customer-facing application is exciting. But it's not much fun when it comes to the admin console part. However, almost every serious app requires some sort of admin console for operation needs. It doesn't need to be slick in design or have blazing-fast performance. The main focus should be reliability, cost-effectiveness, and extensibility.

There are many different types of admin consoles. In this post, we'll discuss the most common ones: those that allow non-technical people to make changes to the database and ensure proper permission management at the same time.

Modeling Authorization in Prisma - No Theory, Just Code

· 13 min read
Yiming
Co-founder of ZenStack

Cover Image

Authorization is a special topic for software development. You'll get many theories about different patterns if you do a search: their pros and cons. However, it's surprisingly difficult to find concrete examples to follow. It's mainly because the detailed approach highly depends on your specific application: its domain models, unique security requirements, and its choice of framework.

This post aims to fill the gap by targeting Prisma - the most popular ORM for TypeScript developers. By narrowing it down to a specific toolkit and language, we can explain the concepts more efficiently using code instead of words.

Tackling Polymorphism in Prisma

· 12 min read
Yiming
Co-founder of ZenStack

Cover image

EDIT 4/25/2024: the feature has been released in ZenStack V2.

Prisma is a beloved ORM for NodeJS developers. As with every popular open-source project, it has a long wishlist. Here are two prominent examples:

They are about the same thing and have received at least 1000 reactions in total. The ask is for modeling an inheritance hierarchy in the database. ORM’s responsibility is to fix the gap between the two world views: "table + relations" and "object-oriented". Polymorphism is an obvious missing piece in its mission.

From Prisma to TanStack Query: Fast Lane to Full-Stack Type Safety

· 6 min read
Yiming
Co-founder of ZenStack

Cover Image

Prisma is one of the most popular ORMs in the NodeJS world - loved by many for its intuitive data modeling and flexible query APIs. It shines for its concise and powerful syntax for querying relational data, and one great feature of it is to precisely infer the types of query results. Here's an example:

// `todos` is typed as `(Todo & { owner: User })[]`
const todos = await prisma.todo.findMany({
where: { published: true },
include: { owner: true }
});

TanStack Query (previously named react-query) is a widely used frontend data query library that greatly simplifies how we fetch, cache, and bind data when working with APIs. It also has excellent TypeScript support, allowing you to build fully typed data query hooks. Prisma and TanStack Query are frequently used together in a full-stack application.

Drizzle or Prisma? I Built an App Twice to Find Out Which Is Better

· 10 min read
Yiming
Co-founder of ZenStack

Cover Image

For TypeScript lovers, Prisma has been the perfect solution for building database-centric applications for quite a while. But recently, a new challenger has emerged. If you've been closely tracking the ORM space, you've probably heard of Drizzle, a new ORM being popularized by its flexibility, performance and better user experience. In this article, I'll quest for a comparison. Following the "Show, Don't Tell" mantra, I'll achieve it by building the same API twice, with Drizzle and Prisma, respectively.