Nestjs

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/5

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

6 Terms

1
New cards

What is a middleware in Nestjs

Middleware is a function which is called before the route handler. Middleware functions have access to the request and response objects, and the next() middleware function in the application’s request-response cycle. The next middleware function is commonly denoted by a variable named next.

You implement custom Nest middleware in either a function, or in a class with an @Injectable() decorator. The class should implement the NestMiddleware interface, while the function does not have any special requirements.

<p><span>Middleware is a function which is called </span><strong>before</strong><span> the route handler. Middleware functions have access to the </span>request<span> and </span>response<span> objects, and the </span><code>next()</code><span> middleware function in the application’s request-response cycle. The </span><strong>next</strong><span> middleware function is commonly denoted by a variable named </span><code>next</code><span>.</span></p><p><span>You implement custom Nest middleware in either a function, or in a class with an </span><code>@Injectable()</code><span> decorator. The class should implement the </span><code>NestMiddleware</code><span> interface, while the function does not have any special requirements.</span></p>
2
New cards

How Nestjs uses microservices?

  • Nest supports several built-in transport layer implementations, called transporters, which are responsible for transmitting messages between different microservice instances.

  • Most transporters natively support both request-response and event-based message styles.

  • Nest abstracts the implementation details of each transporter behind a canonical interface for both request-response and event-based messaging.

  • This makes it easy to switch from one transport layer to another. For example to leverage the specific reliability or performance features of a particular transport layer without impacting your application code.

3
New cards

What are Message and Event Patterns?

Microservices recognize both messages and events by patterns. A pattern is a plain value, for example, a literal object or a string. Patterns are automatically serialized and sent over the network along with the data portion of a message. In this way, message senders and consumers can coordinate which requests are consumed by which handlers.

4
New cards

what is MQTT in Nesjts

MQTT is an OASIS standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish/subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth.

  • MQTT (Message Queuing Telemetry Transport) is an open source, lightweight messaging protocol, optimized for low latency.

  • This protocol provides a scalable and cost-efficient way to connect devices using a publish/subscribe model.

  • A communication system built on MQTT consists of the publishing server, a broker and one or more clients.

  • It is designed for constrained devices and low-bandwidth, high-latency or unreliable networks.

5
New cards

Let's assume that you want to deploy REST API on aws. What are the steps? If I don't want to use for example Kubernetes, I want to use something else. What are your suggestions?

I’d approach it by first understanding the API’s requirements—its traffic profile, latency expectations, and operational complexity. If Kubernetes is off the table, there are still several robust options on AWS for deploying REST APIs.

<p>I’d approach it by first understanding the API’s requirements—its traffic profile, latency expectations, and operational complexity. If Kubernetes is off the table, there are still several robust options on AWS for deploying REST APIs.</p>
6
New cards

What is GraphQL in Nestjs

GraphQL is a powerful query language for APIs and a runtime for fulfilling those queries with your existing data. It's an elegant approach that solves many problems typically found with REST APIs.

  • You fetch exactly what you need in a single query.

  • There's no need for multiple endpoints.

  • You reduce bandwidth and simplify client-side logic