Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Nest.js: A Progressive Node.js Framework

You're reading from  Nest.js: A Progressive Node.js Framework

Product type Book
Published in Nov 2019
Publisher Packt
ISBN-13 9781800204737
Pages 317 pages
Edition 1st Edition
Languages
Authors (5):
Greg Magolan Greg Magolan
Profile icon Greg Magolan
Patrick Housley Patrick Housley
Profile icon Patrick Housley
Adrien de Peretti Adrien de Peretti
Profile icon Adrien de Peretti
Jay Bell Jay Bell
Profile icon Jay Bell
David Guijarro David Guijarro
Profile icon David Guijarro
View More author details

Table of Contents (16) Chapters

Preface
1. Introduction 2. Overview 3. Nest.js authentication 4. Dependency Injection system of Nest.js 5. TypeORM 6. Sequelize 7. Mongoose 8. Web sockets 9. Microservices 10. Routing and request handling in Nest.js 11. OpenAPI (Swagger) Specification 12. Command Query Responsibility Separation (CQRS) 13. Architecture 14. Testing 15. Server-side Rendering with Angular Universal

ORM

An ORM is an Object-relational mapping and is one of the most important concepts when dealing with communication between a server and a database. An ORM provides a mapping between objects in memory (Defined classes such a User or Comment) and Relational tables in a database. This allows you to create a Data Transfer Object that knows how to write objects stored in memory to a database, and read the results from an SQL or another query language, back into memory. In this book, we will talk about three different ORMs: two relational and one for a NoSQL database. TypeORM is one of the most mature and popular ORMs for Node.js and thus has a very wide and flushed out feature set. It is also one of the packages that Nest provides its own packages for: @nestjs/typeorm. It is incredibly powerful and has support for many databases like MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, and WebSQL. Along with TypeORM, Sequelize is also another ORM for relational data.

If TypeORM is one of the most popular ORMs, then Sequelize is THE most popular in the Node.js world. It is written in plain JavaScript but has TypeScript bindings through the sequelize-typescript and @types/sequelize packages. Sequelize boasts strong transaction support, relations, read replication and many more features. The last ORM covered in this book is one that deals with a non-relational, or NoSQL, database. The package mongoose handles object relations between MongoDB and JavaScript. The actual mapping between the two is much closer than with relational databases, as MongoDB stores its data in JSON format, which stands for JavaScript Object Notation. Mongoose is also one of the packages that has a @nestjs/mongoose package and provides the ability to query the database through query chaining.

You have been reading a chapter from
Nest.js: A Progressive Node.js Framework
Published in: Nov 2019 Publisher: Packt ISBN-13: 9781800204737
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}