CodingNic
← Back to Courses
Databases & ORMs for Node.js
Intermediate 10 Modules Self-Paced Learning

Databases & ORMs for Node.js

Connect real databases to Node.js applications, raw SQL with PostgreSQL, the Prisma ORM, MongoDB and Mongoose, including relationships, migrations, and a full CRUD API backed by a real database.

Welcome to Databases & ORMs for Node.js, the second course in a backend development track. Every project so far has stored its data in an in-memory array, gone the moment the server restarts. This course replaces that array with a real, persistent database: PostgreSQL first, with raw SQL and then the Prisma ORM, followed by MongoDB, with its native driver and then Mongoose.

⚠️ Prerequisite: This course requires working knowledge of Node.js and Express, models, controllers, routes, async/await, and building a REST API, covered in Node.js & Express Foundations. If you haven’t taken that course, start there first.

Why This Course?

Knowing Express isn’t enough to build a real application, at some point the data has to actually persist. This course starts with raw SQL against a real PostgreSQL database, so the ORM that comes right after isn’t a black box, then introduces Prisma to show what an ORM actually buys you: models, migrations, and a typed query API in place of hand-written SQL strings. From there it moves to MongoDB, a genuinely different way of modeling data, first with the native driver, then with Mongoose for schemas and validation. The course closes by rebuilding a full CRUD API against a real database, the same MVC structure from the first course in this track, now with real persistence underneath it.

What Makes It Different

  • Starts with raw SQL and the pg driver before ever introducing an ORM, so Prisma’s migrations and generated client are understood, not just trusted.
  • Every code example in this course is written to actually run, verified against a real PostgreSQL or MongoDB database, not described from memory.
  • Covers two genuinely different database models, relational (PostgreSQL) and document-based (MongoDB), not just one.
  • Treats relationships, one-to-many and many-to-many in SQL, embedding versus referencing in MongoDB, as a first-class topic with real trade-offs, not a single paragraph.
  • Ends with a capstone that reuses the MVC structure from Node.js & Express Foundations, swapping an in-memory array for a real database with minimal changes to routes or controllers.

Learning Format

Each module builds on the last: concepts are introduced with runnable examples against real databases, then practiced in hands-on exercises. By the end of the course, every piece, raw SQL, Prisma, MongoDB, and Mongoose, comes together in a capstone project with real persistence.

Final Outcome

By the end of this course, you’ll be able to connect a Node.js application to a real database, relational or document-based, design schemas and relationships correctly, and build a complete CRUD API backed by real, persistent data. From here, the next courses in this track pick up production-readiness (authentication, validation, security, testing) and scaling and deployment, building directly on the foundation practiced here.

What You'll Learn

✓ Connect a Node.js application to PostgreSQL and write parameterized, injection-safe SQL
✓ Explain what an ORM does and set up Prisma against a real PostgreSQL database
✓ Define models, run migrations, and query a database with Prisma Client
✓ Model one-to-many and many-to-many relationships in a relational schema
✓ Connect a Node.js application to MongoDB with the native driver
✓ Define schemas and models with Mongoose, including validation
✓ Choose between embedding and referencing when modeling MongoDB relationships
✓ Build a complete CRUD API backed by a real, persistent database