Cloud Design Patterns云设计模式

These design patterns are useful for building reliable, scalable, secure applications in the cloud.

Each pattern describes the problem that the pattern addresses, considerations for applying the pattern, and an example based on Microsoft Azure. Most of the patterns include code samples or snippets that show how to implement the pattern on Azure. However, most of the patterns are relevant to any distributed system, whether hosted on Azure or on other cloud platforms.

Challenges in cloud development 云上开发的挑战


Availability is the proportion of time that the system is functional and working, usually measured as a percentage of uptime. It can be affected by system errors, infrastructure problems, malicious attacks, and system load. Cloud applications typically provide users with a service level agreement (SLA), so applications must be designed to maximize availability.
可用性是系统正常工作的时间比例,通常以运行时间的百分比来衡量。 它可能受到系统错误,基础设施问题,恶意攻击和系统负载的影响。 云应用程序通常为用户提供服务级别协议(SLA),因此应用程序必须设计为最大限度地提高可用性。

Data Management 数据管理

Data management is the key element of cloud applications, and influences most of the quality attributes. Data is typically hosted in different locations and across multiple servers for reasons such as performance, scalability or availability, and this can present a range of challenges. For example, data consistency must be maintained, and data will typically need to be synchronized across different locations.
数据管理是云应用的关键要素,影响了大部分的质量属性。 由于性能,可扩展性或可用性等原因,数据通常被托管在不同的位置并跨多个服务器,这可能会带来一系列挑战。 例如,必须保持数据一致性,并且数据通常需要在不同位置同步。

Design and Implementation 设计和实施

Good design encompasses factors such as consistency and coherence in component design and deployment, maintainability to simplify administration and development, and reusability to allow components and subsystems to be used in other applications and in other scenarios. Decisions made during the design and implementation phase have a huge impact on the quality and the total cost of ownership of cloud hosted applications and services.
良好的设计涵盖了组件设计和部署中的一致性和相干性等因素,可简化管理和开发的可维护性,以及允许组件和子系统在其他应用程序和其他场景中使用的可重用性。 在设计和实施阶段做出的决策对云应用和服务的质量和总成本产生了巨大的影响。

Messaging 消息传递

The distributed nature of cloud applications requires a messaging infrastructure that connects the components and services, ideally in a loosely coupled manner in order to maximize scalability. Asynchronous messaging is widely used, and provides many benefits, but also brings challenges such as the ordering of messages, poison message management, idempotency, and more
云应用的分布式特性要求一个连接组件和服务的消息传递基础设施,理想情况下是松散耦合的方式,以便最大限度地提高可扩展性。 异步消息被广泛使用,并提供许多好处,但也带来了诸如消息排序,幂等,中毒消息管理等的挑战

Management and Monitoring 管理与监控

Cloud applications run in in a remote datacenter where you do not have full control of the infrastructure or, in some cases, the operating system. This can make management and monitoring more difficult than an on-premises deployment. Applications must expose runtime information that administrators and operators can use to manage and monitor the system, as well as supporting changing business requirements and customization without requiring the application to be stopped or redeployed.
云应用运行在远程数据中心,在某些情况下,您无法完全控制基础设施的操作系统。 这可能使管理和监控云应用比本地部署的应用更困难。 应用必须公开运行时信息以便管理员和操作员用于管理和监控系统,以及支持不断变化的业务需求和定制,而不需要停止或重新部署应用程序。

Performance and Scalability 性能与可扩展性

Performance is an indication of the responsiveness of a system to execute any action within a given time interval, while scalability is ability of a system either to handle increases in load without impact on performance or for the available resources to be readily increased. Cloud applications typically encounter variable workloads and peaks in activity. Predicting these, especially in a multi-tenant scenario, is almost impossible. Instead, applications should be able to scale out within limits to meet peaks in demand, and scale in when demand decreases. Scalability concerns not just compute instances, but other elements such as data storage, messaging infrastructure, and more.
性能是指系统在给定时间间隔内执行任何操作的响应性,而可扩展性是系统处理负载增加而不影响性能或可用资源容易增加的能力。 云应用通常遇到可变工作负载和活动高峰。 预测这些工作负载和活动高峰,特别是在多租户场景下,几乎是不可能的。 相反,应用应能够在限制范围内扩展以满足需求峰值,并在需求减少时进行缩减。 可扩展性不仅涉及计算实例,还涉及数据存储,消息传递基础设施等其他元素。

Resiliency 弹性(韧性)
Resiliency is the ability of a system to gracefully handle and recover from failures. The nature of cloud hosting, where applications are often multi-tenant, use shared platform services, compete for resources and bandwidth, communicate over the Internet, and run on commodity hardware means there is an increased likelihood that both transient and more permanent faults will arise. Detecting failures, and recovering quickly and efficiently, is necessary to maintain resiliency.
弹性是系统正确处理和恢复故障的能力。 基于云托管的性质,应用通常是多租户的,且使用共享平台服务,需要竞争资源和带宽,通过互联网进行通信,并在商品硬件上运行意味着出现瞬态和更永久故障的可能性增加。 检测故障和快速有效地恢复是保持弹性的必要条件。

Security 安全

Security is the capability of a system to prevent malicious or accidental actions outside of the designed usage, and to prevent disclosure or loss of information. Cloud applications are exposed on the Internet outside trusted on-premises boundaries, are often open to the public, and may serve untrusted users. Applications must be designed and deployed in a way that protects them from malicious attacks, restricts access to only approved users, and protects sensitive data.
安全性是系统防止设计用途之外的恶意或意外行为,并防止信息泄露或丢失的能力。 云应用程序暴露在互联网外的受信任的本地边界,通常向公众开放,并可能为不受信任的用户服务。 必须设计和部署应用程序,以防止其受到恶意攻击,限制仅访问已批准用户的访问权限,并保护敏感数据。