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学习手册
94
2
来处理。支持事务性存储接口的存储称为事务性状态存储。
actor
编程模型的
支持需要事务性状态存储(详见第
5
章)。
2.2.4
多状态存储
Dapr
支持同一集群上的多个状态存储。每个存储都由存储名称来标识,并
被配置为
Dapr
组件。例如,当编写数字音乐库时,可以将专辑信息保存到
Cosmos DB
中,并将实际的音频文件保存在
blob
存储中。在编写本书时,
Dapr
不支持跨多个状态存储的事务。应用程序应该使用单一的状态存储作为
单一的真实来源,并使用其他存储保存相关数据。
2.2.5
重试策略
Dapr
提供简单的重试库,可以根据线性重试策略或指数回退重试策略自动重
试失败的操作
译注
1
。重试策略支持配置时间间隔
(interval)
和最大阈值。在给
定的时间间隔内重试数据操作,直到达到最大重试阈值。线性重试策略有固
定的时间间隔。指数回退策略具有指数级增加的间隔,定义为
interval
i
=
始间隔 ×
2
i
,其中
interval
i
是数据操作第
i
次尝试后的间隔。
2.3 Dapr State API
Dapr
定义了一个基于
key/value
范式的简单的状态
API
,如下面的代码片段所
示:
type Store interface {
Init(metadata Metadata) error
Delete(req *DeleteRequest) error
BulkDelete(req []DeleteRequest) error
Get(req *GetRequest) (*GetResponse, ...
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