Sources
1577 sources collected
news.ycombinator.com
We migrated to SQL. Our biggest learning? Don't use PrismaIn this case, hitting the Lambda size limit would have been the first red flag that triggered a re-evaluation of the whole approach. Understanding the limits of the stack (Prisma + PlanetScale) would have been obvious from a few simple toy examples. Seems like this team dove headfirst without even building a simple toy to determine if the choice was actually viable. … Survivorship bias is also a major problem. It's easy to presume that the winning bet you took is the right path. brightball on Oct 9, 2023 ... I do get the feeling they went YOLO and built their solution on an over-engineered approach with a stack they were unfamiliar with, and when they hit problems, they YOLO'd into another solution without properly evaluating why, which feels like a team of junior developers run amok. They also seemed to not really understand relational databases, and why foreign keys are kind of important when you are choosing a relation database implementation (yes you can do without them, but it's best to understand them first). Exuma on Oct 9, 2023 ... The library also looks like it was written in a yolo way as well. My guess is the graphql background has permanently stunted it, as the project manager keeps wanting examples for performance issues instead of realizing the entire fact joins are missing to begin with is idiotic and absurd. So my guess is they’re piecemeal fixing one off issues instead of fixing the problem at its root, probably because prisma code is not designed with that in mind from the beginning … The lack of rollbacks is one legitimate pain point and I wish they addressed it. DanielHB on Oct 9, 2023 mattacular on Oct 9, 2023 ... Tl;dr it's a design decision, not everyone (including me) agrees.
jackpordi.com
The BadI can't remember where I first heard about Prisma, but it was around 2 years ago. At the time, despite the fact that I was greatly impressed with what it could do and the approach it was taking, it seemed *too new* and yet to be considered battle-hardened enough. Various features such as transactions were missing, and the small community/userbase meant naturally meant documentation and bugs were not yet battle-tested. … - Forgetting to insert a field that is non-nullable - Typos in your query builder's string arguments - Selecting only specific fields will infer that the return type should include and *only* include those fields. - Ordering and filtering knows the types of the columns and what you can and can't do to each type. … - You quickly dive into having classes where 70% of the lines are just decorators. - Decorators aren't typesafe, it's possible to do a `@Column("varchar")` decorator on a `id: number` field. - Relations are messy, requiring having both `A` as a field in `B` *and* `B` as a field in `A` but no one tells you if you've done them wrong. … The main pitfall here is that most general purpose langauages (including TypeScript) just aren't good at describing or enforcing data models and (bi directional) relations. So, the Prisma team said *screw it, we're gonna write a custom language for this then generate the TypeScript types and client instead*. And in my opinion, that was a *fantastic* idea. Looking at the example (which can also be found on the main Prisma docs): … ## The Bad ### Prisma Schema can only be in a single file Far from a dealbreaker, but not ideal. There are a few third party solutions out there that will compile multiple prisma schema files together, but a first party solution doesn't feel like a lot to ask for - especially as the Prisma team is pushing the narrative that it's ready for production, and many databases out there have large numbers of tables which is going to result in a schema file that's thousands of lines long. Given that splitting code into different files/modules isn't exactly groundbreaking computer science these days, I would've really thought this would be done by now. ### Still many the typical limitations of an ORM Nested select queries work like a dream *but* like many other ORMs, more advanced queries like group-bys with nested relations or complex aggregates aren't really possible, at least not without falling back to raw SQL. Prisma also doesn't have a querybuilder API that can act as an intermediate step between the high level ORM API and raw SQL, which makes sense given their safety-first design philosophy, but also is sometimes missed for more complex queries. ### No nested create-many or delete API This one's pretty self explanatory. I don't really see any reason (apart from the complexity of the query generation) why we shouldn't be able to do a nested create-many like described here. Similarly, I also think there should be nested programmatic deletes rather than just specifying the cascade behaviour - after all, nested deletes already *kind of* exist when updating objects without deleting the parents. The API could just allow specifying (for one-to-one relations) which relations should be deleted along with the parent or not. ### Migrations API requires lots of care and manual intervention Ok, so the migrations API is actually *not* that perfect. Its features I mentioned earlier are still very much great, but I do have trouble with a few things: … Failed migrations, for some reason, require manually going into the database with write access to delete a failed migration entry. This is despite the fact that the migrations *do* run inside a transaction, so a failed migration has no effect on the database anyways. However, the docs honestly make it sound like migrations *don't* run inside a transaction by talking about manually applying or rolling back individual steps in the migration. My best guess is that Prisma didn't have a transactions API until not-that-long-ago (well, a year or so ago), and not a lot of effort has been made to update the migration API or docs to reflect this. … Combining with the previous point that Prisma recommends running Prisma CLI commands manually against your prod database to resolve failed migrations, it seems incredibly risky to me that someone will eventually press their arrow keys too many times and end up wiping the prod database. Migration creation also happens by looking at your development database and comparing it to your Prisma schema, instead of your previous migrations. This is another design decision which I don't agree with, as local dev database schemas can vary branch to branch and the developer may have forgotten to reset their database when they last switched the branch.
This quarter, our two major objectives are to deliver the Query Compiler to *Preview* and to enable the Prisma CLI to work in web contexts, such as StackBlitz or other web-based editors. We’re also improving the developer experience by: - Making Prisma-generated code ESM-compatible - Splitting Prisma's generated output into multiple files instead of one large file - Refining some tricky CLI commands (looking at you, `migrate dev`) ... As always, we're addressing a curated list of high-priority community issues alongside these major projects — this time targeting around 30 issues. … ## 3. ... Going forward, we’re deprecating the following behavior: - A deprecation warning will appear unless you specify an output path for generated code - Starting with Prisma 7, specifying an output path will be required We're also improving code generation quality: ... - Code will be **ESM-compatible** - We will no longer generate a `package.json` — you can define it yourself if needed ... Finally, we’re removing Prisma’s automatic loading of .env files. The `prisma.config.ts` file allows you to manage environment configuration directly for CLI commands, and we believe your ORM shouldn’t handle this behavior for your production application. Currently, this behavior is already disabled if a config file is present but retained for backward compatibility. In Prisma 7, it will be removed completely. … **Issues addressed by Query Compiler** - Context propagation for query logging #7596 - `prisma generate` tries to fetch engine checksum files from mirror even if custom engine locations are provided in an `.env` file #12593 - Allow `binaryTargets` as a CLI option #15267 **Issues addressed by Web-Compatible CLI** - Support Migrations, Introspection, Studio for Driver Adapters only databases (e.g. Turso, Cloudflare D1) #22184 - `__dirname is not defined` when generating PrismaClient to custom location, w/ SvelteKit #15614 - Support for Cloudflare's new SQLite database D1 #13310 … - `@prisma/nextjs-monorepo-workaround-plugin` is not able to handle multiple clients #18069 - Importing `enum` in browsers results in `Error resolving module specifier “.prisma/client/index-browser”. #12504 - Add support for Deno #2452 - Support ES6 modules export / ESM #5030 … **Issues addressed by Driver Adapters** - Using Prisma `NextJS` edge runtime leads to error #18763 - Set default values for schema `url` fields #222 **Issues addressed by promoting `schemaFolder` to GA** - Support for splitting Prisma schema into multiple files #2377 - bug(cli): `prisma format` does not format files other than `schema.prisma` when using `prismaSchemaFolder` preview feature #25136 - Feature: Remote schema #1563 … - Root `.env` variables aren't available to prisma in monorepo #12535 - Switch `.env` file based on `NODE_ENV` #3865 - importing prisma client pollutes `process.env` without using dotenv #19519 - Possibly reading `.env` file and schema twice #19117 … - Running `prisma migrate dev --create-only` actually applies previous (non-deployed) migrations #11184 - `migrate dev --create-only` with empty schema but existing database schema detects drift and warns about deleting all data #6579 - Allow calling `prisma migrate dev` programmatically by adding `--allow-non-interactive` flag #7113 - `prisma db reset` that resets the database, pushes the schema, and runs the seed function #11261 - `pnpm install` not running `prisma generate` #6603 - Large schemas generate huge `index.d.ts` causing slow autocomplete and type-checking in your editor #4807 … I agree, I find the lack of pg_vector support very serious as well. Raw Queries and typed sql do not really help here, because you then give up a lot of prisma's DX. Ideally prisma would not only allow you to declare Unsupported- db types in the schema (as it already allows you to do), but it would also provide a way to influence the query that is generated if you use such a type in the query.
dev.to
Why is prisma orm bad?If you're unfamiliar, Prisma is a well-known TypeScript ORM for PostgreSQL and MongoDB. It was the first ORM I learned to use, and this decision led to some difficulties later on. Prisma's primary issue is that its entity creation and database modeling only work with their own language. ### Why Is This a Problem? ... What's the problem here? At first glance, it might seem trivial, but it actually makes a lot of sense: with Prisma, you're forced to create all your logic using their programming language (or markdown language, I'm not sure what it's called). This specifically prohibits you from using external libraries or JavaScript code to build more reliable logic in your entities. ### Consequences Since you can't use JavaScript in your code, you should expect to waste a lot of time trying to figure out how Prisma's scaffolding language works and how to create schemas using it. There's also one very important detail: you can't use any external library or helper. Imagine a situation where you need to customize the way your primary keys are generated. With TypeORM, you can simply use this approach: … "Wait, are you saying that creating an easier ORM is bad?" No. I am saying that removing the flexibility of writing more raw-like queries to make the ORM easier can cause issues for developers, such as forgetting how to use SQL.
# The Problem No One Talks About in Prisma APIs ... Prisma has made SQL database access in Node.js incredibly clean. Schemas are readable. Type safety is excellent. Queries feel intuitive. But after building a few real-world APIs with Prisma, I ran into a problem that no one really talks about. Not performance. Not migrations. Not relations. … ## Copy-Paste Is Easy. Living With It Isn’t. At first, duplication feels fine. But over time: - one endpoint allows invalid filters - another rejects them - one sorts on any column - another breaks if you try - one handles booleans correctly - another treats everything as a string Nothing is technically broken. But nothing feels solid either. … ## Helpers Don’t Actually Fix This The obvious move is a helper function. Most teams try it. Most teams regret it. Helpers tend to become: - too flexible to be safe - too strict to be reusable - hard to reason about - impossible to extend cleanly And many of them go one step too far — they **run the Prisma query for you**. … ## Strict by Default (And That’s the Point) Most bugs here don’t come from bad code. They come from: - unexpected query params - invalid filters - unchecked sorts Prisma Query Builder blocks those immediately. Not silently. Not later. **Immediately.** The API becomes predictable — not just for users, but for developers too.
www.ryanyogan.com
I still love Prisma in 2025## Performance? Please, I'm Building Fun Stuff Here Let me be crystal clear about something: **performance optimization is the last thing I care about** for my personal projects. I'm not Netflix. ... When someone starts going on about "Prisma adds 20ms overhead compared to raw SQL," I want to ask them if they've fixed the 12 N+1 queries in their codebase or if they're still loading 5MB of uncompressed JavaScript on their landing page. A real Twitter rant I saw: "Spent 2 weeks optimizing my ORM queries to save 30ms, then realized my app was downloading a 2MB hero image. Reduced that to 200KB and saved 500ms. I am not a smart man." ... So for my personal and fun projects, the performance argument is moot. And let's be honest, in most real-world apps, the bottle neck is usually `us`, we cause the issues because we favor features over quality it would appear. … **Cons:** **New Kid Problems:**As one memorable tweet put it: *"Drizzle looks amazing until you need that ONE feature Prisma has had for years. Then you're writing a plugin at 2am on a Tuesday while questioning your life choices."* **Documentation That Assumes You're Already Friends:**Half the time I'm looking for basic examples, not philosophical treatises on database abstraction. The docs often feel like walking into a conversation that's already halfway finished. … **Framework Agnostic:**Works with any TypeScript project, which is nice when you're hopping between frameworks faster than a caffeinated rabbit. **Cons:** **Documentation From The Twilight Zone:**Finding the right way to do anything is like solving a puzzle where half the pieces are in a different box. A GitHub issue literally titled *"Documentation is like trying to learn Spanish by reading French"*has 200+ upvotes. **Migration System That Makes Me Question Reality:**I've had more predictable experiences with the weather than running TypeORM migrations. One memorable Reddit thread: *"My TypeORM migration dropped a production table and now I'm updating my resume."* **Active Record AND Data Mapper Patterns:**Can't decide which pattern to use? TypeORM said "why not both?" and created twice the confusion. It's like a restaurant serving both Italian and Chinese food—suspicious from the start. … **API Inconsistencies:**Methods like `findOne`, `findAll`, `findAndCountAll`take slightly different parameters in ways that will drive you to drink. Why is it `include`in some places and `includes`in others? Nobody knows! … **Lightweight:**It won't add 50MB to your Lambda function, which is nice. **Cons:** **No Schema Management:**Hope you like defining your schema in both your database and your code! Double the maintenance, double the fun! **No Relations Handling:**Want to fetch a user with their posts and comments? That's several manual queries or some custom code, pal. A Twitter rant I saved: *"Knex is great until you need to fetch related records, then it's DIY hour at the database factory."* … **The Query API Is... Something:**It's powerful, but the syntax is its own special language. `{ $in: [...] }`anyone? It's SQL, Jim, but not as we know it. **Performance Cliffs:**Things work great until they don't. That collection with 10,000 documents performs fine until it hits 100,000 and then your server catches fire. Real tweet: *"Our MongoDB queries went from 5ms to 5s overnight. Turns out we crossed some invisible performance threshold."* … **Cons:** **Manual Everything:**Hope you like writing `JOIN`statements by hand and updating them every time your schema changes. A Reddit comment that hit home: *"I switched to raw SQL for 'performance reasons' and spent the next 6 months fixing broken queries every time we changed the schema."* **Type Safety? LOL:**Enjoy casting your result sets manually and hoping you remembered the column types correctly. Was that an INTEGER or a BIGINT? Surprise! **Migration Management:**Roll your own or use a separate tool. Either way, it's more work than using an integrated solution.
www.youtube.com
They Finally Fixed PrismaThey finally fixed my least favorite things about Prisma. The Prisma Rust engine makes it so TypeScript people can hardly contribute, makes Prisma literally undeployable (💀) to Cloudflare workers and is just.. bloat? The 7.0 update changes that 👀 -- links ... {ts:781} But as time has progressed, we found that this impacts developer workflow {ts:784} significantly. If the client needs to be {ts:786} updated, any app specific processes need to be stopped first before regenerating {ts:791} the types, which was annoying and also
accuknox.com
Top 5 Prisma Cloud Alternatives For 2025- **High Cost:** Prisma Cloud’s pricing can be difficult to justify for some teams. *“Can be pricey – the cost adds up, especially for smaller teams,”* notes one G2 reviewer. Others mention that the price is *“hard to digest”* when comparing vendors. Budget-conscious organizations may seek a tool with a more flexible or lower-cost pricing model. - **Complexity & Learning Curve:** Users have reported that Prisma Cloud can be complex to deploy and manage. According to reviews, *“the initial setup can be a bit complex and time-consuming, especially for new users”*. Another user mentions *“a steep learning curve, complex user interface”* that can feel overwhelming. Teams lacking extensive DevSecOps expertise might prefer an alternative that is easier to implement and use. - **Limited Feature Support or Flexibility:** Some find that certain Prisma Cloud features are rigid or lacking. For example, *“some of the features feel a bit hidden or not fully documented”*, making it harder to realize the full value. If Prisma Cloud’s modules don’t fully meet an organization’s needs (such as advanced runtime defense or specific compliance frameworks), an alternative with a different feature focus could be attractive. … ### Cons: - Steep learning curve to fully leverage Polygraph analytics - Possible alert delays due to anomaly analysis time - Limited third-party integrations compared to some competitors - Premium pricing with complex usage-based licensing in some cases - ML models may require tuning for very unique environments
www.youtube.com
Why Prisma Might Not Be a Good Choice for Your ProjectBut it's not good in every use case. The awesome DX comes with some large trade-offs I didn't even know about until I dug further into this topic. ... {ts:0} so using Prisma as your or M for any of your next projects might not be the best {ts:6} choice actually especially with the whole move towards the edge and just how easy versel has made that in nexgs {ts:12} specifically Prisma is becoming less and less of a viable alternative because due to how it's architected it doesn't even … {ts:103} with but there are also downsides for example it's pretty inefficient I recently saw a video by code them that I {ts:110} found really interesting in which he explained why this is the case and the way Prisma Works under the hood with its {ts:116} rust binary is that it fetches both table if you want to create something like an SQL join in SQL itself that is {ts:125} optimized in Prisma the Prisma just goes ahead and fetches from the one table fetches from the other merges them {ts:131} together resulting in a pretty inefficient data querying and that becomes especially painful when you're {ts:137} paying your database provider whatever that might be based on how many rows are read like for example Planet scale that {ts:145} inefficiency can become pretty expensive for you yep and then besides the inefficiency there's no Edge {ts:150} compatibility and that's also because of the rust binary that we're using right here the query engine that's kind of the {ts:156} problem why we can't use Prisma on the edge so if those are trade-offs you cannot take in your app because you … {ts:302} it perfect no it has downsides first off it's not intuitive for everyone if you don't know SQL you're gonna have a hard {ts:307} time writing drizzle if you don't know SQL you're going to have a pretty easy time writing Prisma doesn't really {ts:312} affect you negatively secondly the setup is more complicated especially the migrations and running the migration
**Issues addressed by Query Compiler** - Context propagation for query logging #7596 - `prisma generate` tries to fetch engine checksum files from mirror even if custom engine locations are provided in an `.env` file #12593 - Allow `binaryTargets` as a CLI option #15267 **Issues addressed by ESM Support + Driver Adapters** … - Error building locally a Remix v2 site in a sst v2 app #27719 - Types not exposed properly in monorepo with `prisma-client` provider #27600 - new prisma-client generator + queryCompiler: require() of ES Module #27572 - Prisma Postgres Adapter with Turborepo does not work #27083 … - Root `.env` variables aren't available to prisma in monorepo #12535 - Switch `.env` file based on `NODE_ENV` #3865 - importing prisma client pollutes `process.env` without using dotenv #19519 - Possibly reading `.env` file and schema twice #19117 … - Running `prisma migrate dev --create-only` actually applies previous (non-deployed) migrations #11184 - `migrate dev --create-only` with empty schema but existing database schema detects drift and warns about deleting all data #6579 - Allow calling `prisma migrate dev` programmatically by adding `--allow-non-interactive` flag #7113 - `prisma db reset` that resets the database, pushes the schema, and runs the seed function #11261 - `pnpm install` not running `prisma generate` #6603 - Large schemas generate huge `index.d.ts` causing slow autocomplete and type-checking in your editor #4807 … - 6.8.1 hotfix init error still exists #27195 - Prisma cannot find the prisma client module #27194 - Prisma 6.8.0 init error on Windows - Only URLs with a scheme in: file, data, and node are supported by the default ESM loader #27192 … - Generated client cannot be used on frontend #27156 - D1 adaptor throws "Conversion failed: expected a datetime string in column" when string column contains rfc3339 date #27143 - Fetching with `include` on one-to-one related field only gets first relation #27137 - bun run build error with prisma ^6.7.0 #27136 - `prisma generate --watch` always uses cached version of `schema.prisma` file #27128 - Query compiler cannot handle join on columns with @map defined #27111 - Sveltekit / Build step: "PrismaClient" is not exported by "../../packages/database/generated/prisma/index.js" #27109 … - can't import enums on browser from the new generated client (Vite) #27073 - [queryCompiler] undefined _count value when counting relations #27055 - How Prisma Client interacts with PgBouncer in session mode #27054 - [6.7.0] queryCompiler with pg has any retrieval of fields with dates be an empty object #27050 - queryCompiler: “TypeError: createRequire is not a function” #27049 - new prisma-client generator with next.js/webpack: can’t resolve `./client.js` #27048 - JSONB column not being parsed with queryCompiler #27039 - [Bug] [6.7.0] V6 unable to find existing migrations #27038 - [6.7.0] Schema ignored #27037 - [6.7.0] Client generated by prisma-client doesn't work with strictest tsconfig #27032 - [6.7.0] Apparent bug with `queryCompiler` feature (repro included) #27031 - [6.7.0] Bug: When using the queryCompiler feature, String[] fields are returned as comma-separated strings (e.g., "a,b,c") instead of proper arrays ([a, b, c]) #27029 … - [Postgresql] Dropping constraint will occur an unexpected error. #26622 - No relation tables generated when using views in many-to-many relations #26593 - Slow performance during create with CITEXT column #26400 - feat(@prisma/instrumentation): include additional query context (ideally db.query.summary) #26081 - Custom migrations path #26027 - `Option::unwrap()` on a `None` value for specific operations when enabling `relationJoins` feature #25802 - Possible memory leak using driver adapters with cloudflare D1 #25714 - createManyAndReturn fails with @ignore fields (field must be a known scalar or virtual) #25290
is listed as a future capability per the Prisma roadmap. - Requires Prisma's proprietary schema DSL rather than standard SQL DDL, which may create friction for teams with DBA workflows. - Large schemas (100+ models) can cause type generation performance issues, as documented in GitHub Issue #3051. … ### Cons - Query construction is not fully type-safe. Per Prisma's technical comparison: "Only the query results have type information. You can write invalid queries with Drizzle." Invalid queries may be syntactically valid TypeScript but produce runtime SQL errors. - Smaller ecosystem compared to established ORMs. - Fewer abstractions compared to traditional ORMs — requires solid SQL knowledge.
reviewgudian.com
Prisma Review 2025: The ORM Debate Is Not Settled Yet… The tricky part is that you're learning a custom DSL. It isn't TypeScript. It isn't SQL. It is Prisma Schema Language. For most things this is fine because it's intuitive. But when you hit edge cases -- composite keys, database-specific column types, complex default values -- you sometimes find yourself fighting the schema language to express something that would be straightforward in raw SQL. I had a situation where I needed a PostgreSQL jsonb column with a specific default. Getting it right in the schema took about twenty minutes of documentation reading. In raw SQL it would have been one line. … Where it gets painful is team environments with parallel development. If two developers create migrations on separate branches, merging them creates a conflict in the migration history that Prisma doesn't resolve automatically. You have to manually fix the migration order, which usually means resetting and re-running migrations against the development database. This isn't unique to Prisma -- most migration tools have the same problem -- but it's worth calling out because some teams hit it frequently. Data migrations are another area where Prisma Migrate is limited. If you need to transform data as part of a schema change -- say, splitting a fullName field into firstName and lastName -- Prisma will generate the structural migration but you have to write the data transformation yourself in raw SQL within the migration file. This works, but it breaks the flow of the "just modify the schema and run migrate" experience. ## The Performance Conversation Here is where the ORM debate gets real. Prisma runs a query engine -- a Rust binary -- that translates your Prisma Client calls into SQL. This engine adds overhead. On a traditional server, the overhead is small enough to not matter for most applications. Queries typically add 1-5 milliseconds of overhead compared to raw SQL, which is negligible when your average API response time is 50-200 milliseconds. In serverless environments, though, the story changes. The query engine binary is about 13MB, which increases your deployment bundle size and adds to cold start times. On AWS Lambda with a cold start, I measured about 300-500 milliseconds of additional latency from Prisma initialization. Prisma Accelerate (their managed connection pooling and caching service) helps with this -- it moves the query engine to a persistent proxy -- but it adds a dependency on an external service and a per-query cost. … ### Cons - The Rust query engine binary adds ~13MB to bundles and noticeable cold start latency in serverless - Complex queries sometimes generate unexpected SQL -- multiple queries instead of JOINs - The schema DSL is another language to learn and occasionally fights you on edge cases - Migration conflicts between parallel branches require manual resolution - Raw SQL escape hatches work but you lose Prisma's type safety when you use them … But the tension I keep coming back to is this: every time Prisma's abstraction hides the SQL, it's also hiding a potential performance issue. And every time I reach for $queryRaw to write manual SQL, I'm stepping outside the safety net that makes Prisma valuable in the first place. The abstraction gives you speed of development. The leaks in the abstraction take it back. For most web applications, the math favors Prisma. For performance-sensitive applications with complex data access patterns, I'm less certain.