Is there a Prisma killer on the loose?

Issue #168.March 9, 2023.2 Minute read.
Bytes

The Oscars are happening this Sunday, so I hope you’re all prepared for our annual tradition in Monday’s issue 👀.

As for today, we’ve got the Drizz rizz, Firebase harnessing Ronnie Coleman, and Turborepo’s team-building tattoos.

Welcome to #168.


Eyeballs logo

The Main Thing

Snoop Dogg holding the drizzle logo like a joint.

Fo' Drizzle.

Is there a Prisma killer on the loose?

There definitely maybe is. And its name is Drizzle — as in, “Please drizzle some of that sweet, type-safe honey on this ORM biscuit.” (Yes, I’m hungry.)

To put it a little less metaphorically, Drizzle is a TypeScript ORM for SQL databases.

Ok, but doesn’t that just sound like Prisma? Yes, but there are some key differences. To understand what those are, let’s first take a closer look at Prisma itself:

  • Prisma gives you a type-safe client that lets you query your database from your app. To do this, you have to define your DB schema in a Prisma-specific format, then run a code gen step to target the language you want (which requires some additional tooling).

  • This approach allowed the Prisma schema file be a neutral source of truth, so you could generate clients for any language. But when Prisma realized that most developers just wanted to use TypeScript, they stopped supporting Go and abandoned their plans to support other languages too.

  • This original decision to prioritize multi-language support came with some tradeoffs that still persist today — like increased complexity and some performance issues (especially for serverless environments, which can experience long cold starts).

Drizzle, on the other hand, has been in an exclusive relationship with TypeScript since Day 1, and it’s never tried dating around with other languages. This monogamous focus has allowed it to optimize for max type safety, performance, and ease of use for TS developers.

Here’s how it works:

  • Drizzle says that “If you know SQL, you know Drizzle ORM.” That’s because it’s basically just a type-safe version of SQL. And because your schema is written in TS, you can avoid the code gen step of Prisma (and the potential perf issues). It’s all done through inference.

  • Drizzle Kit is similar to Prisma’s declarative schema management tool that lets you define your schema and allow it to make changes to your DB. But once again, you do it all in plain TypeScript — without the increased complexity of installing additional tools, like you do with Prisma.

Bottom Line: It’s still early days, but doubling down on TypeScript always seems like a smart strategy. And I’ve learned to never bet against the type nerds, so we’ll be keeping an eye on Drizzle, fo’ shizzle.

        

sleuth logo

Our Friends
(With Benefits)

priest blessing some servers

Deploying my team's code on a hope and a prayer.

Sleuth’s free book will blow your mind

Does your team’s deployment strategy remind you of furiously cleaning your freshman dorm room before cleaning checks? Has anyone on your team ever actually used the term “deployment strategy” in a sentence?

It’s ok, you’re not alone. That’s why Sleuth’s CEO & Co-founder, Dylan Etkin, wrote The Ultimate Guide to Going from Zero to One Hundred Deploys a Day.

It’s a 60-page (free) ebook that shows how elite teams at Google, Amazon, and Atlassian slowly worked their way up to deploying 100 times a day 😱. And it gives you an actionable road map to apply those same principles to help your own team, no matter what size.

“But what does Mr. Fancy CEO Man know about deploying software?” Quite a bit, actually. Before starting Sleuth, Dylan was one of the first 20 employees at Atlassian and the first architect of Jira. So yeah, we trust him.

Check it out — and learn how to deploy like the best.


Tip logo

The Tip

Presented by Datadog

Their Front-end Developer Kit is jam-packed with best-practice guides, solution briefs, and videos to help you better understand your app’s user activity.

One of my favorite tricks in making a button feel more alive is translating its position by 1px when it is active. This gives sensation that it’s being pressed and is pretty easy to implement. All we need to do is add a transform to the active pseudo selector and a transition to the button to make it nice and smooth.

button {
  transition: all .2s ease-in-out;
}

button:active {
  transform: translateY(1px);
}

Since there’s a chance that button might be disabled, the :not selector comes in handy to only apply the transform if the button isn’t disabled.

button {
  transition: all .2s ease-in-out;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

Nice, much more satisfying to click.


Cool Bits logo

Cool Bits

  1. Dax Raad made a great video about Drizzle that covers a lot more detail than we were able to. Check it out if you want to go deeper into that Drizz rizz.

  2. FusionAuth’s simple auth solution will change your life. It adds login, registration, SSO, MFA, and a bazillion other features to your app in days – not months. [sponsored]

  3. We now have CSS Nesting built into the CSS language itself. Adam Argyle did a good write up, but I personally think that Yzma from Emporer’s New Groove gave the best explanation.

  4. Firebase just released Firestore Lite — a more lightweight version of the full Firestore SDK. *Extreme Ronnie Coleman voice*: “Lightweight babyyyyy.”

  5. The Signia Team wrote a helpful breakdown of the trendiest topic in web dev, called What are Signals?

  6. The Turborepo team wrote about Why Turborepo is migrating from Go to Rust. But they conveniently forgot to mention Jared’s lower back tattoo of Salad Fingers 🧐.

  7. Astro just released their 2023 Web Framework Performance Report. Coincidentally the fast frameworks had no issue with the report while the slow frameworks said it was full of bias.

  8. Will Larson wrote a great article on Running your engineering onboarding program. It sounds a lot more effective than the onboarding process at my last job — where they handed me a couple O’Reilly books and a pack of Virginia Slims, and said that I’d “earn my Slack privileges in a couple weeks.”