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.
DDIA reading notes - chapter 6 Partitioning
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.
DDIA reading notes - chapter 5 Replication (Part II)
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.
DDIA reading notes - chapter 5 Replication (Part I)
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.
DDIA reading notes - chapter 4 Encoding & Evolution
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.
使用 OpenAPI 设计 RESTful API (一)
0x00. OpenAPI 简介
在之前的文章 Restful API 设计指导 中,我介绍了如何设计 Restful API。随着前后端的分离以及软件架构的复杂化,你是否也遇到过以下的一个或者多个问题呢?
- API 的设计和实现并非同一个人。无论是在大型互联网架构中还是复杂的软件开发中,API 的设计往往是有架构师、资深工程师、PM 等这些经验丰富的人负责。一旦设计完成,才将具体的开发任务分配给相应的 API 开发工程师。
- API 有完整的测试。越是复杂的产品,对产品的质量有越高的要求,一般而言会有专门的测试团队对 API 进行完整的自动化测试。
- 前端开发工程师(或者 API 的调用方)和 API 工程师协同开发,因此前端工程师需要 Mock API 以解除对 API 开发进度的依赖。
一按钮不正常显示的 Debug 记录
INVALID_STATE_ERR Debug 记录
HTTP 缓存不完全指南
Cache is a hardware or software component that stores data so that future requests for that data can be served faster.
按照维基百科的定义,缓存是一种用来存储数据的硬件或者软件,它使得后续的信息传输更快。