docs/1.1/04-Reference/01-Introduction/What-is-Prisma.md
Prisma is a GraphQL database abstraction layer that turns your database into a GraphQL API. Rather than directly writing SQL or using a NoSQL API (like MongoDB), you get to interact with your data using GraphQL:
When building a GraphQL server with Prisma, you are dealing with two GraphQL APIs that represent two separate layers inside your backend:
Both layers are glued together using Prisma bindings.
Building a GraphQL server with Prisma involves four major steps:
The database schema is the foundation for the database layer, the application schema defines the API of the application layer.
The application schema can be thought of as a "mask" for the database schema. It is used to tailor an API that matches your application's needs rather than exposing full CRUD capabilities to all clients. (You usually don't want to expose your entire database to your client applications.)
Considering the classic three-tier architecture of client, (web) server and database, Prisma is a layer which connects your database with the server. In that sense, it can somewhat be thought of as an ORM, but comes with many additional benefits compared to conventional ORMs - most importantly: it enables an idiomatic way of building GraphQL servers!
When implementing your GraphQL web server, you can use GraphQL bindings, and in particular the prisma-binding package, to conveniently implement your Prisma resolvers. In short, prisma-binding allows to simply forward incoming queries to Prisma's powerful CRUD API.
When working with Prisma, you typically have the following components in your stack:
graphql-yoga)Client applications are the apps that will end up in the hands of your users. This can be a web app written with React, Angular or any other framework or a native mobile app for Android or iOS.
The GraphQL web server is the server from the three-tier architecture. It is responsible for business logic and other common pieces of functionality, like authentication and permissions. The GraphQL server exposes a GraphQL API that's defined in the application schema.
Prisma is the glue between your database and the GraphQL web server.
The database provides the actual persistence layer for your backend.
Prisma is sometimes, somewhat inaccurately, referred to as a “GraphQL database”. Note that at a high-level, a database has two major roles:
In that sense, Prisma is not a database because it only provides a data access layer - but does not have a built-in data store! The term "GraphQL database" therefore refers more to the architectural role of Prisma in a server-side setup.
Prisma is free and entirely open source. You can run Prisma in production on custom infrastructure or using your preferred IaaS provider (such as AWS, Digital Ocean, Microsoft Azure and Google Cloud).
To make it easier to operate Prisma in production, Prisma Cloud offers a set of features to save your time in areas like the following:
Note that the Prisma Cloud also has a free public cluster allowing you to instantly deploy your Prisma services to the web.