转自:https://www.prisma.io/blog/prisma-2-is-coming-soon-mwwfhevie993

Prisma 2 will introduce many fundamental improvements. Making the Prisma server optional, an improved datamodel, better migrations, and a more powerful client API are only some of the upcoming features.

TLDR

Prisma 2 will introduce fundamental improvements:

  • Enabling usage of Prisma as a library without the need for the Prisma server.
  • Making Prisma workflows (accessmigratemanage) available as standalone tools.
  • Providing a stable foundation for fewer breaking changes and more flexibility.

It will be released in early preview by Prisma Day, you can learn more about the release and upgrade process at the end of this article. Please join our RFC process and let us know what you think of our plans for Prisma 2.


Goals of Prisma 2: Stability, observability & flexibility

Since we released Prisma, we learned a lot about the use cases and preferences of our users. We also realized that (while we aim to move quickly) it was necessary to review and redesign Prisma's architectural core to account for our users' needs.

We very much appreciate the feedback of our community members. Thank you so much for helping us to continuously enhance the Prisma experience!

The next major release of Prisma will take into account all of our learnings. The main goals of the redesign were:

  • Removing limitations of Prisma 1 (e.g. making the Prisma server optional & more flexible data modelling, e.g. to define indexes or use custom database types).
  • Increasing visibility into how Prisma interacts with your database ("less magic").
  • Building a stable core to minimize breaking changes in the future.

Making Prisma significantly easier to use

We have worked hard to rethink how the Prisma experience can be simplified. The result was an entire rewrite of the Prisma core in Rust, bringing massive improvements to the way Prisma works.

Using Prisma "as a library" by making the Prisma server optional

With Prisma 2, you can use the Prisma client as a "simple library" (i.e. just a Node moduleor Go package) without the need of running a database proxy server via Docker.

The Prisma server is a powerful tool for enterprise-grade use cases. However, the operational overhead it imposes can feel overwhelming, especially for newcomers that are just getting started with Prisma.

We strongly believe that removing the need for the Prisma server will make it a lot easier for newcomers to get started with Prisma while simplifying the lives of existing users by removing a lot of operational burden.

Rewriting Prisma in Rust

Prisma 1 is implemented in Scala which means it needs to run in the JVM. To reduce the overhead of running Prisma, we decided to rewrite it in Rust.

Benefits of Rust include a significantly lower memory footprint, better performance and no more need to deploy, monitor and maintain an extra server to run Prisma 2.

Rust has shown to be the perfect language for Prisma, allowing us to write safe and extremely performant code.

If you're interested, you can check out the alpha branch of our main prisma repo to explore the Rust rewrite.

Easier incremental adoption via standalone tools

Another common point of feedback is the difficulty of adopting Prisma incrementally in an existing project. While this is already possible with Prisma 1, so far Prisma used to be optimized for usage in greenfield projects.

To make it easier to use Prisma in an existing project, we're making the main Prisma workflows, accessingmigrating and managing your data, available as standalone tools.

This means you'll be able to adopt your favorite part of Prisma without changing your entire stack at once. For example, you can start using the Prisma client to simplify data access in your application but keep using your existing migration system.

You can then gradually expand your usage of Prisma tools as you see fit and benefit of the seamless integrations.

Prisma client: Type-safe relations & field selection

The Prisma client features a powerful API which enables developers to access their database in a flexible and type-safe way.

To improve the current API, we've added the possibility to retrieve scalar fields and (nested) relations in a type-safe way via select and include arguments. Here is a sneak peek of what the API for field selection and fetching relations looks like:

JavaScriptDatamodel
// Explicitly select some fields (exclusive)
const genres = await prisma.genres.findMany({
first: 10,
select: { id: true, name: true }
}) // Fetch all scalars and include first 10 tracks via relation
const genresWithTracks = await prisma.genres.findMany({
first: 10,
include: {
tracks: { first: 10 }
}
})
COPY

Other enhancements include support for lazy loading of scalar fields and relations as well as improved fallbacks to raw database queries. With Prisma 2, it will also become easier to get insights into the queries which the Prisma client sends to your database.

To learn more about the upcoming API improvements, check out the RFCs for the JavaScript/TypeScript and the Go client API.

More powerful & flexible schema migrations

While providing a great developer experience, Prisma's current migration system has some limitations in more complex migration scenarios.

The migration system in Prisma 2 will keep the simplicity and declarative nature while unlocking many migration scenarios that previously imposed a lot of overhead. It also is carefully designed to work in CI/CD environments.

Prisma's declarative datamodel serves as the single source of truth for your database schema, codifying it in a universal modeling language. When changing your datamodel, Prisma 2 auto-generates migration scripts that you can execute to run a migration.

Migrations can be extended with before/after hooks and are have a robust execution enginer where any failures will trigger automatic rollbacks.

Prisma Admin available on Desktop & refined UI

Prisma Admin has been greatly received by our community as a way to make it easier to view and edit the data in your database. In Prisma 2, Prisma Admin will become available as a desktop application that can connect to any database.

Prisma 2 also adds some improvements to the user experience of Prisma Admin, for example by introducing:

  • A dedicated UI for filtering (see screenshot above)
  • An environment to run Prisma client code (REPL)
  • Support for embedded types

An improved modelling syntax for your data

With Prisma 1, the datamodel is based on GraphQL SDL syntax, a language originally designed to describe GraphQL APIs. While SDL is simple and intuitive, we've found that it's not the best tool for describing database schemas.

