Replies: 5 comments 6 replies
-
@simonedelmann it's not quite accurate to say that all those depend on prisma. Auth and sessions do not depend on prisma. The only thing is you don't get zero-config auth without prisma (but other db plugins could provide this). But yes generated code currently depends on prisma. The main thing that matters is that the generated code is decent for the default happy path (Prisma), so we wouldn't have to make it work with every other database. We're adding custom templates which most people will use anyways. However, we can set up plugins so that db plugins can provide templates. In this case, everyone can get decent default templates. Also, keep in mind I think the biggest benefit of Blitz is the zero-API data layer. It's not code generators. You can easily add code generators to any project and the default templates aren't that great for production apps anyways (thats where custom templates become useful). |
Beta Was this translation helpful? Give feedback.
-
Jay, yes for sure and that will remain :) I think where the database discussion differs here is that DB fragmentation is a different thing than JS fragmentation. With JS, there are many libraries that do the same thing slightly different with basically the same result. But with databases, different database can be required based on the app and what it's doing. For example many apps do great with Postgres, but some require a document DB like DynamoDB, or a graphDB like Neo4j. The other point is that even if we don't have db plugins, people are still going to use other databases. You can use other databases with Blitz right now. You just don't get the benefit of So if people are going to do that anyways, we might as well make their experience as good as possible, right? Especially because this has zero negative affect on the default happy path. |
Beta Was this translation helpful? Give feedback.
-
It's obvious, you have thought about this much longer than I did when I wrote my first comment. ;) (I hope to make my point clear, English is not native for me and Google Translate does not always help ;) ) |
Beta Was this translation helpful? Give feedback.
-
Hey Brandon, thanks for creating this debate space!
I believe my point of concern was not db fragmentation per se, but rather its effect on fragmentation at the database connection layer inside the app layer. One of the benefits of a solution like Prisma is to provide a unified API for different databases, right now for sure restricted to just a handful of supported dbs, but that is posed to diversify with time. By doing that, Prisma is reducing the effects of fragmentation not by reducing it at the db layer, but by pushing the tech fragmentation further away, out of the app layer and back into the db layer.
For sure peeps will take your stuff and do all kinds of things with/out of it. ("l'enfer c'est les autres" for the French heads out there 😉) This question of finding a project's "soul" or its "claim to fame" reminds me of you citing Rails as an inspiration for Blitz and it (Rails) being an approach that was missing in the JS ecosystem. People coined the term "the Rails way" to highlight the fact that Rails is - first and foremost - an opinionated framework. Sure one can use Rails with almost anything, including all those databases you cited, which is however quite a different thing than Rails going out of their way to support those use cases at platform level. So I hope it is at least a bit more clear why when I hear that Blitz is making Prisma more of an optional component, it kinda feels to me a bit like Rails 3 having announced official cli support for both Firebase and MongoDB as an alternative to ActiveRecord 😵😵 I think you already responded to that by calling it a "loose opinions" approach. So maybe what I am missing is that I haven't yet heard why loose opinions is viable or even a better approach than a "strong opinions" one? Or why Blitz chose this approach? It definitely could help grow a user base, just like offering 10 flavors of ice-cream helps to sell more ice-cream than just having one. But does the extra luggage introduce complexity into the platform? These are some of the things I am asking myself. |
Beta Was this translation helpful? Give feedback.
-
Prisma providing persistence access to multivariate databases with SQL like semantics may seem like a good thing to leverage off and for a class of applications it probably is. However Prisma demands a relational data structure and a SQLish database yet the data being persisted in Blitz apps will not necessarily always be relational whilst the persistence store may not always be a database. In Blitz applications, data could be persisted to diverse places such as cloud storage like an S3 bucket, a client-side datastore like Redux, an event store via a queueing mechanism that backs a distributed system or it could possibly even be a peer to peer blockchain. I don't think prisma have any plans to support all of those usecases but I think we could re-architect Blitz to do so and this should be explored a little more in my opinion. When fleshing out Blitz, the architecture was partially based on some of the ideas within Clean Architecture which considers persistence to be a "plugin" to the architecture. This is actually a good idea. If we want to follow through on the promise of that architecture, (and I think we should) Blitz should actually probably allow developers to build out a persistence interface so that "UseCases" know nothing about how data is being persisted and consider persistence to be a plugin. If Blitz does this correctly then Mutations/Queries become ultimately completely isomorphic, and should have no environment dependencies/assumptions, whilst the database can be swapped in and out for any slice of the app as it is just an IO device. There are several advantages to this:
Some of the tradeoffs:
|
Beta Was this translation helpful? Give feedback.
-
A discussion started in Slack recently that's worthy of a home here as a discussion thread.
Beta Was this translation helpful? Give feedback.
All reactions