4 ms·
How is this different from any other ORM library?
by glutamate 8y ago
How is this different from any other ORM library?
- matthewmueller 8y agoYou can think of Prisma as the next version of ORM technology. Prisma shares the same goals of an ORM (make data access easy), but takes a completely different approach than past ORMs. Prisma uses introspection to generate a feature-rich, type-safe library around your database's schema to reduce or eliminate most of the downsides you traditionally associate with ORMs. Type safety Today's ORMs rely on query builders (e.g. await select('users').where('id', 10)) or hand-written classes (e.g. class Product < ApplicationRecord) to map an object to a row. Prisma looks to the database for the information about types and relationships to generate type-safe code specific to your database in every language (e.g. prisma.Products.FindByName("Sponge")). Bugs caught at compile-time Another downside of today's ORMs most of them break at runtime, rather than compile time. By generating type-safe database clients, Prisma eliminates any opportunity for breaking database changes to go unnoticed and end up in production. Better performance There are a couple advantages of Prisma has over traditional ORMs and raw SQL queries: • The core of Prisma is written in Rust to have predictably high-performance and flexible caching. • Prisma is written by database experts and administrators who have seen every database schema under the sun. Fewer Leaks Because Prisma has a holistic view of your database's structure, Prisma can generate an API that is better tailored to your application than a traditional ORM. There may be times when you still need to write raw database queries and Prisma will support these escape hatches, but those times are rare and are becoming less common every day.
- nikolasburk 8y agoI work at Prisma and this is one of the questions we're currently hearing the most (we'll actually publish a blog post about this exact question soon). Generally, think of Prisma as a suite of database tools that simplify workflows in three different areas: ● Database access / ORM (lightweight, auto-generated and type-safe database client for various languages) ● Declarative data modelling and migrations ● Data management with modern admin UI I think it also differs from traditional ORMs in that it supports multiple databases. We see a trend that many modern apps are built on top of a variety of databases, it might use Posgtres, Elastic, Mongo and Neo4j all at the same time for different purposes. We are embracing this and with the Prisma client it will be possible in the future to access all these data sources in a single, coherent and type-safe API. Feel free to check out our roadmap to get an idea of what we're working on: https://github.com/prisma/prisma/blob/master/ROADMAP.md https://github.com/prisma/prisma/blob/master/ROADMAP.md