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.
每個設計模式都描述了改模式解決的問題,應用該模式的注意事項,并且給出了基于Azure的示例。大多數(shù)模式包括示例及代碼片段在內都是以在Azure上實現(xiàn)為例,但是這些模式都是與任意的分布式系統(tǒng)相關,無論其應用在Azure上還是其他云平臺上。
Challenges in cloud development 云上開發(fā)的挑戰(zhàn)
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.
可用性是系統(tǒng)正常工作的時間比例,通常以運行時間的百分比來衡量。 它可能受到系統(tǒng)錯誤,基礎設施問題,惡意攻擊和系統(tǒng)負載的影響。 云應用程序通常為用戶提供服務級別協(xié)議(SLA),因此應用程序必須設計為最大限度地提高可用性。
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.
數(shù)據(jù)管理是云應用的關鍵要素,影響了大部分的質量屬性。 由于性能,可擴展性或可用性等原因,數(shù)據(jù)通常被托管在不同的位置并跨多個服務器,這可能會帶來一系列挑戰(zhàn)。 例如,必須保持數(shù)據(jù)一致性,并且數(shù)據(jù)通常需要在不同位置同步。
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.
良好的設計涵蓋了組件設計和部署中的一致性和相干性等因素,可簡化管理和開發(fā)的可維護性,以及允許組件和子系統(tǒng)在其他應用程序和其他場景中使用的可重用性。 在設計和實施階段做出的決策對云應用和服務的質量和總成本產生了巨大的影響。
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
云應用的分布式特性要求一個連接組件和服務的消息傳遞基礎設施,理想情況下是松散耦合的方式,以便最大限度地提高可擴展性。 異步消息被廣泛使用,并提供許多好處,但也帶來了諸如消息排序,冪等,中毒消息管理等的挑戰(zhàn)
Management and Monitoring 管理與監(jiān)控
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.
云應用運行在遠程數(shù)據(jù)中心,在某些情況下,您無法完全控制基礎設施的操作系統(tǒng)。 這可能使管理和監(jiān)控云應用比本地部署的應用更困難。 應用必須公開運行時信息以便管理員和操作員用于管理和監(jiān)控系統(tǒng),以及支持不斷變化的業(yè)務需求和定制,而不需要停止或重新部署應用程序。
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.
性能是指系統(tǒng)在給定時間間隔內執(zhí)行任何操作的響應性,而可擴展性是系統(tǒng)處理負載增加而不影響性能或可用資源容易增加的能力。 云應用通常遇到可變工作負載和活動高峰。 預測這些工作負載和活動高峰,特別是在多租戶場景下,幾乎是不可能的。 相反,應用應能夠在限制范圍內擴展以滿足需求峰值,并在需求減少時進行縮減。 可擴展性不僅涉及計算實例,還涉及數(shù)據(jù)存儲,消息傳遞基礎設施等其他元素。
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.
彈性是系統(tǒng)正確處理和恢復故障的能力。 基于云托管的性質,應用通常是多租戶的,且使用共享平臺服務,需要競爭資源和帶寬,通過互聯(lián)網(wǎng)進行通信,并在商品硬件上運行意味著出現(xiàn)瞬態(tài)和更永久故障的可能性增加。 檢測故障和快速有效地恢復是保持彈性的必要條件。
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.
安全性是系統(tǒng)防止設計用途之外的惡意或意外行為,并防止信息泄露或丟失的能力。 云應用程序暴露在互聯(lián)網(wǎng)外的受信任的本地邊界,通常向公眾開放,并可能為不受信任的用戶服務。 必須設計和部署應用程序,以防止其受到惡意攻擊,限制僅訪問已批準用戶的訪問權限,并保護敏感數(shù)據(jù)。