Better Programming

Advice for programmers.

Follow publication

Member-only story

Prisma vs. TypeORM

A practical look at database tools in the Node.js/TypeScript ecosystem

Nick McHenry
Better Programming
Published in
13 min readSep 1, 2020
Photo by Tobias Fischer on Unsplash

Working with databases is an unavoidable part of being a backend developer.

In particular, the server-side JavaScript ecosystem offers an endless number of libraries that aim to make this task less painful. Some of the most popular include:

  • Sequelize (an object-relational mapper, or ORM, library)
  • pg/mysql (JavaScript clients for interfacing with a specific database)
  • Knex.js (a general-purpose query builder)

Each of these libraries has its strengths and weaknesses.

Using a lower-level library like pg offers significant performance benefits at the cost of being challenging to maintain over time (as you’re writing raw SQL queries). Nonetheless, using these libraries can be confusing for new developers as they require a strong understanding of SQL.

On the other end of the spectrum, ORMs like Sequelize offer convenient abstractions that often simplify working with databases. Nevertheless, they come at the cost of performance as the underlying SQL that is generated is generally less efficient than if an experienced programmer wrote it.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Nick McHenry
Nick McHenry

Written by Nick McHenry

Software Developer and Architect. I write about software engineering and up-and-coming technology. Become a Medium member https://bit.ly/3FEQ1Zd

Responses (4)

Write a response