JavaScript NestJS TypeScript

API with NestJS #21. An introduction to CQRS

This entry is part 21 of 121 in the API with NestJS

So far, in our application, we’ve been following a pattern of controllers using services to access and modify the data. While it is a very valid approach, there are other possibilities to look into. NestJS suggests command-query responsibility segregation (CQRS). In this article, we look into this concept and implement it into our application. Instead of keeping […]

JavaScript NestJS TypeScript

API with NestJS #20. Communicating with microservices using the gRPC framework

This entry is part 20 of 121 in the API with NestJS

With NestJS, we have quite a few transport layer implementations prepared for microservices. Among them, the gRPC transporter is definitely one of the most interesting. In this article, we explore the idea and implement it with NestJS. gRPC is, at its core, a Remote Procedure Call (RPC) framework. Its main idea revolves around creating services […]

JavaScript NestJS TypeScript Uncategorized

API with NestJS #19. Using RabbitMQ to communicate with microservices

This entry is part 19 of 121 in the API with NestJS

NestJS subscribes to the idea that a microservice is an application that uses a different transport layer than HTTP. Therefore, in the previous part of this series, we’ve used TCP. However, with NestJS, we have a broad selection of transporters that transmit messages across microservices. Each one of them is different, and it is worth exploring […]

JavaScript NestJS TypeScript

API with NestJS #17. Offset and keyset pagination with PostgreSQL and TypeORM

This entry is part 17 of 121 in the API with NestJS

As our database grows, so do the results of our queries. Returning a lot of data in our API might not be the best approach performance-wise. Dividing our content into multiple pages and solutions like infinite scrolling have been around for quite some time. In this article, we explore ways of implementing pagination and point […]

JavaScript NestJS SQL TypeScript

API with NestJS #16. Using the array data type with PostgreSQL and TypeORM

This entry is part 16 of 121 in the API with NestJS

Storing arrays is not an obvious thing in the world of SQL databases. Solutions such as MySQL, MariaDB, or Microsoft SQL Server don’t have a straightforward column type for arrays. This article explores how the array data type works in PostgreSQL both through SQL queries and through TypeORM. By learning how to operate on arrays […]

JavaScript NestJS TypeScript

API with NestJS #14. Improving performance of our Postgres database with indexes

This entry is part 14 of 121 in the API with NestJS

As our system grows, certain queries on our database might fail us in terms of performance. One of the popular ways of dealing with this issue are indexes. This article explores how we can use them both through TypeORM and writing our own Postgres queries. Introduction to indexes When we store information on a disk, […]

Git

Getting geeky with Git #8. Improving our debugging flow with Bisect and Worktree

This entry is part 8 of 11 in the Getting geeky with Git

The debugging process is not always easy, and the bugs are sometimes difficult to track down. Fortunately, Git provides us with tools that might make this process easier. In this article, we learn both the worktree and bisect tools. Git Worktree Sometimes, when we focus on a new feature, a bug pops up in production. Unfortunately, this […]