Writing
Notes, deep dives, and technical write-ups on the things I build.
- Guides 4 min read
Make your own cache tool - Redis cache by Nodejs
Learn how to build your own Redis cache tool using Node.js.
- Algorithms 5 min read
Race Conditions in Production: Detection, Prevention, and Practical Solutions
Race conditions are not a new problem, but they remain one of the most common issues in systems that scale to millions of requests. Your application may appear to be running correctly, yet the data becomes inconsistent, and you may not immediately understand why.
- Algorithms 3 min read
Greedy Algorithm: Recognizing the Pattern Behind the Solution
Greedy algorithms are a powerful tool for solving optimization problems. In this post, I share my insights on how to recognize when a greedy approach is applicable and how to implement it effectively.
- Algorithms 2 min read
The Hidden Complexity of Prorated Billing
Lessons learned from building and launching VatGiaTop, a platform for construction material pricing.
- Software Engineering 3 min read
How to Design APIs That Survive Product Growth
Designing APIs that can evolve with your product is crucial for long-term success. This article explores key patterns and best practices to ensure your APIs remain robust and adaptable as your product grows.
- Software Engineering 3 min read
I Thought Building the Product Was the Hard Part. I Was Wrong.
Lessons learned from building and launching VatGiaTop, a platform for construction material pricing.
- Software Engineering 3 min read
Method of Real-Time Communication
An overview of methods for implementing real-time communication in web applications.
- System Design 3 min read
Scaling a System from Zero
Scaling a system from zero to millions of users requires a clear roadmap.
- Next.js 1 min read
Implement i18n Configuration for Next.js Project
A comprehensive guide to setting up internationalization (i18n) in a Next.js project, enabling support for multiple languages and locales.
- Guides 1 min read
Necessary setup for a new Nextjs project
A necessary setup for a Nextjs project.
- JavaScript 3 min read
Non-blocking I/O in JavaScript
To understand what is non-blocking I/O in JavaScript and keep it in mind while coding.
- Software Engineering 2 min read
Internet and Web Version
Introduction to the internet and web version includes web1.0, web2.0, web3.0, and web4.0
- React 1 min read
React Pattern Overview
Overview of React Pattern
- React 1 min read
Optimize parallel processing in React application
Optimize parallel processing in React application by using Scatter-Gather pattern, Work-stealing pattern
- React 2 min read
Optimizing Web Worker performance
Web Worker
- Software Engineering 2 min read
Authentication models
The summary of authentication models which help you to make decision with authentication to your project.
- Guides 1 min read
The comparison of Vite build, SWC, and TSC in NestJS
Comparison of build tools when coding with Typescript.
- Algorithms 1 min read
String compression
Solutions for String Compression.
- Design Patterns 1 min read
Singleton
Singleton pattern - Create only one instance on the application lifecycle.
- Design Patterns 3 min read
Design pattern
Overview design pattern - OOP design.
- Design Patterns 1 min read
[Structural] Bridge
A method to connect multiple standalone objects
- Design Patterns 1 min read
[Structural] Composite
A way to structure a group of objects
- Design Patterns 1 min read
[Structural] Adapter
Create a layer to connect an old layer to a new layer
- JavaScript 1 min read
Arrow function vs Regular Function
The different between regular function and arrow function.
- JavaScript 2 min read
Deep copy vs Shallow copy
The summarize of copy method in javascript.
- Design Patterns 1 min read
Prototype pattern
An object needs to be cloned from an existing object.
- Design Patterns 1 min read
Builder Pattern
There are many variations for one type; instead of passing parameters to the constructor, using a builder is more convenient.
- Design Patterns 1 min read
Abstract Factory
Using the Factory Method Pattern to add many types within the same family is considered an Abstract Factory.
- Design Patterns 1 min read
Factory Method
If there is only one factory for all Products, it is no longer the Factory Method but a Simple Factory.
- Software Engineering 1 min read
[SOLID] Dependencies Inversion Princple
Use it when you anticipate that a class or module will have many variations and will be used in multiple places.
- Software Engineering 1 min read
[SOLID] Interface Segregation Principle
Used to break down large interfaces into smaller ones for easier maintenance and extension.
- Software Engineering 1 min read
[SOLID] Liskov Substitution Principle
When adhering to this principle, derived classes should be substitutable for their base classes without altering the correctness of the program.
- Software Engineering 1 min read
[SOLID] Open-Close Principle
The Open-Closed Principle (OCP) is used to achieve an extensible design for maintaining modules or classes. The principle itself applies to both classes and modules.
- Software Engineering 1 min read
[SOLID] Single responsibility Principle
Use when you estimate the class can be reused in many places and has the potential for extension.
- JavaScript 1 min read
Operator (??, ||, !!, ??=, &&=) - Nullish coalesing, logical operator
The different between ??, ||, !!, ??=, &&= ...
- JavaScript 1 min read
Immutable in Javascrip
An immutable value is a variable's value that cannot be changed without creating an entirely new value.
- Software Engineering 1 min read
Coupling vs Cohesion
Distinguish Coupling and Cohesion.
- Software Engineering 1 min read
Horizontal vs Vertical scale
Horizontal scaling can be understood as scaling out by duplicating, while vertical scaling involves upgrading the resources of the individual instance.
- Software Engineering 1 min read
4 Principles of Object-Oriented Programming
The 4 Principles of Object-Oriented Programming must be remember.
- Software Engineering 2 min read
Identify Monoliths, microservices and serverless
The different between horizontal scale and vertical scale.
- JavaScript 1 min read
Access Modifiers
Access modifier - using getter, setter to access property in typescript.
- JavaScript 2 min read
Execution Context
Execution context is the environment where code is executed, consisting of three main contexts...
- JavaScript 2 min read
Garbage collection
The mechanism of garbage collection in javascript.
- Git 1 min read
Commit convention
Using commit conventions makes it easy to read, easy to find, and reading commit content can also understand the scope and content of code changes.
- Software Engineering 1 min read
SOLID Principle
The overview of SOLID.