Building upon SDL as a great foundation, we are introducing fundamental improvements to the Prisma datamodel syntax that will unlock your favorite database features in Prisma, for example:

  • Choosing specific column types
  • Defining indexes
  • Using lightweight expressions for default values

Changes for existing SDL users will be minimal, while advanced use cases are covered by the powerful new features introduced in Prisma 2.

Prisma 2 is Coming Soon的更多相关文章

  1. 分享一下怎么开发一款图片视频类App,秒拍和prisma

    第一步,分解短视频App的功能 我们在秒拍官网看到如此描述: [视频拍摄及导入]支持直接拍摄及导入手机本地的视频 [照片电影]照片专属特效,轻松创作照片电影 [MV特效]10余款全新MV特效,让普通视 ...

  2. Prisma

    AI修图艺术:Prisma背后的奇妙算法 | 深度 投递人 itwriter 发布于 2016-07-30 12:47 评论(2) 有712人阅读 原文链接 [收藏] « » 雷锋网按:本文作者系图普 ...

  3. Prisma GraphQL 服务器 生产者 "https://www.prisma.io"

    Prisma   一个 GraphQL  服务器 生产者     "https://www.prisma.io" , 关注一下

  4. 布拉格捷克理工大学研究团队:Prisma进化版

    原文链接  还记得 Prisma 吗?就是能把拍摄的照片转化为各种名画风格的修图软件,神经网络的深度学习后,想要波普还是梵高风的图片都不在话下. 现在,它的进化版本来了.这回是布拉格捷克理工大学的研究 ...

  5. prisma 服务器端订阅试用

      graphql 协议是支持数据的实时订阅功能的(一般基于websocket 进行实现) prisma 支持客户端订阅以及服务器端订阅(类似webhook),可以方便将 数据推送后端服务 目的 pr ...

  6. prisma 集成 pipelinedb测试

    pipelinedb 是一个基于pg数据库开发的stream sql 数据库,和prisma 集成起来可以开发很 方便的stream 应用 使用docker 安装 项目初始化 prisma init ...

  7. prisma 集成tidb 安装试用

    以前官方提供的ansible 的脚本,现在有了docker的版本,可以方便测试使用 实际完整配置参考 https://github.com/rongfengliang/prisma-tidb 安装ti ...

  8. prisma middleware 简化 graphql resolver 编写的类库

      prisma 推出middleware 的目的就是保持resolver 的简洁 作用: 输入参数访问同一个resolver 决定resolver 最终的返回值 在resolver 连中捕获异常以及 ...

  9. prisma graphql 集成timescaledb

    prisma 官方文档说明了因为支持pg 所以相关的timescaledb.cockroachdb 应该也是支持的 但是测试之后timescaledb 支持cockroachdb有问题(事务处理模型支 ...

  10. prisma graphql 工具基本使用

    项目使用docker-compose mysql 运行 安装 npm insatll -g prisma or yarn global add prisma 创建代码 项目结构 ├── README. ...

随机推荐

  1. hystrix简介

    hystrix,框架,提供了高可用相关的各种各样的功能,然后确保说在hystrix的保护下,整个系统可以长期处于高可用的状态,100%. 高可用系统架构: 资源隔离.限流.熔断.降级.运维监控 资源隔 ...

  2. "Sed" 高级实用功能汇总

    sed命令有两个空间,一个叫pattern space,一个叫hold space.这两个空间能够证明人类的脑瓜容量是非常小的,需要经过大量的训练和烧脑的理解,才能适应一些非常简单的操作. 不信看下面 ...

  3. MVC中根据后台绝对路径读取图片并显示在IMG中

    数据库存取图片并在MVC3中显示在View中 根据路径读取图片: byte[] img = System.IO.File.ReadAllBytes(@"d:\xxxx.jpg"); ...

  4. 换个语言学一下 Golang (8)——指针

    定义 所谓指针其实你可以把它想像成一个箭头,这个箭头指向(存储)一个变量的地址. 因为这个箭头本身也需要变量来存储,所以也叫做指针变量. Go的指针不支持那些乱七八糟的指针移位.它就表示一个变量的地址 ...

  5. WPF应用打包流程

    1,安装工程模板插件Microsoft Visual Studio Installer Projects https://marketplace.visualstudio.com/items?item ...

  6. restframework中根据请求的类型修改序列化类

    只要在视图中重写get_serializer_class方法就可以,用if对请求的类型进行判断 def get_serializer_class(self): if self.action == &q ...

  7. springboot2.1.3使用mvn site遇到的坑及解决方案

    本人要使用mvn site命令生成一些项目报告,如:***.html文件,但是在命令运行时,时常报如下错误: 一开始还以为是 jar包冲突引起的,把相关依赖引用的jackson-module-scal ...

  8. angular官网实例(综合)

    第一部分: (应用的“外壳”) 1.新建项目: ng new mytest 2.进入项目目录,并启动这个应用. cd mytest ng serve --open 3.添加一个标题 打开 app.co ...

  9. k8s node节点部署(v1.13.10)

    系统环境: node节点 操作系统: CentOS-7-x86_64-DVD-1908.iso node节点 IP地址: 192.168.1.204 node节点 hostname(主机名, 请和保持 ...

  10. PCB Layout设计规范——PCB布线与布局

    1.PCB布线与布局隔离准则:强弱电流隔离.大小电压隔离,高低频率隔离.输入输出隔离,分界标准为相差一个数量级.隔离方法包括:空间远离.地线隔开.     2. 晶振要尽量靠近IC,且布线要较粗   ...