The Hypertext Transfer Protocol (HTTP) is the foundation of data communication on the web. Although HTTP/1.1 has been a standard since 1997, many web developers don’t fully utilize its advanced features for optimized performance. In this post, I’ll explain some key capabilities in HTTP 1.1 and how to leverage them.

HTTP History

Read more »

When structuring Express apps, middleware play a crucial role in handling cross-cutting concerns like logging, security, and error handling. However, as our middleware chain grows, managing the installation order can quickly become messy. In this post, I’ll go over a few patterns for installing Express middleware - from simple to more advanced - and discuss the pros and cons of each approach. The goal is to provide some ideas and best practices to keep our middleware pipeline maintainable as our app grows.

Read more »

Introduction

As of the writing time, I have been working for over five years. In recent years, with the gradual accumulation of work experience, more and more colleagues and peers have approached me for help in solving challenging problems, such as Node.js memory leak detection, database connection pool leak detection (where connections are held for a long period), performance optimization, deadlock detection, among others. Today, I will use database connection pool leak detection as an example to summarize a set of approaches for troubleshooting complex issues for future reference - my best practices to troubleshooting.

Overall, my approach to analyzing complex issues can be broken down into eight steps.

Read more »

Introduction

In the ever-evolving realm of software development, errors and exceptions are constant companions. These errors can be broadly categorized into two types: programming errors and operational errors. While programming errors are typically caught during development and testing phases, operational errors are the real-world hurdles that applications must gracefully navigate in production environments. In this blog, we will shine a spotlight on the art of handling operational errors and delve into the pivotal role played by a central error class in Node.js.

Read more »

Chapter 6 of this book discusses Transactions. For decades, transactions have been the mechanism of choice for simplifying these issues. A transaction is a way for an application to group several reads and writes together into a logical unit. Conceptually, all the reads and writes in a transaction are executed as one operation: either the entire transaction succeeds (commit) or it fails(abort, rollback).
Transactions are created with a purpose: to simplify the programming model for applications accessing a database. By using transactions, the application is free to ignore specific potential error scenarios and concurrency issues.

Read more »

Chapter 6 of this book discusses the concept of data partitioning. The chapter explains how data partitioning can be used to improve the scalability and performance of distributed systems. The author describes various partitioning techniques and their advantages and disadvantages. The chapter also covers the challenges that arise when partitioning data, such as data skew and hotspots, and explains how to mitigate these issues. Overall, Chapter 6 provides a comprehensive overview of the partitioning strategies that can be used in modern distributed systems.

Read more »

Last section of Chapter 5 is Leaderless Replication. Leaderless Replication is a different approach compared to Single Leader Replication and Multi-Leader Replication, abandoning the concept of a leader and allowing any replica to directly accept writes from clients. In some leaderless replication implementations, the client directly sends its writes to several replicas, while in others, a coordinator node does this on behalf of the client.

Read more »

Chapter 5 of this book covers the important topic of replication in the context of database systems. Replication is the process of creating and maintaining multiple copies of the same database on different servers. This is done to ensure data availability, improve performance, and provide fault tolerance.

The chapter starts by introducing the concept of replication and its benefits. It then goes on to explain the different types of replication, including master-slave, master-master, and multi-master replication. Each type is discussed in detail, with its advantages and disadvantages.

Read more »

This chapter focuses on the challenges of encoding and evolving data formats in distributed systems.

The chapter begins by discussing how data formats can impact system design and evolution. It then explores two common approaches to data encoding: binary encoding and text encoding. Binary encoding is more efficient but less human-readable, while text encoding is less efficient but more human-readable.

Read more »
0%