Posts

Showing posts with the label cloud

Instructions for installing MinIO with Docker

Image
Introduction MinIO is a high-performance, open-source Object Storage system that is fully compatible with the Amazon S3 API. Key advantages include ultra-fast data processing speeds, a lightweight cloud-native architecture, easy scalability, and high security with advanced data encryption capabilities. Detail First, create a docker-compose.yml file with the following content, changing the YOUR_ACCESS_KEY and YOUR_SECRET_KEY values to suit your needs: services : minio : image : quay.io/minio/minio:latest container_name : minio-dev ports : - "9000:9000" - "9001:9001" environment : MINIO_ROOT_USER : YOUR_ACCESS_KEY MINIO_ROOT_PASSWORD : YOUR_SECRET_KEY volumes : - minio_data:/data command : server /data --console-address ":9001" volumes : minio_data : Run the docker container as follows: docker-compose up -d If you want to use an interface for easier management, you need to install the MinIO Client (...

User Guide for Zustand

Image
Introduction Zustand is an extremely lightweight, fast, and easy-to-use state management library for React applications. Highlighted advantages of Zustand include: No need for a Provider to wrap the application Extremely concise syntax that reduces boilerplate code Excellent support for TypeScript High performance thanks to a mechanism that only re-renders necessary components. Detail First, install it into your project as follows: yarn add zustand Let's start with a simple Counter app example for you to easily understand how to use it. Create file useCounterStore.ts import {create} from 'zustand' interface CounterState { count : number increment : () => void decrement : () => void reset : () => void } const useCounterStore = create < CounterState >( set => ({ count: 0 , increment : () => set ( state => ({ count: state.count + 1 })) , decrement : () => set ( state => ({ count: state.count - 1 })) , res...

Guide to Querying and Pagination with AWS DynamoDB in NestJS

Image
Introduction In my previous article, I provided a basic guide on initializing and using AWS DynamoDB, but in this article, we will delve deeper into QueryCommand. In AWS DynamoDB, the Query method allows you to search for data based on the primary key (Partition Key) and filter conditions (Sort Key). To optimize performance and cost, DynamoDB supports a Pagination mechanism through the ExclusiveStartKey and LastEvaluatedKey parameters. Applying pagination not only reduces the data transfer load but also enables the application to handle large data tables smoothly, ensuring system stability. Detail Use AWS CDK to create the file lib/dynamodb-gsi-stack.ts import * as cdk from "aws-cdk-lib" import * as dynamodb from "aws-cdk-lib/aws-dynamodb" import { Construct } from "constructs" export class DynamoDbGsiStack extends cdk . Stack { constructor ( scope : Construct , id : string , props ?: cdk . StackProps ) { super (scope, id, props) ...