Prisma is a database agnostic GraphQL API layer for Node.js

Prisma is a new project from the Graphcool team. Following the Graphcool Framework, this is another GraphQL focused project from the BaaS (Backend as a Service) company from Berlin. Like PostGraphile, just announced - Prisma generates a GraphQL compliant API from a database.

The idea behind Prisma is surprisingly simple. With schema definitions required in relational database management system (RDBMS) like PostgreSQL, MySQL, Oracle, etc. the storage layers itself can contain logic and metadata that needs not be replicated on the application layer.

The open sourcing of Graphcool Framework in October 2017 provided the community with a powerful and flexible backend service that was not locking developers and organisations to any single API provider or a proprietary cloud service from AWS, Azure or GCS. This resonated well with people weary of limited flexibility and potentially large cost.

Graphcool framework is a comprehensive product that availables building APIs from scratch to creating GraphQL wrappers for RESTful APIs for easy client consumption. Prisma on the other hands is strictly focusing on providing a layer that uses the database functionality natively to provide uniform GraphQL APIs complete with rate-limiting, authentication and logging.

PostGraphile vs Prisma

The PostGraphQL project, now known as PostGraphile, does a similar task - generating a GraphQL API from a PostgreSQL database schema alone. The to projects share similarities, both are written in JavaScript and run on the non-blocking Node.js platform. There are, however two notable differences:

PostGraphile expects developers to craft their schema manually using SQL schemas , where as Prisma allows definition using the GraphQL SDL notation

expects developers to craft their schema manually using , where as allows definition using the notation PostGraphile builds heavily on the PostgreSQL database, and is currently not portable, where as Prisma currently supports only MySQL, but it's pluggable architecture can accomodate other SQL databases, NoSQL databases like MongoDB and even Graph Databases like Neo4j and Dgraph

In 2018 there are now many robust alternatives for creating GraphQL APIs in a rapid fashion. Combine this with the number of universal JavaScript frameworks using React and other libraries like Vue.js, it seems like the combination of of GraphQL is now the most contemporary action.

Building apps with GraphQL and Next.js, for example, is already very cost effective and sustainable for commercial use - as proven by NPM, Docker and others. Another windfall benefit is using TypeScript and GraphQL for improved autocompletion during development.