Persist application data from Node into real databases — connect to PostgreSQL with the node-postgres driver, run safe parameterised queries, and pool connections for performance. Layer an ORM such as Prisma or Sequelize on top, understand migrations, and store documents in MongoDB with Mongoose. You finish able to design and build the data-access layer of a production Node service.
Watch the free preview
Connecting and running parameterised queries — free to watch, no account needed.
What you'll learn
- Persist application data in PostgreSQL and MongoDB from a Node application
- Run parameterised SQL with node-postgres to prevent SQL injection
- Manage database connections efficiently with a connection pool
- Model data and run migrations with an ORM such as Prisma or Sequelize
- Structure persistence behind a clean data-access layer with transactions
Syllabus
Talking to PostgreSQL from Node
Connecting and running parameterised queriesFree preview
Connection pooling with pg.Pool
Structuring Persistence — Layers and Transactions
Building a data-access layer
Transactions and data integrity
Working at a Higher Level — ORMs
Prisma — a schema-first ORM with migrations
Sequelize — a model-first ORM
Documents and Production-Ready Persistence
MongoDB with Mongoose as an alternative
Making persistence production-ready
Lab — 10 Exercises & Solutions
Exercises 1–5
Exercises 6–10