Posts

Showing posts with the label backend development

NestJS Controller and Swagger Guide

Image
Introduction NestJS is a progressive Node.js framework built with TypeScript, facilitating the development of efficient and scalable server-side applications. By default, NestJS uses Express as its core HTTP processing library. Key advantages include a tight modular architecture inspired by Angular and strong TypeScript support to reduce code errors. Controllers serve as the layer for processing incoming requests and returning responses to the client side. Their primary responsibility is to receive HTTP requests, route data to business logic services, and coordinate the returned result in the correct format. Swagger is a powerful suite of tools used for designing, building, and documenting RESTful APIs developed based on the OpenAPI data format specification. In NestJS, it helps automatically generate an intuitive UI interface for testing endpoints, enabling developers and stakeholders to understand the API structure without directly reading the source code. Detail After creating the N...

OLTP and OLAP

Image
Introduction In Postgres , OLTP and OLAP are two completely different database system design philosophies serving distinct purposes. Postgres itself is an extremely powerful relational database management system (RDBMS). By default, it is highly optimized for OLTP  and thanks to its rich ecosystem of extensions, Postgres can also fully support OLAP workloads. Here is the detailed difference between these two concepts: OLTP Online Transaction Processing : focuses on fast, accurate and secure processing of a large number of continuous financial or operational transactions from end users. Data characteristics: Data changes constantly ( Insert, Update, Delete continuously). Query Pattern : Read/write statements acting on one or a few specific data rows (for example, finding info of a specific customer with WHERE id = 123 ). Advantages Data integrity ( ACID ): Postgres guarantees absolute transaction integrity without errors or data loss, thanks to its locking mechanisms and MVCC ...