So does Prisma take away the need to write connect...
# prisma-whats-new
a
So does Prisma take away the need to write connectors?
a
In general, yes. There are plans to have several connectors beside the currently supported and built-in MySQL connector.
h
it basically makes your database a graphql server
and then you can build on top of that
a
ok so should I use just prisma or prisma and graphql-yoga?
h
prisma is your database, yoga is your application layer
so both
a
ok thanks, but so how did you connect your database before prisma with just graphql-yoga?
sorry for all the questions
h
manually writing all the resolvers I suppose
n
without using Prisma, you would write a ton SQL queries that map your GraphQL API to the DB 🙂
a
ok awesome so that's the Prisma's key selling point then?
h
yup
a
awesome thanks guys
n
quite 🙂 it gets even more interesting when you think about combining different DBs
thanks for your questions @andykay, super happy to have you with us 🙌
a
with Prisma though I will still probably need a sql library to actually create the database tables and migrations and such?
@nilan thanks! finally trying to dive into this GraphQL thing
h
prisma manages the database for you
n
Good point, you don't need that with so called active conncetors. With passive connectors, you will need to manage the DB schema yourself.
a
ok
n
Right now, Prisma is running on an active MySQL connector, but we're looking into adding more connectors soon. Think MongoDB, elasticsearch, Postgres etc
a
nice so does Prisma also take away some of the need for a sql library like sequelize?
n
yup
a
like CRUD operations
?
n
for sure! I recommend getting your hands dirty with one of the quickstarts here: https://www.prismagraphql.com/docs/quickstart/ hopefully that gives you a good basic understanding 🙂
a
ok this is cool, I haven't used sql too much in node but none of the sql libs seem that great so this will help a bunch
n
ah maybe one final piece of the puzzle
you can use
prisma-binding
to basically glue your
graphql-yoga
server with your Prisma API: https://github.com/graphcool/prisma-binding
a
@nilan so I will almost always need graphql-yoga along side Prisma correct?
or are there times where I can get away with just Prisma and a GraphQL client?
n
great question, we should have an FAQ for this 🙂
most of the times you would use
graphql-yoga
, that's the place where you put your business logic in. in simpler cases, you don't need this layer. Typical use cases are internal tooling or simple/static websites
a
yea I saw one of your responses in your forum, I believe you said something along the lines of "large apps will need graphql-yoga"
ok great
what's the performance like with the two servers though?
it goes client -> graphql-yoga -> prisma right? so an extra step in there? is that a big hit?
n
It's not, in particular so if you put the two in the same region. 🙂
prisma-bindings
is really a thin layer above Prisma
l
There's really no difference than client -> express -> db
👍 1
n
if one of your resolvers in
graphql-yoga
needs many calls to Prisma, that's where it gets a bit more involved. In a recent version we added array based batching to
prisma-binding
, and saw tremendous performance improvements
l
Though (despite my searching), I haven't found the performance hit in DB as a service vs on your own box. But no one is really complaining 🙂
n
The
graphql-yoga
layer is also a great place for more advanced techniques like caching. This is an area we're currently researching, should be super interesting to see what is possible there 🙂
a
I still need two servers though right? one for graphql-yoga and then one for Prisma? And of course my database server
or no?
l
@nilan for suggestions on that front, I'd love a tutorial / example on Yoga for caching things like users. I'm looking up the user through middleware and appending it to the request. I want to cache the user
n
We're aiming to deliver a serverless experience for Yoga + Prisma. Read this for more information: https://blog.graph.cool/prisma-cloud-preview-invite-only-c251bebf5670 🙂
@lawjolla, could you describe your situation in a new issue here: https://github.com/graphcool/prisma/issues?
l
It's really not an issue... more of a "I've never done this, what do I do, help" kind of a thing 🙂
a
@nilan nice I think I already put my name in for early access
💯 1
n
I know @lawjolla 🙂 Either an issue in Github or a question here https://www.graph.cool/forum/c/questions are the best ways to open discussions like yours!
👍 1
@andykay gotcha, you should receive a reply soon 🙂
a
@nilan thanks a bunch!
for the help
🙌 1