Skip to Content
Google SRE工作手册
book

Google SRE工作手册

by Betsy Beyer, Niall Richard Murphy, David K. Rensin, Kent Kawahara, Stephen Thorne
September 2020
Intermediate to advanced
526 pages
8h 23m
Chinese
China Electric Power Press Ltd.
Content preview from Google SRE工作手册
配置设计及最佳实践
339
如果你发现不只是一小部分用户需要复杂的配置,那么你可能在识别常见用例的时
候误判了。如果是这样,请重新审视系统初始的产品假设,并对其他用户进行调研。
配置机制
到目前为止,我们已经讨论了配置的原则。本节将重点转移到用户与配置系统交互
的机制。
配置和生成的数据分离
使用什么语言存储配置信息是不可回避的问题。你可以选择使用
INI
YAML
XML
文件中的那种纯数据。或者为了能更灵活,配置可以存储在更高级语言中。
从根本上说,所有询问用户的问题都归类为静态信息。这可能是“应该使用多少个
线程?”这样的,明显静态答案的问题。但即使是“每个请求应该使用什么函数?”
这样的问题,也只是静态的引用函数。
关于“配置信息是代码还是数据?”这个古老问题,我们的经验表明,它是代码和
数据二者兼备,但最好还是将两者分开。系统基础设施应该运行在纯静态数据上,
这些数据可以是
Protocol Buffers
(源于
Google
)(
http://bit.ly/1HhFC5L
)、
YAML
https://yaml.org/
)或
JSON
https://www.json.dgl
)等格式。这个选择并不意味着
用户实际上要与纯数据交互。用户还是可以与更高级的用于生成以上数据的界面进
行交互。此外,逐步堆叠的系统和自动化
API
也能够使用这种数据格式。
这个高级的界面几乎可以是任何形式。它可以是高级编程语言,如基于
Python
的领
域特定语言(
DSL
),
Lua
或专用语言,如
Jsonnet
(我们将在第
15
章中更详细地讨论) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python数据分析(第2版)

Python数据分析(第2版)

Posts & Telecom Press, Armando Fandango
Google系统架构解密: 构建安全可靠的系统

Google系统架构解密: 构建安全可靠的系统

Heather Adkins, Betsy Beyer, Paul Blankinship, Piotr Lewandowski, Ana Oprea, Adam Stubblefield
编写整洁的Python代码(第2版)

编写整洁的Python代码(第2版)

Posts & Telecom Press, Mariano Anaya

Publisher Resources

ISBN: 9787519845858