Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Nest.js: A Progressive Node.js Framework

You're reading from   Nest.js: A Progressive Node.js Framework Hit the ground running with Nest.js

Arrow left icon
Product type Paperback
Published in Nov 2019
Publisher Packt
ISBN-13 9781800204737
Length 317 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (6):
Arrow left icon
Greg Magolan Greg Magolan
Author Profile Icon Greg Magolan
Greg Magolan
Patrick Housley Patrick Housley
Author Profile Icon Patrick Housley
Patrick Housley
Backstop Media LLC Backstop Media LLC
Author Profile Icon Backstop Media LLC
Backstop Media LLC
Adrien de Peretti Adrien de Peretti
Author Profile Icon Adrien de Peretti
Adrien de Peretti
Jay Bell Jay Bell
Author Profile Icon Jay Bell
Jay Bell
David Guijarro David Guijarro
Author Profile Icon David Guijarro
David Guijarro
+2 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface
1. Introduction FREE CHAPTER 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 €18.99/month. Cancel anytime