Microsoft Azure版デザインパターン41個を1行で説明する[2/3:D~P]

第一部では41個のデザインパターンのうち13個を紹介した。第二部では16個を説明する。

Deployment Stamps pattern

The deployment stamp pattern involves provisioning, managing, and monitoring a heterogeneous group of resources to host and operate multiple workloads or tenants. Each individual copy is called a stamp, or sometimes a service unit or scale unit. In a multi-tenant environment, every stamp or scale unit can serve a predefined number of tenants. Multiple stamps can be deployed to scale the solution almost linearly and serve an increasing number of tenants. This approach can improve the scalability of your solution, allow you to deploy instances across multiple regions, and separate your customer data.

サービスを構成するセットをstampと呼び、マルチテナント環境などで顧客が増えた場合などにstamp単位でデプロイするという話。

ハンコで押したように同じものを作るということだと思うが、クローンじゃ駄目だったんだろうか。

Event Sourcing pattern

Instead of storing just the current state of the data in a domain, use an append-only store to record the full series of actions taken on that data. The store acts as the system of record and can be used to materialize the domain objects. This can simplify tasks in complex domains, by avoiding the need to synchronize the data model and the business domain, while improving performance, scalability, and responsiveness. It can also provide consistency for transactional data, and maintain full audit trails and history that can enable compensating actions.

データを保存するだけでなく、追加専用データストアを用意してデータの追加のために行われたすべてのアクションを記録するという話。

第一部に出てきたCQRSや第三部に出てくる予定のマテリアライズド・ビューとも関連する。

External Configuration Store pattern

Move configuration information out of the application deployment package to a centralized location. This can provide opportunities for easier management and control of configuration data, and for sharing configuration data across applications and application instances.

config(設定情報)はアプリケーション内部ではなく外部に保存しようという話。

Federated Identity pattern

Delegate authentication to an external identity provider. This can simplify development, minimize the requirement for user administration, and improve the user experience of the application.

authentication(認証)を外部にdelegate(委任)しましょうという話。例としてMicrosoftやGoogleが提供しているSTS(security token services)などが挙げられている。

federate(連邦化する)って不思議な単語ですがID関連の議論では使われてるみたいですね。

Gatekeeper pattern

Protect applications and services by using a dedicated host instance that acts as a broker between clients and the application or service, validates and sanitizes requests, and passes requests and data between them. This can provide an additional layer of security, and limit the attack surface of the system.

gatekeeper(門番)をクライアントとサービスの間に置いてvalidateやsanitizeを行うことでアプリケーションを保護しましょうという話。

Gateway Aggregation pattern

Use a gateway to aggregate multiple individual requests into a single request. This pattern is useful when a client must make multiple calls to different backend systems to perform an operation.

複数のリクエストを1つのリクエストにaggregate(集約)するというパターン。クライアントが異なるバックエンドを呼ばなければいけない場合などに便利だという。

集約というと簡単そうに聞こえてしまうが、その複数のリクエストの組み合わせの数だけエラーハンドリングが発生しそうな気がしてしまう。

Gateway Offloading pattern

Offload shared or specialized service functionality to a gateway proxy. This pattern can simplify application development by moving shared service functionality, such as the use of SSL certificates, from other parts of the application into the gateway.

SSLなどの共有のサービス、もしくは特殊なサービスをゲートウェイプロキシにオフロードする。

例としてはNginxでSSLをオフロードする例が示されている。個人的には「オフロード」という用語が出てくるのはSSLの処理ぐらいだという気もする。

Gateway Routing pattern

Route requests to multiple services using a single endpoint. This pattern is useful when you wish to expose multiple services on a single endpoint and route to the appropriate service based on the request.

ひとつのエンドポイントを複数のサービスにルーティングする。

こちらもNginxで/app1にアクセスするとhttp://10.0.3.10に、/app2にアクセスするとhttp://10.0.3.20にルーティングしている例が出ている。ネットワークのルーティングしか知らない人と話すと「なぜ、それをルーティングと呼ぶんだ」と混乱しそう。

Geode pattern

The Geode pattern involves deploying a collection of backend services into a set of geographical nodes, each of which can service any request for any client in any region. This pattern allows serving requests in an active-active style, improving latency and increasing availability by distributing request processing around the globe.

地理的なレイテンシを改善するために、アメリカからのリクエストはアメリカで、アジアからのリクエストはアジアで処理するといったように分散すること。

ちなみに辞書でgeodeを調べると石の中の空洞に結晶ができる晶洞石が出てくるが、関連は不明。geo(地理)を含んで語呂がよかったのだろうか。

Health Endpoint Monitoring pattern

Implement functional checks in an application that external tools can access through exposed endpoints at regular intervals. This can help to verify that applications and services are performing correctly.

サービスの死活監視をするためにエンドポイントにアクセスできるようにすること。

最初の方に出てきたAmbassadorパターンなどは、昔のシステムで最新の死活監視に対応させるのが難しいからAmbassadorにやらせるみたいな絵になってたので、これ自体がアーキテクチャというより他のパターンで実現すべきことの名前という感じだろう。

Index Table pattern

Create indexes over the fields in data stores that are frequently referenced by queries. This pattern can improve query performance by allowing applications to more quickly locate the data to retrieve from a data store.

データベースのインデックスを作り、素早く参照できるようにすること。

Leader Election pattern

Coordinate the actions performed by a collection of collaborating instances in a distributed application by electing one instance as the leader that assumes responsibility for managing the others. This can help to ensure that instances don't conflict with each other, cause contention for shared resources, or inadvertently interfere with the work that other instances are performing.

複数のインスタンスがconflictを起こさないようインスタンス間でどれがリーダーかを決める仕組み。

これは他のパターンと対になったりしてそうだけど、ちょっとよくわからず。

Materialized View pattern

Generate prepopulated views over the data in one or more data stores when the data isn't ideally formatted for required query operations. This can help support efficient querying and data extraction, and improve application performance.

prepopulate(事前入力)されたViewを1つ以上のデータストアに作っておくとパフォーマンス向上につながりますよという説明。

補足すると通常のデータベースにおけるViewは、実態であるテーブルから仮想的にViewを作っているから元のテーブルが変わるたびにViewを生成する必要があるが、Materialized Viewはmaterialize(実体化)されたデータによりViewが生成されているので早いし使いやすいという特徴がある。てっきりOracle Databaseの独自技術かと思ってた。

Pipes and Filters pattern

Decompose a task that performs complex processing into a series of separate elements that can be reused. This can improve performance, scalability, and reusability by allowing task elements that perform the processing to be deployed and scaled independently.

複雑な処理をパイプやフィルターといった単純な部品に分解するという手法。

Priority Queue pattern

Prioritize requests sent to services so that requests with a higher priority are received and processed more quickly than those with a lower priority. This pattern is useful in applications that offer different service level guarantees to individual clients.

リクエストに優先順位をつけ、優先順位の高い処理から先に実行されるようにするというパターン。

Publisher-Subscriber pattern

Enable an application to announce events to multiple interested consumers asynchronously, without coupling the senders to the receivers.

通常のメッセージは宛先を指定するが、宛先を指定せずにメッセージをpublishし、受け手は自分に関係あるメッセージのみsubscribeするというモデル。

ということで、やっとこさ2/3まで終了。ABC順なので前後のパターンとの関連はないはずだが、2/3ぐらいまで読むとうっすらと全体像が分かった気になる。残りは次回に。





この記事が気に入ったらサポートをしてみませんか?