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学习手册
92
2
然而,在现代网络下,这种延迟往往是可以容忍的,除非系统对增加的响应
时间极为敏感。
2-1
描述了有状态服务如何通过外部化状态来转换为无状态服务。左边是
一个由三个实例组成的有状态服务。每个实例在本地提交状态,状态在集群
中被复制和协调。在右边,状态被移动到外部状态存储中,该存储被复制到
多个副本中以实现高可用性。实例可以持有本地缓存以提高性能,可以有不
同的缓存更新策略如
write-through
write-around
write-back
路由器
实例A
实例A
实例B
实例B 实例C
实例C
(主)
(次) (次)
负载均衡器
缓存
缓存 缓存
2
-
1
:有状态服务(左)与有状态的无状态服务(右)的对比
右边的架构比左边的架构更复杂,而且通常性能较差。然而,这种设计的主
要好处是,服务实例成为无状态,因此在云中更容易管理。
2.2 Dapr
状态管理
Dapr
通过一个可靠的状态端点为服务带来状态管理。可以将有状态服务转
化为无状态服务,正如我们所看到的那样,无状态服务更容易管理。开发
者可以通过简单的
Dapr
状态
API
来保存和检索状态。
Dapr
支持可插拔架
构,允许用户服务绑定到不同的状态存储,如
Redis
Azure Cosmos DB
Cassandra
AWS DynamoDB
Google Cloud Spanner
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