Skip to Content
Dapr学习手册
book

Dapr学习手册

by Haishi Bai, Yaron Schneider
November 2021
Beginner to intermediate
239 pages
4h 15m
Chinese
China Electric Power Press Ltd.
Content preview from Dapr学习手册
50
1
服务的多个实例可能会做出冲突的决定。调解这种冲突是非常困难,特别是
当发生长时间的网络分区时。此时称系统发生了“脑裂”,这往往会导致不
可调和的冲突和数据损坏。
分区是扩大服务规模的有效方式。大型工作负载通常可以沿着逻辑边界或物
理边界分割成多个分区,如按客户(或租户)、业务单元、地理位置、国家
或地区分割。每个分区都是一个较小的系统,以便于根据需要扩展或收缩。
所以在扩展有状态服务时,分区是特别有效的方式。如前所述,有状态服务
的状态需要复制以确保可用性。分区可以控制复制的数据量,并支持并行复制,
因为所有的复制操作都会限定在分区内。
分区可以是静态的,也可以是动态的。静态分区比较容易路由,因为路由规
则可以预先确定。但是,静态分区可能会导致分区不平衡,从而引发热点
压力过大、服务器容量利用不足等问题。动态分区利用一致性哈希(
https://
oreil.ly/VFvWj
等技术动态调整分区。动态分区通常可以确保工作负载在各
个分区间均匀分布。但是,需要一些分区感知路由逻辑来将用户流量路由到
合适的分区。同时,在动态分区上也很难确保数据分离,而数据分离对一些
合规标准来说是必须的。所以,在设计服务时,你需要根据技术和非技术需
求来决定分区策略,并从此作为设计原则坚持下去,因为在之后再改变分区
策略往往是非常困难的,特别是当有不断输入的数据流时。
1.2.3
云原生应用
所谓“云原生应用”是为在云环境中运行而设计的。要使应用程序被视为是“云
原生”的,它应具备以下特征:
自动部署
云原生应用可在必要时持续性的重新部署。当通过开启故障自动转移以提 ...
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版)

Luciano Ramalho
数据科学原理

数据科学原理

Posts & Telecom Press, Sinan Ozdemir
Python预测分析实战

Python预测分析实战

Posts & Telecom Press, Alvaro Fuentes
机器学习开发者指南

机器学习开发者指南

Posts & Telecom Press, Rodolfo Bonnin

Publisher Resources

ISBN: 9787519859367