Skip to content

Data Management Tools

This content is for Backend. Switch to the latest version for up-to-date documentation.

Managing raw SQL can be hard. We use tools to help us.

An ORM lets you interact with your database using your programming language (like JavaScript) instead of writing raw SQL queries.

  • Prisma: Modern ORM for TypeScript and Node.js. Very popular.
  • Drizzle: Lightweight and fast ORM.

Instead of SELECT * FROM users, you write:

const users = await prisma.user.findMany();

For a deeper guide (schema, queries, raw SQL, and an Express example), see:

Database Migrations are like version control for your database schema. They treat changes to your database structure (like adding a column) as code.

  • Helps teams stay in sync.
  • Allows you to roll back changes if something breaks.
  • Edit schema.prisma
  • Run a migration to update your database schema
  • Prisma generates migration files and updates the client

Caching stores copies of data in a faster storage (usually RAM) so future requests for that data can be served faster.

  • Browser Caching: The browser saves images/css.
  • Server Caching: The server saves HTML or API responses.
  • Database Caching: Using Redis to store frequent queries.
  • Memcached (mentioned): A simple, in-memory cache (key/value). Often used for very fast caching, but with fewer features than Redis.
Diagram
Built with passion by Ngineer Lab