第12章クラウドネイティブアプリケーション開発
Elastic–Dynamic Scale-Up/Down弾力的で動的な規模の拡大と縮小
Cloud-native applications take advantage of the elasticity of the cloud by scaling microservices. Microservices that require additional resources can be scaled on demand to service an increased capacity. The microservice can also be scaled down when usage decreases. Resources that were allocated during the scale-up can be deallocated as they are no longer needed. A cloud-native application can thus adjust to the increased or decreased resources and scale as needed.
英語のヒント
クラウドネイティブアプリケーションは、マイクロサービスの規模を変えることで、クラウドの弾力性を活用する。追加の資源を必要とするサービスは、増えた処理量に対応するため、必要に応じて拡張できる。利用が減れば、縮小することもできる。拡張時に割り当てた資源は、不要になれば割り当てを解除できる。このように、クラウドネイティブアプリケーションは、資源の増減へ適応し、必要に応じて規模を変えられる。
Benefits of Cloud-Native Applicationsクラウドネイティブアプリケーションの利点
Cloud-native applications are designed and built to take advantage of the speed and efficiency of the cloud. Cloud-native applications are highly scalable, easy to update, and take advantage of cloud platforms, processes, and services to easily extend their capabilities. Some of the benefits of using cloud-native applications include the following:
クラウドネイティブアプリケーションは、クラウドの速さと効率を活用するように設計・構築される。規模を大きく拡張でき、更新が容易であり、クラウドのプラットフォーム、プロセス、サービスを使って、機能を容易に拡張できる。利用する利点には、次のようなものがある。
• Cost-effectiveness: Orchestration tools can help scale a cloud-native application by automating the allocation of resources to the microservices as needed without having to duplicate the entire application. This eliminates the overprovisioning of hardware and the need for load balancing. Containers can also be used to reduce the complexity of managing the many microservices that make up a cloud-native application as well as maximize the number of microservices that run on a host, saving time, resources, and money.
英語のヒント
• 費用対効果:オーケストレーションツールは、必要に応じてマイクロサービスへ資源を割り当てる処理を自動化し、アプリケーション全体を複製せずに、クラウドネイティブアプリケーションの規模を拡張できるようにする。これにより、ハードウェアの過剰な確保と、負荷分散の必要がなくなる。コンテナーを使えば、アプリケーションを構成する多数のマイクロサービスの管理を簡潔にし、1台のホストで動かせるサービス数を最大化できるため、時間、資源、費用を節約できる。
• Scalability: Each microservice is logically isolated and can scale independently without downtime. Microservices can scale up or down by allocating more or fewer resources to in-demand services in response to a change in user traffic. If one microservice is changed to scale, the others are not affected. Independent scalability also makes it easier to deploy or update any part of the cloud-native application without affecting the entire application.
英語のヒント
• スケーラビリティ:各マイクロサービスは論理的に分離され、停止時間なしに独立して拡張できる。利用者からの通信量の変化に応じ、需要のあるサービスへ割り当てる資源を増減して、規模を拡大または縮小できる。1つのサービスを拡張しても、ほかのサービスは影響を受けない。独立して規模を変えられるため、アプリケーション全体に影響を与えずに、任意の部分を配置・更新することも容易になる。
• Portability: Cloud-native applications are vendor neutral because the containers microservices run in can be deployed anywhere, thereby avoiding vendor lock-in.
英語のヒント
• 移植性:マイクロサービスが動くコンテナーはどこにでも配置できるため、クラウドネイティブアプリケーションは特定のベンダーに依存しない。そのため、ベンダーロックインを避けられる。
• Reliability and resiliency: If a failure occurs in one microservice, there is no effect on adjacent microservices because cloud-native applications use containers. Resiliency is provided at the core of the architecture. As with any software system, failure can also occur in distributed systems and hardware. Transient failures can also occur in networks. The ability of a system to recover from failures and continue to function is called resiliency. The goal of resiliency is to return the application to a fully functioning state following a failure minimizing downtime and data loss. An application is resilient if it (1) has high availability, which is the ability for an application to continue running in a healthy state without significant downtime; and (2) supports disaster recovery, which is the ability of the application to recover from rare but major incidents: nontransient, wide-scale failures, such as service disruption that affects an entire region. Applications can be made resilient by increasing redundancy with multinode clusters, multiregion deployments, and data replication. Other strategies for implementing resiliency include retries to handle transient network failures, adding more nodes to a cluster and load balance across them, throttling high-volume users, and applying circuit breakers to prevent an application from repeatedly trying an operation that is likely to fail. Testing for resiliency requires testing how the end-to-end workload performs under failure conditions that only occur intermittently—for example, injecting failures by crashing processes, including expired certificates, making dependent services unavailable, and so on. Resiliency tools and frameworks like Chaos Monkey can be used for such chaos testing. For example, Netflix uses Chaos Monkey for resiliency testing to simulate failures and address them.
英語のヒント
• 信頼性と回復力:クラウドネイティブアプリケーションはコンテナーを使うため、1つのマイクロサービスが故障しても、隣接するサービスに影響しない。回復力は、アーキテクチャの中核に組み込まれている。ほかのソフトウェアシステムと同様に、分散システムやハードウェアでも障害は起こりうる。ネットワークには一時的な障害も起こる。障害から回復し、機能し続けるシステムの能力を、回復力という。その目標は、障害の後、停止時間とデータ損失を最小限にしながら、アプリケーションを完全に機能する状態へ戻すことである。回復力のあるアプリケーションは、(1)高可用性を持つ。これは、大きな停止時間なしに、正常な状態で動作し続ける能力である。また、(2)災害復旧に対応する。これは、まれではあるが重大な事故から回復する能力である。たとえば、ある地域全体へ影響するサービス停止のような、一時的ではない大規模な障害を指す。複数ノードのクラスター、複数地域への配置、データの複製によって冗長性を高めれば、回復力を持たせられる。ほかの方法には、一時的なネットワーク障害への再試行、クラスターへのノード追加とそれらの間の負荷分散、大量に利用する利用者への制限、失敗する可能性が高い操作をアプリケーションが繰り返さないようにするサーキットブレーカーの適用がある。回復力のテストでは、ときどきしか起こらない障害条件の下で、最初から最後までのワークロードがどう動くかを調べる。たとえば、プロセスをクラッシュさせる、期限切れの証明書を含める、依存先のサービスを利用不能にするなどして、障害を注入する。Chaos Monkeyのような、回復力を検証するツールやフレームワークを、このようなカオステストに使える。たとえばNetflixは、Chaos Monkeyで障害を模擬し、対処する回復力テストを行っている。
• Ease of management: Cloud-native application updates and added features are automated as they move through a DevOps pipeline using CI/CD. This makes it easier for developers to track the microservices as they are being updated. Development teams can focus on managing specific microservices without worrying about how it will interact with other microservices. This architecture allows teams to be chosen to manage specific microservices based on the skill sets of their members.
• 管理の容易さ:クラウドネイティブアプリケーションの更新と機能追加は、CI/CDを使うDevOpsパイプラインを進む過程で自動化される。これによって、開発者は更新中のマイクロサービスを追跡しやすくなる。開発チームは、ほかのサービスとのやり取りを心配せず、特定のサービスの管理に集中できる。このアーキテクチャでは、メンバーの技能に基づき、特定のサービスを管理するチームを選べる。
• Visibility: Because a microservices architecture isolates services, it makes it easier for teams to learn how the microservices function together and have a better understanding of the cloud-native application as a whole.
• 可視性:マイクロサービスアーキテクチャはサービスを分離するため、チームは各サービスがどのように連携するかを学びやすく、クラウドネイティブアプリケーション全体を、よりよく理解できる。