面向.NET开发人员的Dapr——前言
Posted dotNET跨平台
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了面向.NET开发人员的Dapr——前言相关的知识,希望对你有一定的参考价值。
Foreword
前言
With the wave of cloud adoption well underway, there is a major shift happening towards “cloud native” development, often built with microservice-architectures. These microservices are both stateless and stateful, and run on the cloud and edge, embracing the diversity of languages and frameworks available today. This enterprise shift is driven by both the market forces of faster time to market, as well as the scale and efficiencies of building services for the cloud. Even before COVID-19, cloud adoption was accelerating for enterprises and developers were being asked to do even more to deliver on building these distributed system applications, and that has only accelerated since. Developers in enterprises seek to focus on business logic, while leaning on platforms to imbue their applications with scale, resiliency, maintainability, elasticity, and the other attributes of cloud-native architectures, which is why there is also shift towards serverless platforms that hide the underlying infrastructure. Developers should not be expected to become distributed systems experts. This is where Dapr steps in to help you, whether you are building on infrastructure such as Kubernetes, or on a serverless platform.
随着云采用浪潮的发展,我们在 "云原生" 开发方面发生了重大转变,通常使用微服务体系结构构建。这些微服务可以是无状态也可以是有状态的,可以在云上运行也可以在边缘上运行,从而支持当今可用的各种语言和框架。驱动企业转型因素是,更快速地回应市场需求,以及构建云服务的规模和效率。即使在 COVID-19 之前,企业和开发人员仍需要做更多的工作来交付这些分布式系统应用程序,而自那以后,云的采用速度就加快了。企业中的开发人员寻求专注于业务逻辑,同时学习依靠平台为其应用注入扩展、弹性、可维护性、灵活性以及云原生架构的其他特征,这就是为什么也出现了向无服务平台(隐藏基础设施架构)的转变原因。不应期望开发人员成为分布式系统专家。 无论您是在 Kubernetes 等基础设施上构建,还是在无服务平台上进行构建,Dapr 都在此介入帮助您。
Dapr is designed as an enterprise, developer-focused, microservices programming model platform with the mantra “any language, any framework, run anywhere”. It makes building distributed applications easy and portable across any infrastructure, from public-cloud, through hierarchical edge, and even down to single node IoT devices. It emerged from both our experiences building services in Azure as well as time spent working with customers building applications on Azure Kubernetes Service and Azure Service Fabric. Over and over, we saw common problems that they had to address. It became clear that there was a need to provide a “library” of common microservice best practices that developers could use, not only in new greenfield applications, but also to aid in the modernization of existing applications. In the containerized, distributed, and networked cloud native world, the sidecar model has emerged as the preferred approach, in the same way DLLs are preferred in the client/server generation. Using Dapr’s sidecar and APIs give you, as a developer, all the power of distributed systems functionality, with the ease of a single HTTP or gRPC local call.
Dapr 是一种以开发人员为中心的企业级微服务编程模型平台,其口号是"任何语言、任何框架、随处运行"。它使得跨任何基础设施、公有云、分层边缘,甚至是单节点 IoT 设备构建分布式应用程序变得简单、可移植。它体现我们在 Azure 中生成服务的经验,以及与客户在 Azure Kubernetes 服务和 Azure Service Fabric 上构建应用程序所做的努力。同时,我们看到了他们必须解决的常见问题。显然,需要提供一种可供开发人员使用的微服务最佳实践的"库",不仅可以用于开发新应用,还可以帮助应对现有应用程序的现代化改造。在容器化、分布式和网络云原生世界中,边车模式已成为首选方式,其方式与在客户端/服务器生时代中首选 Dll 的方式相同。使用 Dapr 的边车和 Api,为开发人员提供了分布式系统功能的所有能力,只需使用 HTTP 或 gRPC 本地调用。
To address the wide range of scenarios that developers face, Dapr provides features such as state management, service to service invocation, pub/sub and integration to external systems with I/O bindings, which are based on the triggers and bindings of Azure Functions. These in turn take advantage of Dapr’s component model which allows you to “swap out”, say different underlying state stores, without having to change any code, making code more portable, more flexible and allowing for experimentation of what best suits your needs. Developers don’t need to learn and incorporate service SDKs into their code, worry about authentication, secret management, retries or conditional code that targets specific deployment environments.
为了解决开发人员面临的各种情况,Dapr 提供了状态管理、服务到服务调用、发布/订阅和与外部系统的集成(基于输入/输出绑定)。它们利用了 Dapr 的组件模型,允许您可以替换(例如不同的底层状态存储),而无需更改任何代码,使代码更具可移植性,更具灵活性,并允许实验什么最适合你的需要。开发人员无需了解服务 Sdk 并将其合并到代码中,无需担心身份验证、机密管理、重试或特定部署环境相关的条件代码。
This book shows how Dapr reduces your development time and overall code maintenance by incrementally “Daperizing” the canonical .NET reference application, eShop. For example, in the original eShop implementation, significant amounts of code were written to abstract between Azure Service Bus and RabbitMQ for publishing events between services. All this code can be discarded and simply replaced with Dapr’s pub/sub API and component model which had an even wider range of pub/sub brokers, rather than just two. Dapr’s actor model, when used in the reworked eShop application, shows the ease of building long running, stateful, event driven, workflow applications with all the difficulties of concurrency and multi-threading removed. By the end of this book, you will see the drastic simplification that Dapr brings to your application development, and I firmly believe all developers embarking on a cloud native app building journey should leverage Dapr.
本书说明了 Dapr 如何逐步简化 标准.NET 参考应用程序 eShop,来缩短开发时间和总体代码维护。例如,在原始 eShop 实现中,编写大量代码来抽象Azure 服务总线和 RabbitMQ,以在服务之间发布事件。所有这些代码都可以丢弃,只需替换为 Dapr 的 订阅/发布 API 和组件模型,订阅/发布代理有很多种,不只是两个。在修订的eShop 应用程序中使用时,Dapr 的执行组件模型可让你轻松构建长时间运行、有状态、事件驱动的工作流应用程序,同时移除了并发和多线程处理的所有难题。本书结束后,您将看到 Dapr 为您的应用程序开发带来的极大简化,我坚信所有踏上云原生应用构建之旅的开发人员都应该利用 Dapr。
We publicly announced Dapr with the v0.1 release in Oct 2019 and now, a year and half later, I am thrilled to say that Dapr is ready for production usage with the v1.0 release. Getting Dapr to v1.0 has truly been a community effort. It has been amazing to see the open-source community coalesce around Dapr and grow since it was first announced – from 114 contributors in October 2019 to over 700 in early 2021 - a six-fold increase in 16 months! Contributions to the project have gone to every Dapr repo and have ranged from opening issues, commenting on feature proposals, providing samples, and of course contributing code. The parts of the project community members have contributed to the most include the Dapr runtime, docs, CLI, SDKs and the creation of a rich ecosystem of components. Maintaining this openness is critical to Dapr’s future.
我们已在2019年10月推出了 Dapr 的0.1 版发布,现在,我兴奋不已说 Dapr V1.0已准备就绪以供生产使用。发布Daprv1.0确实是社区努力的结果。自Dapr首次宣布以来,Dapr开源社区联合起来并不断发展壮大,令人惊叹——从2019年10月的114个贡献者增加到2021年初的700多个——在16个月内增长了6倍!对项目的贡献已提交到每个 Dapr 存储库,包括打开问题、评论功能提案、提供示例,以及贡献代码。 项目社区成员贡献最大的部分包括 Dapr 运行时、文档、CLI、SDK 和创建丰富的组件生态系统。保持这种开放性对Dapr的未来至关重要。
Dapr is really just getting started, though, and you should expect to see more Dapr capabilities and more support for Dapr in Azure services. I hope that you will take advantage of Dapr to enable you to focus on your core business logic and accelerate your microservices development. I am are excited to have you join us in the Dapr community on this journey at https://github.com/dapr/ and on Discord https://aka.ms/dapr-discord.
不过,Dapr 刚刚开始,你应该期待更多的 Dapr 功能,并在Azure 服务中为 Dapr 提供更多支持。我希望您能够利用 Dapr 来使您能够专注于核心业务逻辑,并加速微服务开发。我很高兴有你加入我们Dapr社区的:https://github.com/dapr/ 旅程和https://aka.ms/dapr-discord 。
Modern distributed systems are complex. You start with small, loosely coupled, independently deployable services. These services cross process and server boundaries. They then consume different kinds of infrastructure backing services (databases, message brokers, key vaults). Finally, these disparate pieces compose together to form an application.
现代分布式系统非常复杂。首先,你从小的、松散耦合且可部署的服务开始。这些服务跨进程和服务边界。然后,它们使用不同类型的基础设施支持服务 (数据库、消息代理、key vault) 。最后,这些分散的部分组合在一起构成应用程序。
Mark Russinovich Azure CTO and Technical Fellow Microsoft
马克·鲁西诺维奇 Azure CTO和微软技术研究员
以上是关于面向.NET开发人员的Dapr——前言的主要内容,如果未能解决你的问题,请参考以下文章