系统与数据库2020vldb.org编辑精选
Monarch:Google 的星球级内存时序数据库
Monarch: Google’s Planet-Scale In-Memory Time Series Database
进阶 · 约 90 分钟读完前置知识:时序数据库基础、分布式系统基础、Google Borgmon/监控系统背景
导读
这篇论文介绍了 Google 的 Monarch——一个全球规模、内存型的时序数据库,用于替代已服役多年的监控存储系统 Borgmon,支撑 Google 内部海量指标的实时存储与查询。论文描述了其架构(如 14.4 万个 leaf 节点)、数据模型和查询语言等设计细节。
HN 关注点:论文披露了 Google 监控基础设施的罕见硬核数据(如 14.4 万个 leaf),且其函数式查询语言设计引发了对 PL 和大规模系统设计感兴趣的读者的讨论。
后来怎么样
Monarch 成为 Google 内部监控存储的标准系统,替代 Borgmon 支撑全公司指标存储;其设计影响了开源时序数据库(如 Prometheus 的长期存储方案),是业界大规模内存时序存储的代表性论文。
HN 评论精选
这几条评论里:补充 3 亲历 1
补充Monarch 的函数式查询语言以时间序列为原生类型,编程体验出色,值得深入研究
作为一个对编程语言理论感兴趣的人,我一直觉得 Monarch 暴露的查询语言出奇地有趣(论文 5.1 节只是简单提及,描述得不够充分)。它是一门函数式语言,相比 Google 内部使用的 C++、Java 或 Go 这些“真正的编程语言”,令人耳目一新。最有趣的想法是它的原生数据类型就是时间序列:整数序列、浮点数序列、浮点数分布、布尔值以及上述类型的元组。这意味着你操作的数据本质上由大量带时间戳的数据点组成。很容易对每个数据点应用操作,也很容易在滚动窗口或相邻数据点上做运算。这让这门语言有种数组式语言的感觉,但更好,因为元素带时间戳且数组可以是稀疏的。此外,每个数据点上的字段为聚合增加了更多维度(不只是固有的时间维度),让语言感觉像原生的多维数组语言。用它编程体验极佳,可以轻松写出复杂查询,比如计算某个任务的特定 RPC 延迟相对所有任务均值偏离了几个标准差,用于异常检测。
kccqzy查看英文原文
As someone interested in PL theory, I've long found the query language exposed by Monarch surprisingly interesting (briefly discussed in section 5.1 but the description doesn't quite do it justice). It's a functional language, a breath of fresh air compared to "real programming languages" in use at Google like C++, Java, or Go. The most interesting idea is that its native data types are time series of integers, doubles, distributions of doubles, booleans, and tuples of the above. This means that the data you operate on intrinsically consist of many timestamped data points. It's easy to apply an operation to each point of the data, and it's also easy to apply operations on a rolling window, or on successive points. This makes the language have the feel of an array-based language, but even better because the elements are timestamped and the array can be sparse. Furthermore the presence of fields in each data point adds more dimensions to the level of aggregation (not just the inherent time-based). Now the language has the feel of a native multi-dimensional array language. It feels amazing to program in it. You can easily do sophisticated queries like figuring out how many standard deviations each task's RPC latency for a specific call is above or below all tasks' mean, for outlier detection.
补充论文中的硬数据(14.4 万个 leaf)揭示了 Google 监控基础设施的惊人规模
有趣的是这篇论文包含暗示 Google 绝对规模的硬数据。他们说 Monarch 有 144000 个 leaf。即使每个 leaf 只分配 1 个 CPU 核心——这很可能是低估,因为谁会这么干?——这也让 Google 的监控栈足以跻身超算 Top 100。我见过 Google 给出硬数据的其他地方只有 Jeff Dean 提到 MapReduce 每天消耗的核心年数,以及一篇论文脚注提到 Google Exacycle 每天分配给科学计算的 CPU 时间。所有这些校准点都令人大开眼界。
jeffbee查看英文原文
Interesting that this paper contains hard numbers hinting at Google's absolute scale. They say Monarch has 144000 leaves. Even if each leaf is assigned only 1 CPU core -- which is probably a low estimate because who would do that? -- that makes Google's monitoring stack a Top 100 supercomputer. The only other places I've seen Google give out hard numbers were a presentation by Jeff Dean mentioning map-reduce core-years consumed per day, and a footnote in a paper that mentions how much CPU time Google Exacycle gives away to scientific computing every day. All of these calibration points are eye-opening.
亲历询问是否有能媲美 Google 内部 /streamz 的开源工具
向 Googler(和前 Googler)提问:开源世界里有没有像 /streamz 一样方便的替代品?
m0zg查看英文原文
Question for googlers (and ex-googlers). Is there anything out there that's as convenient as /streamz, but in opensource form?
补充好奇 Google 是否会开源 Monarch
不知道 Google 会不会把它开源。
polskibus查看英文原文
I wonder if Google will ever open source it.
历次讨论
- 2020Hacker News 讨论帖175 分 · 48 评
同领域还值得读
I/O 比 CPU 更快——让我们划分资源并消除操作系统抽象
I/O Is Faster Than CPU – Let’s Partition Resources and Eliminate OS Abstractions
指出在现代服务器硬件上 I/O 速度已接近甚至超过 CPU,传统操作系统抽象反而成为瓶颈。
系统与数据库2019 · 817 分 · 277 评进阶 · 约 30 分钟编辑精选使用 io_uring 的高效 I/O
Efficient IO with io_uring
由 Linux 内核开发者 Jens Axboe 撰写,介绍 Linux 新的异步 I/O 接口 io_uring。
系统与数据库2019 · 426 分 · 96 评进阶 · 约 45 分钟编辑精选线程对大多数用途而言是个坏主意(1995)
Threads Are a Bad Idea for Most Purposes (1995)
这篇 1995 年的文章由 John Ousterhout 撰写,讨论为什么线程对大多数用途而言是坏主意,并主张事件驱动编程通常更简单、更高效。
系统与数据库2017 · 423 分 · 382 评进阶 · 约 25 分钟编辑精选学习型索引结构之论证
The Case for Learned Index Structures
提出把索引看作一种"模型":既然 B-tree 等结构本质上是在学习数据的分布,就可以用机器学习模型(如回归模型、神经网络)来近似键到位置的映射,从而替代 B-tree、哈希索引…
系统与数据库2017 · 398 分 · 66 评 · 引用 25进阶 · 约 60 分钟编辑精选FoundationDB:一个分布式、解耦的事务型键值存储
FoundationDB: A distributed, unbundled, transactional key value store
介绍 FoundationDB:一个分布式、解耦设计的事务性键值存储。
系统与数据库2021 · 283 分 · 99 评进阶 · 约 90 分钟编辑精选