Skip to Content
Pythonによるアーキテクチャパターン
book

Pythonによるアーキテクチャパターン

by Harry Percival, Bob Gregory
March 2025
Intermediate to advanced
304 pages
4h 33m
Japanese
O'Reilly Media, Inc.
Content preview from Pythonによるアーキテクチャパターン

パート II. イベント駆動アーキテクチャ

この話題のために「オブジェクト」という造語をずいぶん前に作ってしまったことを申し訳なく思っている。なぜなら、その方が多くの人がより少ないアイデアに集中できるからだ。

大きなアイデアは「メッセージング」である......偉大で成長可能なシステムを作る上で重要なのは、モジュールの内部特性や振る舞いをどうするかよりも、モジュールがどのようにコミュニケーションをとるかを設計することである。

アラン・ケイ

単一ビットのビジネスプロセスを管理するために1つのドメイン・モデルを書くことができるのは非常に良いことだが、多くのモデルを書く必要がある場合はどうなるのだろうか?現実の世界では、アプリケーションは組織の中にあり、システムの他の部分と情報を交換する必要がある。図II-1に示したコンテキスト図を覚えているだろうか。

この要件に直面すると、多くのチームはHTTP APIで統合されたマイクロサービスに手を伸ばす。しかし、気をつけないと、分散した大きな泥の玉という、最も混沌とした混乱をプロデューサしてしまうことになる。

パートIIでは、パートIのテクニックを分散システムにどのように拡張できるかを紹介する。ここでは、非同期メッセージパッシングによって相互作用する多くの小さなコンポーネントから、どのようにシステムを構成できるかを見ていく。

Service LayerとUnit of Workパターンによって、アプリを非同期メッセージプロセッサとして実行するように再構成する方法や、イベント駆動システムによって、アグリゲートとアプリケーションを互いに切り離す方法について説明する。

apwp 0102
図 II-1. しかし、これらすべてのシステムは、一体どのように互いに会話するのだろうか?

以下のパターンとテクニックを見ていく:

ドメインイベント

一貫性の境界を越えたワークフローをトリガーする。

メッセージバス

あらゆるエンドポイントからユースケースを呼び出す統一された方法を提供する。

CQRS

読み取りと書き込みを分離することで、イベント駆動型アーキテクチャにおける厄介な妥協を回避し、パフォーマンスとスケーラビリティの向上を可能にする。

さらに、依存性注入フレームワークも追加する。これはイベント駆動型アーキテクチャそのものとは何の関係もないが、非常に多くの未解決の部分を整理することができる。

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

技術リーダーシップのための14のヒント

技術リーダーシップのための14のヒント

島田 浩二
Kubernetesで実践するクラウドネイティブDevOps

Kubernetesで実践するクラウドネイティブDevOps

John Arundel, Justin Domingus, 須田 一輝, 渡邉 了介
AWS上のシステム設計

AWS上のシステム設計

Jayanth Kumar, Mandeep Singh

Publisher Resources

ISBN: 9798341624863