Skip to main content

· 62 min read

Abstract  Recently, the Log-Structured Merge-tree (LSM-tree) has been widely adopted for use in the storage layer of modern NoSQL systems. Because of this, there have been a large number of research efforts, from both the database community and the operating systems community, that try to improve various aspects of LSM-trees. In this paper, we provide a survey of recent research efforts on LSM-trees so that readers can learn the state-of-the-art in LSM-based storage techniques. We provide a general taxonomy to classify the literature of LSM-trees, survey the efforts in detail, and discuss their strengths and trade-offs. We further survey several representative LSM-based open-source NoSQL systems and discuss some potential future research directions resulting from the survey.


· 2 min read

LRU-K 中的 K 代表最近使用的次数,传统的 LRU 算法可认为是 LRU-1。LRU-K 核心思想:将“最近使用过 1 次”的判断标准扩展为“最近使用过 K 次”。其主要目的是解决 LRU-1 算法“缓存污染”的问题。

· 2 min read


#include <chrono>

void example() {
std::chrono::duration<double, std::milli> total_time(0);

auto start = std::chrono::steady_clock::now();
// do something
auto end = std::chrono::steady_clock::now();

total_time += end - start;

std::cout << "total time: " << total_time.count() << "ms" << std::endl;

· 2 min read

现代计算机中的内存空间以字节为单位划分,大部分 CPU 都会以 2字节、4字节、8字节......来访问内存。现代 CPU 对齐内存的主要作用是节省内存空间。

· 11 min read


本文将会仿照 Docker Container 现有的基本功能,用 Go 简单地实现自己的 Mini Container。后续章节逐步使用 Linux 的 Namespace 和 CGroups 对 Container 与宿主机进行隔离。Namespace 决定了 Container 能看见什么?CGroups 决定了 Container 能使用什么?

// docker         run image <cmd> <params>
// go run main.go run <cmd> <params>