Welcome, everybody, to another episode of Compressed FM, a podcast all about web design and development with a little bit of zest.
On today's episode, we are going to be talking all about data and why it is so difficult to get that experience just right.
Web development and design, who would have guessed?Well, we can do them both, even add a little zest.So turn up the volume, get ready for the best.Let's get it started in this episode of Compressed.
Hello, my name is Amy Dutton and I am a lead maintainer on the Redwood JS Core team.
Hey y'all, my name is Brad Garaby and I'm a front-end developer at Atlassian working on Confluence.
And as I mentioned, today we have Mark Hess from Prisma.Welcome, Mark.
Hi, yeah, thanks for having me.Super excited to be here.
Awesome.And I did want to shout out, today we have a special sponsor.So thank you very much, Convex for sponsoring CompressedFM.So Convex is perfect for the back-end for founders.It is a back-end application framework for product-obsessed founders.
So it's great for working with data and things like that.So thanks again, Convex, for sponsoring our show.
So Mark, you come in from Prisma, a company and a tool that I've been using a lot lately.So I was really, really happy to have you in today.
And I got a ton of questions, but I guess first, let's just start out a little bit about your background at the company, what you do there on the day-to-day.
Yeah.So I'm a developer advocate at Prisma.
And basically what that means is I help the community, the Prisma community and really all the, you know, the tech community learn about Prisma and learn how to use the tools that we create to build whatever they want to make.
I always kind of explain it like Prisma is making the paint brushes for painters, right.That are trying to help you build really cool things.And my job is to help you learn how to use Prisma to do that.So. It's a really great position.
I've been at Prisma for about 10 months now, and I've been really enjoying it and seeing how it grows and all the new things we've been putting out.It's been a great time.
Yeah.How big is the company?
Right now, I think we're about 50 people, 50 people strong.Lots of hard workers, lots of really, really, really smart people.That's the best part about working at a startup of this size is you're just surrounded by like geniuses.You know what I mean?
You just get to absorb all that knowledge all the time.So it's really great.
And where are you based out of?
I'm on the East coast.I'm in a state called Delaware, which I say that's a place where everybody goes to get their companies incorporated or something.
And I say it that way because Prisma has a lot of people around the world, like we're fully remote.Right.So, and that's just my normal response.I'm realizing like we're all in America here.So I didn't mean to say it like that.
But yeah, no, Delaware, I moved here after COVID just because I was actually living in Washington, D.C.and when I lost my job and I was like, not going to live in the city anymore.
So I moved here and I've been here ever since, but hopefully I can actually move pretty soon.It's not a terrible state, but it's not the best state either, you know?
What's the vibe in Delaware?Is it, I mean, is it kind of woodsy, like, you know, the Northeast, like the Virginias and Carolinas or?
It's a, well, we got the, we got beaches here, which is great.That's kind of one of the main reasons I moved here was for the beaches.People retire here.We got beaches and lots of chicken farms.Let's, let's, let's really hit fresh eggs.Yeah.Yeah.
It's fun.I've actually been to the Prisma headquarters in Berlin.Oh yeah.Yeah.It's a really nice office. Yeah.
Yeah.It's great.You know, we go, we do off sites every six months and then the entire company also goes to the, well, if you want to, you can go to the Berlin headquarters and hang out there.And that's, that's always really fun.
Cause you get to hang out in the office with everybody and meet everybody.And you know, we are fully remote.So having that quality time is always really nice.And then it's also Berlin, right?
So like as an American being able to go to Berlin and just like have fun for a week and work and meet people, it's, it's great.Yeah.
Yeah, Berlin was a really fun city.It was very manageable for me as someone that does not speak German.Now I was able to get around the city and things like that.
Have you guys ever been to like Brooklyn?I kind of feel like it's like Brooklyn in New York.It's like just artsy and everybody's kind of doing their own thing, worrying about their own stuff.
And also people are nice and you know, it's, it's a nice place.
I did do the touristy thing and went over to the wall.That was impressive.Yeah.
Yeah.I did that.I, the one I was there, I actually rented a bike and I rode a bike, but it was like 40 degrees outside and I was not making a decision.I rode the bike all the way down to the bridge and through the. park over there.It was really nice.
Yeah.So I think Brad has some very Prisma specific questions.I do.
I was, I was going to start easy, get into the tough stuff later.So I was curious, you've, you've been at Prisma for 10 months.
You said, is this your first advocate type role or were you like versed in making videos and, you know, cause I've seen your face on the Prisma YouTube channel and everything.
Yeah.So it's quite interesting.I've ever since I was like 15, I've been making YouTube videos.I used to make them for like video games, Minecraft, YouTube videos when I was a kid.And then I just like always did it on the side.
And my style of content was always teaching people how to play these games, right?Like I would learn a game and then I would teach people how to play it.So I was always doing that alongside being an engineer.That's what I went to school for.
So I was always in like startups, writing applications, doing things like that. And then I was looking for a new job and a recruiter basically said, have you ever heard about developer advocacy?I was like, no, what's that?
And he explained it to me and I said, wait, people get paid to do this.I was like, that's what I do.Right.So I kind of felt like. You know, it's a perfect job for who I am.I like teaching people.I like making videos.
I like learning about cool new technology.But yeah, Prisma decided, you know, that was enough experience and I've been really enjoying it.We're working hard.It's a really great role to be in.
So I know Amy and I both kind of like dabble a little bit in YouTube, I would say, but like we're not committed, I would say.What's like your number one tip to like getting YouTube videos out or like having a successful channel?
Oh, that's such a loaded question.Um, yeah, let, I think the first part of that getting YouTube videos out, I think that is, that's a challenge.That's the part that people don't understand that, like, that's the part that matters.
You just, just as simple as it sounds, just do it right.Like just your first 10 videos are going to, they're going to be bad, like just straight up.They're going to be bad.
Yeah.And that's okay.You know, and that is okay.You got to learn your style.You got to learn the process.You got to love the process too.
You got to love making these videos, editing them, putting them up, watching them fail, saying I can do better and just continuously go find your niche and then just, you know, go full hard on it.I think YouTube, you get what you put in.
but you have to put in a lot.And if you put in a lot, you will get something out of it.
The other thing is you just have to keep putting in because I did YouTube videos for a good solid year and then was like, okay, I need a break.And then it's been two years and it's been one of those things where you don't, because you have stopped.
It's not like it just keeps on giving.It does a little bit, but not like it would be if you were consistent.I think that's the hard thing about any social media is it's like, yes, you did great yesterday, but you still have to do good today too.
Yep.Yeah.It's, it's definitely a challenge to start again once you stop.
And I think for me personally, like I don't really do much personal content anymore because I'm just so involved with Prisma and it's so hard for me to start back up doing personal content.
Cause I just like know the amount of work that is, know how much effort I have to give it. But I do always plan to continue doing personal content again eventually.It's just I'm so focused on Prisma right now.I don't really have time.
I think just to keep adding on to your answer, I've been going through Ali Abdaal's content and how he talks about building up a YouTube channel.
And he does say it takes about 50 videos for you to really understand as you're talking about your style and your voice.And some of that stuff you can't just think through, you can't figure out ahead of time.
It just comes with the actual doing of it.But he makes the point, if it's 50 videos, try to get to the end of those 50 videos as fast as possible. So do it two or three times a week so that you get those 50 videos.
And there is some kind of trigger point in the YouTube algorithm that as soon as you hit 50 something clicks and they'll like escalate you or promote you more than you did when you were just at 48.
Interesting.I didn't, I didn't know that point.I just always just put things out until it starts happening.
But I do think for that 50 videos, a good tip here is batch, like doing the work in batches, writing all the scripts or writing all that's a big part.People don't think you need to write outlines and stuff, outline everything.
Even if it's just like, you're going to wing something, like write that down and know you're going to wing it.Right.Like write all of your scripts, then do all your recordings, then do all your editing.Then yeah.
If you do it that way, it's a little bit more manageable.So say you're going to do three videos a week, you've record them all, you know, three at a time and do it like that.It's actually a lot easier to do than one whole video at a time.
One thing that I want to experiment with is a lot of my, well, all of my video content has just been talking head or screen share.And I'm explaining how to do a particular concept.
I've kind of been curious, what would it look like if I created a different type of video?
And you don't see a lot of that in the tech YouTube side of things, but like almost, Hey, I'm like documentary mockumentary type thing, or like I did this today or.
Not like boring, like, come with me while I walk to lunch, you know, or like random drone shot of my house, like nothing that's like frivolous in terms of not advancing the story.
But there's a lot of things when I'm presenting a concept that I had to go through the research or trying to figure things out.And a lot of people miss that aspect of it, especially when they're juniors, it just feels hard.
And they're like, well, senior crank this out on YouTube in 10 minutes.How did that happen?It's like, you don't see the five hours of planning that went into trying to figure that out so I could condense that into 10 minutes.
And so not that I want to have a five hour long video showing that entire process, but helping somebody get more comfortable with that process and everything that it takes to get to that point.
I think that's a really good idea.And I also think there's a way to incorporate live streaming with that.
So say you're learning something, you live stream yourself learning it, and then you take some of the aha moments from the live stream and put that into the video that you're making, explaining how things are learned, right?
There's, that's, there's really cool ideas there that I think showing the process to your point, showing the process of how senior engineers learn things or really any engineer learns things can only help people with less knowledge learn as well.
So yeah.Are you familiar with the future?That's not supposed to be a loaded question. It's Chris Doe.
He has a, actually, I think he still has it, but he has an agency called Blinds, I think that's right, in California, but he has a history of video stuff and he has access to all kinds of video editors and they've done stuff like that on the design side, talking about design process or having a film crew in design meetings or client meetings and you get glimpses into that whole process.
It's actually kind of a trend right now on YouTube.People are stopping the fast paced, highly edited stuff and trying to do more real like behind the scenes.This is what I went through today.Slower, like 30 minute videos.
And I think there's a real opportunity for engineers to do that kind of stuff.If you have the want and the drive to do that, I think there's a real way to do it.
I guess let's pivot over to Prisma a little bit.I think we've probably got some folks in the audience who may not know what it is.So can you talk about like
what the product is, and I would also love to know a little bit about how Prisma actually makes money, because I've only used the free stuff.
Yeah, so this is actually a really on-time question, I guess.So Prisma right now is, we're going through this transition of, we have the ORM, and that's what people know us for.
Object Relational Mapping Tool, if you don't know what ORM is, it helps you communicate to your database, helps you kind of define your database and code, and we help you, we kind of simplify a lot of that communication between your application and your database via TypeScript and all that.
And that's what we're known for, and we love the open source community, and we love all of that.But Prisma is actually, we're trying to expand from that and create more tools that just help you work with your database.
So for instance, we have Prisma Accelerate, which is a connection puller and a global data caching tool.We have Prisma Pulse, which is a way to be able to create real-time applications that
Listen to events on your database in real time and sends those events to your applications, right?
So we're creating these tools that use the Prisma RM that you can also use inside your applications, and that's that's how that's how we make money, right?If we have those tools, accelerate and Paulson, we have more a lot more things coming out.
Gotcha, so so like can we dive into that a little bit?So pulses is particularly interesting to me, then that's the real time one, right?
Yeah, yeah, that's actually one of my expertise, so that's good.
It's like it's like what's so prism says i'll host your database and i will listen to you in no okay how do you get in the middle.
Yes so you can keep your database hosted wherever it is i mean it doesn't work for everything right now because we're still in early access with balls. But basically we use, in Postgres, we use this thing called logical replication.
And basically what we need you to do is enable that on your database and it creates a publication table.It doesn't create a publication table.We create a publication table on your database that tracks all of the events that happen to your database.
And then we have Pulse.Pulse is basically the thing that is listening to that publication table and then also sending those things to your application.That's what Pulse is doing.
How fast is it?It's instant.It's very okay.So it's not like you're making a bunch of network cops querying this database.You're getting like database events coming out of this Postgres database and then the pulse service sends it out.
As soon as the records created, edited, deleted, whatever, you instantly have a message on your server saying this happened, right?As long as you have that event stream, as long as you're listening to that event stream on your server.
And what's like the communication protocol?Are you sending like a webhook or is this like a web socket?How does Pulse talk to the app?
It's TCP right now.I'm pretty sure we actually are doing a lot of changes internally to this right now because we realized it wasn't working in some instances.
So I don't know if I have the right answer for you right this second, but web sockets and TCP are the main two ways we're doing it as far as I'm aware.
That's good.It's not like here's a ping with a webhook or something.Sounds like WebSockets is going to be a whole lot faster, much better suited for real time.
Yeah.And, you know, it's really cool to see the community like adopt this and try to figure out cool ways to use it.But it's only just the kind of the start.
Pulse is a product that we're using that we want people to be able to love, but we're going to actually build a lot of really cool stuff on top of it that I can't really talk about, but it's going to be a lot of really cool stuff coming because Pulse exists.
And this is all on the Prisma data platform.So we have the ORM, which is, you know, always going to be free.It's open source and we 100% fully support the ORM and we will continue to work on it forever.
But we also have the Prisma data platform, which all these other tools are coming out of.So when you asked earlier, what is Prisma?A lot of people might think that just means the ORM.Our whole goal is to make working with your database easy.
That's literally our whole goal as a company.So we're making going to make products and tools that do that.Yeah.
And I got to say I'm like a front end developer and Prisma makes me a back end developer.
You know what I mean?Like it's without that I don't think I'd be doing the stuff that I can do today.
I've written SQL queries in the past and I hate it.Just Prisma makes it work.Like you don't even have to think about it or write those things.Yeah.
That's, you know, that's great to hear.I think there's a lot of our audience that's like that.There's a lot of our audience that's making a Next.js project and they know they need to store some data and they're like, how do I do this?
You know, I know about plant scale.I have this database.How do I get things back and forth?And yeah, Prisma just handles all of that for you. That's kind of our goal is we don't want you to have to think about the SQL.
We don't want you to have to think about how to optimize these things.You have your database structure.You have your data.Let's give it to you, right?
Well, actually, that's a good segue.So talking about optimization.So obviously, Prisma is like query builder type syntax.Yeah, makes some good optimizations.
But does Prisma help surface any like slow queries or is that on the database and that does more of that kind of stuff?
We do have a tool that allows you to.Like it will respond with like your query times and things like that.We try to do all the optimizations ourselves for you.Right.
Like, like that's actually a one big thing we're working on right now is we're adding a lot of support for database level joins that we didn't necessarily have before things that are like actually increasing performance even more, but we're trying to handle all that stuff for you.
So I guess does that answer your question?I'm sorry.
Yeah, I guess I know that like some of the hosted database platforms like PlanetScale can give you like a report of like these are your slow queries.
I wonder if Prisma did any of that on its end or if that is purely at the database level that they can somehow figure out that information.
No, we don't necessarily do that, like have a report of this is a slow query.We do have, we have things, we have things that are happening.I can't talk about them. But we also do have a accelerator as well, which is our caching tool.
And that it's caching slash connection pooling.And that just speeds up your queries just like instantly, basically.You install that and it's basically instant, but we don't have anything yet that says, Hey, this is a slow query.
I will, I'm going to, it's funny.I'm going to clip this and I'll send it to the tweet. Okay, cool.
One thing that's interesting about Redwood, if I can give a little plug.So Redwood is using Prisma under the hood, which is awesome because anytime you're working with your API, you just write Prisma code and it works on the backend.
But we have Redwood Studio that will show you insights into some of the queries and some of the things that Prisma is doing under the hood for you, which is really interesting.
And since I mentioned Redwood Studio, it would also probably be beneficial to mention Prisma Studio, which is really cool because it gives you a visualization for your tables and you can scaffold data really quickly using Prisma Studio.
I just, I just want to sit here and brag about Prisma for a few minutes, because I've been using it in a production application at work.And I mean, just a couple things that I love.Number one, the documentation.
Which I want to camp out on.
No matter how into the weeds, the questions I have, documentation has it.Deep into like mocking the database, generating types, unit testing, all this kind of stuff.The docs covered it exactly what I needed.
This is what developer advocacy does.That's great.You just pat me on the back.This is great.
Good job.Amy, did you have something?
Yeah, I, well, I wanted to camp out on that a little bit because we're going to end up reworking the Redwood docs, but like, what would you say makes good documentation?Cause I firmly believe a project lives or dies by documentation.
If somebody doesn't know how to use your app or your code, then they're not going to.You need somebody to explain that.And so what makes that good?Brad, it sounded like one use case for you is it has what I need.
It has what I need.So I don't think the Prisma docs are great in like a read top to bottom format.There's a lot of information in there.
So it's hard to say like, oh, I'm going to like start at the beginning and learn all about Prisma when I get to the end.No, it's kind of like you use that search bar and the search bar is very good.And I think like
The terms that I was typing in the first match was the hit that I needed that had what I needed.You know what I mean?So I just think it's really easy to find stuff in a very large set of documentation that is dense.
So let's camp out on that for a second.Are you using Algolia under the hood?
Yeah, we are actually using Algolia and it's interesting that we want to, we're talking about docs because we're thinking about like putting our docs on a new platform.We're actually testing out like DocuSource right now.
Trying to figure out like interesting ways to support it easier.
It's Gatsby right now.It's Gatsby right now.All right.
Decided a long while ago, but yeah, we're actually, this is actually something that my team is working on at the moment is we're trying to figure out a better way to do this, but yeah, we use Algolia as our search.
How long does it take to build if it's Gatsby? I don't know what your build time is.
I don't have an answer for that one though.I wonder if like Astro's Starlight documentation thing could be good.
That's another thing we're actually checking out right now is Astro Starlight.Yep.So we have, we have three avenues.We have Next.js.We have just a Next.js pure that we're going to build ourselves.
We have Astro Starlight and we have DocuSource are the three things we're trying to check out for documentation right now.We just want it to be a little bit easier to build, which Gatsby is not, unfortunately.
And we want to be able to add newer features like versioning control are using Prisma 4 right now or using Prisma 5 right now.Like, sorry, Prisma ORM 4, Prisma ORM 5 because it's different depending on the product, right?
Like we want to be able to add that kind of stuff.And to your point about reading things from top to bottom and having everything in there.I think that's one, I personally have never read docs top to bottom.I don't.
I don't know how many people that do that, but my whole philosophy behind docs is if somebody that really doesn't understand what Prisma is, if they're reading something and they don't understand it, then it's not good docs.
You know, they should be, anybody should be able to read.That's a front end dev, a junior dev.Anybody should be able to read what's in this documentation and have some kind of understanding of what this is saying.
And if it doesn't, we need to fix that.That's kind of the whole goal we have.
This is why I rely on video so much more because there's something about video content for me that clicks to help me understand the big idea.And then the docs to me are more like reference material.
Like, how do I do that one thing that I need to learn how to do that?There's not going to be like one video that shows this snippet that I need to see.Yeah.
The hard part, and I guess that makes sense what you're talking about, that flow, because to me, video content, it's just hard to go back and find what you're looking for.And whereas a doc, well, Arc is great.So Arc's a browser.
You can ask Arc, hey, will you summarize this for me?Or will you tell me what I'm looking for on this page?Which is really interesting.
But I mean, that's what I want is being able to find something on the page or use Algolia to do a text-based search.
So next time you guys are on our Prisma docs, check out the AI button we have.We actually have a Kappa AI and you can ask a direct question and it will use our documentation.Also our GitHub issues and our Discord.
We have Discord for community support and things.It will use all that information and give you an answer as well, which is actually really cool.So we try to give people the tools to be able to learn Prisma if they need to.
Yeah, oh man, I want to say one more thing about Docs, because I thought of something else I love about Prisma.We're just going to make your job easy.So one of the things that Redwood has when we think about documentation is Divio's system.
Have you heard about this before?No, I'm not sure.Okay, I'm going to share a link, but they have a great guide and a great write-up, but they think about documentation as four different types.
You have tutorials, how-to guides, explanation, and references.
I have seen this.I didn't know this is what you were talking about.And this is we think about it this way, too, in a way.
Yeah, really.OK, so but I mean, it's like what you think about or at least what I think about maybe subconsciously when I'm trying to learn something is you have reference, which Brad's what you're talking about.
I just want you to search it and reference it and find exactly what I'm looking for.And then it sounds like
from a higher level, maybe the how-to guides or the tutorials or explanations, you prefer video content for that so that you know exactly what you're looking for.
But I think one of the things we've struggled with with Redwood is like we have a fantastic tutorial.We have references that are kind of scattered everywhere, but just trying to organize all that information.
And if you spend time, Supabase has great documentation too, but you see a little bit of that with them is trying to figure out how do we organize these guides, these tutorials, and these explanations in a way that people can can find them.
We even have on our docs, I'm pretty sure we have some of these quadrants as section headings.Like we literally have a section called reference underneath of the Prismover.
And then we actually have like a, I don't think it's called how-to guides, but it's a getting started guide.Like the goal should be as clear as possible.
And if people are reading your docs and they don't understand, then your tool's not going to get used.
I'm always asking on Twitter too when people say, hey, I started a Prisma project today and I did XYZ and I'm like, hey, how'd you, how'd you learn to do that?And if they say docs, I'm like, well, was the docs experience good?
Did you understand what you're reading?Was it difficult?You know, can you give us feedback?And that's always super helpful too, just getting that kind of direct feedback on things to account.
Yeah, that's a great, great call out.So you had mentioned AI on the site. One of the things that I love about Prisma is your VS Code extension.In my mind, it's one of the best VS Code extensions out there, bar none.
And when I was writing some Prisma queries the other week in VS Code, it was a great use case for Copilot too, because you have access to your schema.You know what data I'm trying to track.You know what queries I'm trying to run.
And so I could write a lot of it.That's not a problem.I can figure it out.I can look at the docs. whatever, but I was using GitHub Copilot just as a chat and saying, hey, this is the data that I have.Please query or write the thing that I need.
It would just give me that information.I could plug it in.We moved so fast.I was impressed with myself.
Well, and you know what's interesting about that is, I think what you were referencing wasn't actually the extension working.That was just the TypeScript inferences.
Like pure TypeScript, which you must have some freaking geniuses on that team.We do.Because I've tried to dive into the TypeScript stuff and that's something I want to go a little bit deep into because how all of that is inferred is just amazing.
And it makes that kind of full stack type safety a reality.Okay, I'll jump off into this question that I have.
I wrote like this nested query, right?Like where, let's say we've got like, you know, users and posts and things like that.And like, I went two or three levels deep, I got a post, and then I got the user and I got his something, I don't know.
and the results of the query is typed properly.But I need to use that type elsewhere in the application, let's say as an input to another function, right?And I did find this in the docs.
The docs had this way to generate these types because you couldn't just use like the Prisma generated type of user because it had a specific subset of selected nested relations.Does that make sense?
Yeah, so the doc suggested to do this thing where like you put the Prisma query inside of a function and then you call this special magical TypeScript method that's like Prisma dot promise query and then you stick the function in there and it infers the return from the function.
And it felt weird that I had to like pull it out into a separate function and then define a type for this instead of somehow being able to just infer this a little bit better so that we have like a named type definition.
But, you know, thinking in my head, you can't spit out named types for every possible query selection.It's like impossible.
Yeah, you know, I would have to, honestly, in this situation, I have to look at the code to like really give you a good answer on like why this is the way it is.
There is as much as I appreciate all the praise that you guys are giving this, there's always room for improvement.And maybe this is one of those things where we can improve it.Right.And this is one thing that we always are looking at.
We're always looking at ways to try to improve the developer experience specifically, because for instance, if no RBS code extension and our TypeScript suggestions involved, that didn't really exist. Prisma might not be where it is right now, right?
Because it might be pretty hard to use.So it's very important that these things work properly.I am curious about your situation, though.I would like to see that code.
If you have the code, I would like to see it, and maybe I could help a little bit better.
It's a little hard to visualize, but I think I understand the point of putting it in a function because you're not trying to get the entire, what did we say, the user model?We're not trying to get the entire model.
You just wanted a few fields from that, right?
It's like a nested thing.
Yeah, so one thing that we do offer is called client extensions.And what you can do with client extensions is basically for use cases like that, you can in the Prisma client and create your own kind of functions that are pre baked into the client.
So this might be a perfect use case for a client extension.Interesting.Whenever you're doing this type of query and you're getting these Fields back.This is what I want the type to be.Right.And you're able to find that kind of stuff.
My extensions are really powerful.Yeah.
Like this set of posts with the related user, with the related thing that that is like a specific named query that you can make and you'll give it a type.
And because of that, the client actually exports that named type, which then you can use elsewhere in your application.Yeah.Client extension.
I'm not a hundred percent.I'm like 90% positive.That's possible.You know, I would have to test it myself. But client extensions really enable you to be able to do that kind of stuff.
You can really add any type of functionality you want to the Prisma client if you have the know-how to do so.
We have a lot of tutorials actually on client extensions on our YouTube channel and in our docs and things like that on how you can build your own client extensions.
OK, I'm going to link that for everybody here, and I'm definitely going to take a look at this later.I'll send you a snippet of that code, too.OK, it's not the most heinous thing in the world, but I was just like, there's got to be an easier way.
And so this this sounds kind of up our alley what we're looking for.
There might be.And always, if you if you ever have a question, always reach out to us.We're any of the developer advocates will literally sit down with you.And if we can help you, we will help you.Right.So even if we can't, we'll try.
You know what I mean?So, you know, it's OK.
My second Prisma situation that we're dealing with is because Prisma operates with a database and Atlassian, the company I work for, has a lot of security concerns.We can only access the database in process.
So we define a deployed set of resources, which includes a database and a service.And only that service that is connected to that database has direct access, meaning through a database connection string like Prisma does.
But we also have other consumers that want to talk to the database that are different projects, different services.
And so because that's the case at work, we have to stand up an API so that consumers can talk to this API, which then goes in process of the service that is connected to the database.
Running Prisma behind an API takes all the fun out of it, unfortunately.Because how do you have the power and flexibility of a Prisma query behind an API unless you're literally sending the raw JSON query right in a post body?
you know, and passing it on directly to Prisma, which seems like kind of odd.You're also going to lose a ton of type safety and stuff from the clients using that API in that situation.So it's a rough spot to be in security wise, unfortunately.
But has anybody ever built something cool like that?
You know, I'm thinking right now, I think, um, I don't know off the top of my head, obviously.That's why I'm wondering right now.I'm trying to think if I've seen something, um, I'm sure there is a solution to this.
Just, it feels like, it feels like this use case has been solved before.It's just not something I can think of off the top of my head.I'm sorry.I don't have a better answer for you.
Yeah, it's just very hard to take like a REST query and then map it to some kind of nested Prisma, which almost feels more like GraphQL at the end of the day, like some nested Prisma query.
You'd have to be adding a lot of kind of query parameters for the includes and the selects maybe and make a lot of different endpoints for all your models.And I feel like it takes the wind right out of it, unfortunately.
So in a perfect world, we would have generate API based on your models or something like that, you could just communicate to.
You could.I also thought about like just going really raw and saying, you know, like slash API slash user slash find many.
And then you pass in JSON if you want to add, you know, selects, includes, anything like that, where you're just basically handing the ARGs directly to Prisma.
But that would just be very difficult for consumers because it's not typed right on the consumer end.So.
Yeah, this is something, honestly, I'll have to think on.I have to ask the ORM team about this.There's no way this isn't something that's on our radar.There's no way it's not.So this is a good point.I'll have to bring it up with them for sure.
Sweet.Yeah.Just leave it to big companies to find weird use cases for stuff based on, you know, rules.
I'm just happy to hear you guys are using Prisma.So we need to talk more after this and let me help you.Let's get something going so we can help you guys out more directly.
Like a shared slack channel or something like that right and you have you guys can have some direct access to us I mean we have a shared channel with redwood and you know we'll help them out with whatever whenever they come up with stuff lots of lots different companies so.
Get it last year's logo on the personal website yeah.
Yeah, let's do it.Yeah, it's funny.We had like a back-end team that we were working with, and they're running like Java Spring Boot stuff to bring up APIs and, you know, connect to S3 or Redis or whatever.
I mean, it took them a while, you know, fairly newer developers working on this stuff, couple months to bring up like some of the APIs we needed.
And when it came time for us to build something new, I was just like, I'm just going to use Prisma and Postgres.Let's go.And then like a week, I had it up and running all thanks to Prisma.And then I got to teach the other front-enders.
It's not that bad.Don't be intimidated. That's great.That's great.
That's just great to hear.Just makes me happy.
OK, so I want to take a negative shift, but I do want to ask maybe a question.It was kind of hinted at in the chat.Drizzle is a similar service that I've heard, you know, just murmurings about.
I don't know how familiar you are with Drizzle, but I was just going to say, are there certain use cases of somebody trying to evaluate their options where you can say, yeah, Prisma is really good at this or we could maybe improve or learn something from Drizzle in this other area?
To sit here and say we can never improve and learn something from a drizzle.That's just, that wouldn't be true.I think drizzle is honestly a great tool for depending on whatever you're building.Right.
I'm a firm believer that every project has certain roles that you need to pick the proper technologies for.Maybe you don't need something as full and robust as Prisma.Right.
You don't, I mean, drizzle is quite new and it probably will get there where it has the same amount of features that Prisma does. But right now, maybe you don't need that.Maybe you need something that's simpler, that is more sequel-based.
And this is, I apologize if I'm misrepresenting Drizzle at all, but it's more sequel-based than Prisma is.Prisma is more of a full ORM.It tries to abstract as much of that sequel from you as possible, right?
If you're looking for something like that, then yeah, I think Drizzle's great.I have no reason to say otherwise.Prisma is more focused on trying to get everybody to be able to use a database and work with data, right?
So, like, you don't have to know SQL to work with Prisma.You can learn SQL by working with Prisma, right?That might be the case with Drizzle.I honestly, I don't know.
We're also trying to build a lot more tools that allow you to work with your database in different ways as well.So,
And that's a good thing to point out too, with Prisma you can have a Mongo database, right?You can have Postgres, you can have SQL, you can swap out whatever handler.
So it'll handle all those queries and relationships for you, whatever database you're using on the back end.
Yeah, Drizzle basically takes the ORM piece and the migration piece and all the different pieces and makes individual packages out of them.So like they'll, you know, if you want migrations, you install whatever the library is for migrations.
If you want the ORM, you install this one.
We haven't even talked about migrations.
Yeah.Okay.And then Drizzle is like SQL first, kind of.That's like the first thing they came out with, but they just released a query builder ORM type syntax, like Prisma.
But the biggest complaint that there is about it is their documentation is sparse on that.And so like...
You know, it just makes Prisma such an easy choice in this case, like I said, because you can find everything you could ever possibly need in those docs.And it's so frustrating to use a new cool library and you can't find docs for basic use cases.
Well, you know, I think, like I said before, it's very important to evaluate your project and choose the right tools for it.You know, and some people love that system that Drizzle has set up.They love to be able to choose exactly what they want.
They want that control.But then there's a lot of people that don't.And, you know, Honestly, in Prisma, we're learning a lot from Drizzle too.
We're trying to make sure that we can acknowledge that, oh, Drizzle has done some really cool things that we should have maybe thought about.Right.
And how can we not, you know, just take what they're doing, but like figure out, does our community want this?Do we need to build things similar to this to support our community too?I think, you know, it's competition's always good.Right.
So like having multiple ORMs out there, they're allowing people to make great things.I don't think that's a problem, you know.
Yeah, I love that point, because it's like if a new tool comes up, it's usually because they feel like there's some kind of gap in the market.
And so if you can look at that, is your competitors not as something of like, we've got to squash them or get rid of them or don't talk about them or ignore them.It's like, no, what problem are they trying to solve?
And how can we think about those same problems differently?
Yeah, exactly. So migrations is one thing that Prisma offers that really, it's very database-y in my mind.
And Prisma does make it fairly easy, but you know, I still think it's one of the harder things for front-end developers to wrap their heads around.And I guess, could you give us like a 101 about what a migration is?
And then I would love to talk about like how and when they get applied in CI pipelines.
Or best practices, you know.
You know, it's always interesting for me to hear about migrations from a front end perspective.My, my very first language was PHP and one of my very first frameworks was Laravel.So there was migrations baked right into that.Right.
So it's always been kind of a thing that I was like, Oh, this makes total sense to me, but I totally understand why it might not tell others.You can think about migrations in a very simple way in my mind.
If you have a table in your database, say for, we don't even really need to get this abstract.You just have a table in your database and you need to add a column to it.You need to start tracking more data in that table that you weren't before.
You could just go into your database and add the column, run the SQL command, add the column.And you could, you could just do that.
Or you could create a migration that allows you to be able to automatically add that to your table anytime this project is built.
Along with adding a lot of extra securities and checks that didn't exist before like with by just running that query and that kind of goes into your CI pipeline thing where you can take an application and build it from nothing all the way to fully production and you have all these migrations along the way.
And no matter where you're putting that application, whenever you build it, it will run through all those migrations the exact same way that you did while you were building out the application.
And you can have that peace of mind of knowing, say I was building it locally and I was building it with SQL light.And now I'm going to put in production.I'm going to use plan and scale, or I'm going to use Postgres or whatever.
You know that the migrations are all going to run in the exact order that you built them. and your database structure is going to be the exact same.You don't have to worry about, oh, remember, did I add that foreign key?Did I add that index?
Did I add those extra columns to this, right?You just, it works, right?Yeah.
It's also great if you're working with a team and you have certain features locally that somebody else isn't ready for.
So if you're even doing something like changing a column name or adding a column, you don't want to break their code or ruin their database, but the migration will help keep everything in sync.Yeah.
And so like talking about when these should get applied in continuous integration, like right now, let's say you've got three different environments, dev, staging and production.
Right now, the way we do it is as you're building the application to get deployed, you build the app, run the migrations, then start the app.And each environment has a different, you know, database as well.
So that's the process that anytime you release, that's what happens in each one.And so if there are no migrations, or if your database is up to date, Prisma Migrate knows that they don't apply anything.
If there are migrations, it says, oh, you know, we know that your DB needs these two migrations applied.We're going to do it.And then it gets pushed.Is that kind of best practice in how, when, when in the pipeline to apply those migrations?
Yeah, I mean, I think so.I mean, I'm a very best practices. I don't like that term best practice.I always feel like there's more ways to do things that might be better for you.Right.But yes, I, in my mind, that's how exactly how I would set that up.
And I think as a team, you have to figure out what works best for you.But I think that's the normal.Yes.The normal way you would, you would do that in that situation.Yeah.
Yeah.Sweet.Those migrations have made things very easy for us, you know, to make changes, track changes and make sure every environment stays in sync.It's kind of like infrastructure as code for your database kind of is how I view it.
Yeah.When I'm trying to explain like to my grandparents, like the company I work for, like, what do we make?I say, we allow you to make your database with code.Kind of.That's not what we do, but like, you know, it's a good way to explain it.Right.
Like you don't have to know anything.Oh, and then you can have a database.Right.Um, they don't, they still don't really understand what I'm saying, but you know, it's, it's computers.Yeah.
Cool.All right.That's everything I had.You want to go pick some plugs?
Yeah.So the next segment of the show, we'll be doing picks and plugs where we generally pick something that we like and plug something that we're working on.So does somebody want to go first?
Mark do it.Okay.All right.So my pick is a game called power world, which we were debating whether I do power world or in shouted before the show.But, um, if you haven't played power world yet. is actually a very fun game.
You would think if you've ever seen a trailer, it's Pokemon with guns.That's what it looks like, but it's actually way deeper than that.It's actually like a full survival game with base building and big boss fights.
And you're capturing all these, they're called pals, but they literally look like Pokemon, right?And you can get them to fight for you.And they have all these different perks on them that allow them to help you on your base and things like that.
And I think the coolest part about it is that it was made by a bunch of people that have literally never made a video game before ever.They just had an idea.
That's it out of the gate.
Yeah.They just, they learned unreal.Everybody was responsible for learning one part of unreal.And then they built out the game and they hired some kid in middle school to make like a bunch of models for the game, like in blender or something.
And that's why like it has all the Pokemon stuff, I guess, because, and the game has like over 3 million players and at 30 bucks. You know what I mean?It's this brand new group of people that made a game and they're just, their life changed.
You know what I mean?I think it's a, I think it's incredible just to hear that story and then see the game and be like, man, all it takes is one thing.All it takes is one thing.You know what I mean?
So keep, keep making your side projects and see what sticks.You can go download it right now.It's, it's, it's really fun.It's very simple too.So like, if you're not a big gamer, but you're like, that sounds cool.
Any plugs?Yeah.So I just going to plug our Prisma discord.It's priz.lee.So P-R-I-S dot L-Y slash discord.And that's honestly the best place to get in contact with me or anybody from the developer advocacy team or support teams for Prisma stuff.
And if you have questions or need help with something, we are actively in there trying to help everybody in the community succeed at whatever they're building.
We also have a channel on there where you can share what you're building and we pay attention to that all the time as well.
One of the best parts about my job is interacting with people that are building really cool things and helping them build those things.So definitely if you're doing that with Prisma, come join our discord and get in touch.
Yeah, I'm definitely going to send you some code snippets after this. Okay, sounds great.
Brad, you want to go next?
Sure.So my pick is also a video game that I picked up.It's not a new game.It's an old game.Amy knows I started playing Zelda Tears of the Kingdom a while back, and it was my first Zelda game ever.And so I had to look at other Zelda games to play.
And I got the Switch remake of Link's Awakening.
It's good.I mean, I love it.It's so easy to pick up and play.The pacing is really good.You can basically you knock out one dungeon every sitting, you know, you play for 45 minutes or whatever.You get to the next dungeon done.
The combat's actually pretty smooth and impressive.You know, I thought I've been loving it.And like now I need another Zelda game to play after that.
I say it's my favorite.It's my favorite Zelda game.
Have you ever played Wind Waker?Yeah, that's that's my favorite Zelda game.
Is that the Super Nintendo one?
The GameCube one, the GameCube one where you have like a flute and you control the wind and it like you sail across the ocean to go to different islands and stuff.It's pretty cool.
Can I get that on Switch?Yes.With the online game passing?
I think so.Yeah, because we have, or maybe we have ours on our Wii.I can't remember. But yeah, my husband went back and bought all the different old versions of Zelda.The GameCube one, there was a Nintendo 64 one too.
The graphics on it are kind of ridiculous.I think it's a Nintendo 64 one that he wears like all these different masks and you've got to go collect all the different masks.
I get lost in 3D world, so I think that's why I like the old Game Boy version that Brad was playing.And then there's a Super Nintendo one that I got pretty far on.
Let's see.And my plug, I guess I'll just plug my Twitter.I've been posting stuff on there a little bit, and I feel like I'm getting really good responses lately.So go follow me on Twitter, twitter.com slash Brad Garropy.
I was recently just talking about scaling my Markdown based blog when making an RSS feed.It's the response time for the RSS feed is very slow because it has to render every single post in order to show it in feed readers.
And so I'm trying to think of interesting ways to make that faster.Caching, pre-rendering,
I don't know what else to do, man.Or pre-calculating all this stuff, sticking it in a database, and then just getting it all with Prisma.
Check out Prisma Accelerator if you like caching.
All right, Amy, what you got?
So I'm going to pick a podcast.This podcast has been around for a very long time, but it's just quality.So the Tim Ferriss show, he has like seven years worth of content.
But this morning I was listening to an older episode, but it's still really good.So it's a year old.It was last January, but an interview that he did with Rick Rubin.
And Rick Rubin is a music producer and he did all kinds of crazy stuff of like ACDC and Red Hot Chili Peppers, but just talking about the creative process and how artists exist in the world.
So that was kind of one of his big things that I just thought was so interesting.He's like, the difference between an artist and a craftsperson.A craftsperson will just take your order like, how do you want it customized?Yeah, I can build that.
And they will do it very intentionally and it'll be good, but they're taking orders.And he was saying that,
An artist, a lot of what they do is it's about how they experience the world and what they pick up on, which I thought was really interesting because you're saying like a lot of things are just right in front of you, but that's what makes them great solutions is because they are obvious.
They are right in front of you, but it's the artist that notices those things. And so it's the experiences that we're able to bring to pick up on different solutions that are around us.
So I just, I don't know, I got my wheels spinning as I'm thinking about, not only as a designer, but a developer, how do I think about different solutions and the things that we build?And if you even want to go a step deeper on that and layer in AI,
Like that was what he was talking about how AI influences all those things is the computer can generate a bunch of stuff.But as an artist, it's our job to read into that and pick up on the interesting parts and figure out how we want to apply that.
And so looking at the next evolution of our jobs, like that's the cool part, right?Is pulling in AI to give us a base layer and then we get to decide what gets included and how it gets built.
So I didn't mean to get on a mini soapbox about it, but it was very interesting.
Yeah, I'm feeling that pull more and more every day, I gotta say.
Yeah, so cool.And then I'm going to plug my newsletter.
So if you go to brokencomb.dev, so the whole idea behind the newsletter is that with dev and tech stuff and design, we go wide on a bunch of topics, but then you also go deep as you gain experience.
So, you know, today you might just know front end a little bit, but now you can go a little bit deeper on databases and Prisma and how you interact with that data.So the newsletter tries to do a good job of going wide and deep on specific topics.
So brokencomb.dev.Well, that is going to wrap it up for another episode of Compressed FM.Please leave a rating and review.It just helps other great people like yourself be able to find the podcast.In the meantime, that's all we've got.