Menu

React, etc. Tech Stack

React, Flux, GraphQL, Hack, HHVM...? All of this and more!

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:

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.

Written by Jorgé on Tuesday January 16, 2018

Permalink - Tags: graphql, typescript, prisma

« Next.js to adopt React Router - Automatic React PropTypes to TypeScript Conversion »