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学习手册
10
0
0.1.2
更多的帮助,更少的倾向
许多现有的分布式编程模型都试图将开发人员限制在非常狭窄的道路上,以
防止开发人员犯分布式计算领域中常见的错误。但这是一把双刃剑,开发人
员因此而不了解分布式计算的来龙去脉。一方面,它可以防止他们搬起石头
砸自己的脚。另一方面,它也阻止了开发者有效地处理更复杂的问题。我们
经常看到的是,开发人员试图绕开框架带来的限制,从而导致奇怪和做作的
滥用和反模式。一些框架甚至尝试为开发人员创建无错误的环境,由框架来
捕获错误并采用重试或恢复的逻辑,以至于开发人员对于错误对发生毫不知
情。这意味着开发人员永远不会了解他们犯过的错误。他们会不断重复犯相
同的错误,而底层框架会悄悄地纠正它们,这会导致不必要的开销和额外的
延迟。
Dapr
试图提供帮助,并同时少一些倾向。它为开发人员提供的通用能力,对
于其默认的行为,即使是没有经验的开发人员也可以安全地使用它们。另外,
它不会阻碍开发人员增强他们的分布式编程技能,并根据需要尝试高阶用法。
例如,在默认情况下,
Dapr
状态管理提供了乐观并发机制。大多数事务能够
完成并且不会相互干扰。
当发生冲突时,
Dapr
不会尝试向开发人员隐藏错误,
而是指望开发人员来处理此类错误
2
。幸运的是,处理
HTTP
请求的响应正
好也是
Web
服务开发人员的一项基本技能。
在发生冲突时,将返回显式的
409 Conflict
代码。
开发人员可以选择直接将响应转发回客户端,这在
Web
应用程序中是一种常见做法(因为我们通常不希望在服务器上进行冗长的自 ...
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