Posts

Showing posts with the label scalability

Distribution System Practice Series

Image
Introduction A distribution system is a collection of independent computers in terms of hardware but communicating and coordinating with each other through a computer network, making end users feel like a single centralized system. In the era of big data and cloud computing, distributed architecture plays a backbone role for almost all large-scale online services. Core Characteristics For a system to be considered truly distributed, it must face and solve the following technical characteristics: No Shared Clock : Each node has its own physical clock and there is always a certain clock drift. Therefore, you cannot rely on absolute real time to determine the order of events happening between nodes. No Shared Memory : Nodes cannot directly read or write to each other's RAM. Every communication activity and state synchronization must be done through message passing such as protocols like HTTP/REST, gRPC or message brokers like Kafka, RabbitMQ. Concurrency : Multiple nodes process indep...

Guide to Initializing and Connecting AWS DynamoDB

Image
Introduction Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability at any scale. Key benefits include: unlimited scalability, extremely low latency in milliseconds, built-in security, and flexible pricing models based on usage (On-demand) to optimize costs. Detail Use AWS CDK to create the lib/dynamodb-stack.ts file import * as cdk from "aws-cdk-lib" import * as dynamodb from "aws-cdk-lib/awsf-dynamodb" import { Construct } from "constructs" export class DynamodbStack extends cdk . Stack { constructor ( scope : Construct , id : string , props ?: cdk . StackProps ) { super (scope, id, props) const productTable = new dynamodb. Table ( this , "ProductTable" , { tableName: "Products" , partitionKey: { name: "id" , type: dynamodb.AttributeType. STRING , }, billingMode: dynamodb.Bi...

NestJS Practice Series

Image
Introduction NestJS is a progressive NodeJS framework designed for building efficient, reliable, and scalable server-side applications. Built on top of TypeScript (but also supporting pure JavaScript), NestJS combines elements of Object-Oriented Programming (OOP), Functional Programming (FP), and Functional Reactive Programming (FRP). The outstanding advantages of NestJS include: Modular architecture: Helps organize code scientifically, easy to maintain and expand for large projects. Powerful TypeScript support: Fully leverage static typing to minimize errors during development. Flexibility: Allows easy integration with other libraries (like Express or Fastify) and supports a wide variety of communication protocols (REST, GraphQL, WebSockets, Microservices). Rich ecosystem: Provides ready-to-use tools for processing common tasks like Validation, Caching, Database mapping (TypeORM/Prisma), and Authentication. Dependency Injection: A powerful mechanism that helps manage...