

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# IBM Db2、SAP、Sybase、およびその他のデータベースから の MongoDB Atlas にデータをストリーミングする AWS
<a name="stream-data-from-ibm-db2-to-mongodb-atlas"></a>

*Battulga Purevragchaa、Igor Alekseev (Amazon Web Services)*

*Babu Srinivasan (MongoDB)*

## 概要
<a name="stream-data-from-ibm-db2-to-mongodb-atlas-summary"></a>

このパターンでは、IBM Db2 およびその他のデータベース (メインフレームデータベースや Sybase など) から AWS クラウド上の MongoDB Atlas にデータを移行する手順について説明します。[AWS Glue](https://aws.amazon.com/glue/) を使用して、MongoDB Atlas へのデータ移行を高速化します。

このパターンは、 AWS 「 規範ガイダンス」ウェブサイトの[「 での MongoDB Atlas への移行 AWS](https://docs.aws.amazon.com/prescriptive-guidance/latest/migration-mongodb-atlas/)」ガイドに付属しています。ここでは、そのガイドで説明されている移行シナリオの 1 つの実装手順について説明します。その他の移行シナリオについては、 AWS 「 規範ガイダンス」ウェブサイトの次のパターンを参照してください。
+ [でセルフホスト MongoDB 環境を MongoDB Atlas に移行する AWS](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/migrate-a-self-hosted-mongodb-environment-to-mongodb-atlas-on-the-aws-cloud.html)
+ [でリレーショナルデータベースを MongoDB Atlas に移行する AWS](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/migrate-relational-database-to-mongodb-atlas.html)

このパターン は、[AWS マネージドサービスパートナー](https://aws.amazon.com/managed-services/partners/)と AWS ユーザーを対象としています。

## 前提条件と制限
<a name="stream-data-from-ibm-db2-to-mongodb-atlas-prereqs"></a>

**前提条件**
+ MongoDB Atlas に移行するソースデータベース (SAP、Sybase、IBM Db2 など)。
+ SAP、Sybase、IBM Db2、MongoDB Atlas、 などのデータベースに精通していること AWS のサービス。

**製品バージョン**
+ MongoDB バージョン 5.0 以降

## アーキテクチャ
<a name="stream-data-from-ibm-db2-to-mongodb-atlas-architecture"></a>

次の図は、、Amazon Kinesis Data Streams AWS Glue Studio、および MongoDB Atlas を使用したバッチデータのロードとデータストリーミングを示しています。

このリファレンスアーキテクチャでは AWS Glue Studio 、 を使用して抽出、変換、ロード (ETL) パイプラインを作成し、データを MongoDB Atlas に移行します。は MongoDB Atlas と AWS Glue クローラー 統合され、データガバナンスを容易にします。データは、Amazon Kinesis Data Streams を使用して MongoDB Atlas にバッチで移植するか、ストリーミングすることができます。

**一括データロード**

![\[バッチモードでの MongoDB Atlas へのデータ移行。\]](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/images/pattern-img/805a376f-35f4-44cc-b4b0-8bf4d95c1e5d/images/68d87202-95ba-4e2a-9b3b-27dd6db6165e.png)


バッチデータ移行の詳細については、 AWS ブログ記事「[Compose your ETL jobs for MongoDB Atlas with AWS Glue](https://aws.amazon.com/blogs/big-data/compose-your-etl-jobs-for-mongodb-atlas-with-aws-glue/)」を参照してください。

**データストリーミング**

![\[データストリーミングモードでの MongoDB Atlas へのデータ移行。\]](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/images/pattern-img/805a376f-35f4-44cc-b4b0-8bf4d95c1e5d/images/b007a116-f463-418f-9721-647d80177e3b.png)


さまざまな使用シナリオをサポートする MongoDB Atlas リファレンスアーキテクチャについては、 AWS 「 規範ガイダンス」ウェブサイトの[「 での MongoDB Atlas への移行 AWS](https://docs.aws.amazon.com/prescriptive-guidance/latest/migration-mongodb-atlas/architecture.html)」を参照してください。

## ツール
<a name="stream-data-from-ibm-db2-to-mongodb-atlas-tools"></a>

●      [AWS Glue](https://docs.aws.amazon.com/glue/latest/dg/what-is-glue.html) はフルマネージド型の ETL サービスです。これにより、データストアとデータストリーム間でのデータの分類、整理、強化、移動を確実に行うことができます。

●      [Amazon Kinesis Data Streams](https://aws.amazon.com/kinesis/data-streams/) は、データレコードの大量のストリームをリアルタイムで収集し、処理するのに役立ちます。

●      [MongoDB Atlas](https://www.mongodb.com/atlas) は、MongoDB データベースをクラウドにデプロイおよび管理するためのフルマネージド型 Database as a Service (DbaaS) です。

## ベストプラクティス
<a name="stream-data-from-ibm-db2-to-mongodb-atlas-best-practices"></a>

ガイドラインについては、MongoDB GitHub リポジトリにある「[MongoDB のベストプラクティスガイド](https://github.com/mongodb-partners/mongodb_atlas_as_aws_bedrock_knowledge_base/blob/main/data/MongoDB_Best_Practices_Guide.pdf)」を参照してください。

## エピック
<a name="stream-data-from-ibm-db2-to-mongodb-atlas-epics"></a>

### 発見と評価
<a name="discovery-and-assessment"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| クラスターサイズを決定します。 | `db.stats()` からの合計インデックススペースに関する情報を使用してワーキングセットのサイズを見積もります。データスペースの一部が頻繁にアクセスされると仮定します。または、独自の仮定に基づいてメモリ要件を見積もることもできます。このタスクには約 1 週間かかりそうです。この記事とこのエピックの他のストーリーの詳細と例については、「[関連リソース](#stream-data-from-ibm-db2-to-mongodb-atlas-resources)」セクションのリンクを参照してください。 | MongoDB DBA、アプリケーションアーキテクト | 
| ネットワーク帯域幅要件を見積もります。 | ネットワーク帯域幅要件を見積もるには、平均ドキュメントサイズに 1 秒あたりに提供されるドキュメント数を掛けます。基準として、クラスター上のノードが負担する最大トラフィックを考慮に入れます。クラスターからクライアントアプリケーションへのダウンストリームのデータ転送速度を計算するには、一定期間に返されたドキュメントの合計を使用します。アプリケーションがセカンダリノードから読み取る場合は、このドキュメントの合計数を、読み取り操作を実行できるノード数で割ります。データベースの平均ドキュメントサイズを求めるには、`db.stats().avgObjSize` コマンドを使用してください。このタスクには通常 1 日かかります。 | MongoDB DBA | 
| Atlas 層を選択します。 | [MongoDB ドキュメント](https://www.mongodb.com/docs/atlas/manage-clusters/)の指示に従い、正しい Atlas クラスター階層を選択してください。  | MongoDB DBA | 
| カットオーバーを計画します。 | アプリケーションのカットオーバーを計画します。 | MongoDB DBA、アプリケーションアーキテクト | 

### AWS に新しい MongoDB Atlas 環境を設定します
<a name="set-up-a-new-mongodb-atlas-environment-on-aws"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| で新しい MongoDB Atlas クラスターを作成します AWS。 | MongoDB Atlas **で、クラスターの構築**を選択し、クラウドプロバイダー AWS として を選択します。 | MongoDB DBA | 
|  AWS リージョン および グローバルクラスター設定を選択します。 | Atlas クラスター AWS リージョン で使用できる のリストから を選択します。必要に応じてグローバルクラスタを設定します。 | MongoDB DBA | 
| クラスター階層を選択します。 | お好みのクラスター階層を選択します。階層の選択によって、メモリ、ストレージ、IOPS の仕様などの要素が決まります。 | MongoDB DBA | 
| 追加のクラスター設定を構成します。 | MongoDB のバージョン、バックアップ、暗号化オプションなどのクラスター設定を追加して行います。これらのオプションの詳細については、「[関連リソース](#stream-data-from-ibm-db2-to-mongodb-atlas-resources)」セクションを参照してください。 | MongoDB DBA | 

### セキュリティとコンプライアンスを設定
<a name="configure-security-and-compliance"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| アクセスリストを設定します。 | Atlas クラスターに接続するには、[プロジェクトのアクセスリスト](https://www.mongodb.com/docs/atlas/setup-cluster-security/#configure-security-features-for-clusters)にエントリを追加する必要があります。Atlasは、Transport Layer Security (TLS) / Secure Sockets Layer (SSL) を使用して、データベースの仮想プライベートクラウド (VPC) への接続を暗号化します。プロジェクトのアクセスリストの設定やこのエピックのストーリーの詳細については、「[関連リソース](#stream-data-from-ibm-db2-to-mongodb-atlas-resources)」セクションのリンクを参照してください。  | MongoDB DBA | 
| ユーザーの認証と認可を行います。 | MongoDB Atlas クラスターにアクセスするデータベースユーザーを作成して認証する必要があります。プロジェクト内のクラスターにアクセスするには、ユーザーはそのプロジェクトに属し、複数のプロジェクトに属している必要があります。 AWS Identity and Access Management (IAM) で認可を有効にすることもできます。詳細については、MongoDB のドキュメントの「[IAM による認証を設定する](https://www.mongodb.com/docs/atlas/security/aws-iam-authentication/#set-up-authentication-with-aws-iam)」を参照してください。 | MongoDB DBA | 
| カスタムロールを作成します。 | (オプション) Atlas では、組み込みの Atlas データベースユーザー権限で必要な権限セットがカバーできない場合に[カスタムロール](https://www.mongodb.com/docs/atlas/reference/custom-role-actions/)を作成できます。 | MongoDB DBA | 
| VPC ピアリングを設定します。 | (オプション) Atlas では、他の AWS VPC との [VPC ピアリング](https://www.mongodb.com/docs/atlas/security-vpc-peering/#set-up-a-network-peering-connection)がサポートされます。 | MongoDB DBA | 
|  AWS PrivateLink エンドポイントをセットアップします。 | (オプション) を使用して AWS でプライベートエンドポイントを設定できます[AWS PrivateLink](https://www.mongodb.com/docs/atlas/security-private-endpoint/)。 | MongoDB DBA | 
| 2 要素認証を有効にします。 | (オプション) Atlasは、ユーザーがAtlasアカウントへのアクセスを制御できるようにする 2 要素認証 (2FA) をサポートしています。 | MongoDB DBA | 
| LDAP によるユーザー認証と認可を設定します。 | (オプション) Atlasは、Lightweight Directory Access Protocol (LDAP) によるユーザー認証および認可の実行をサポートします。 | MongoDB DBA | 
| 統合 AWS アクセスを設定します。 | (オプション) Atlas データレイクや顧客キー管理による静的暗号化などを含む一部の Atlas 機能では、認証に IAM ロールを使用します。 | MongoDB DBA | 
| を使用して保管時の暗号化を設定します AWS KMS。 | (オプション) Atlas は、 AWS Key Management Service (AWS KMS) を使用してストレージエンジンとクラウドプロバイダーのバックアップを暗号化することをサポートしています。 | MongoDB DBA | 
| CSFLE を設定します。 | (オプション) Atlas では、フィールドの自動暗号化を含む、[クライアント側のフィールドレベルの暗号化 (CSFLE)](https://www.mongodb.com/docs/upcoming/core/csfle/#client-side-field-level-encryption) がサポートされます。  | MongoDB DBA | 

### データを移行する
<a name="migrate-data"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| MongoDB Atlas でターゲットのレプリカセットを起動します。 | MongoDB Atlas でターゲットのレプリカセットを起動します。Atlas ライブマイグレーションサービスで、「**移行する準備ができました**」を選択します。 | MongoDB DBA | 
|  AWS Glue と MongoDB Atlas の接続を確立します。 |  AWS Glue クローラー を使用して MongoDB Atlas (ターゲットデータベース) AWS Glue に接続します。このステップにより、ターゲット環境の移行準備ができます。詳細については、[AWS Glue のドキュメント](https://docs.aws.amazon.com/glue/latest/dg/console-connections.html)を参照してください。 | MongoDB DBA | 
| ソースデータベースまたはソースストリーム AWS Glue との の接続を確立します。 | これにより、ターゲット環境の移行準備ができます。 | MongoDB DBA | 
| データ変換を設定します。 | 従来の構造化スキーマから MongoDB の柔軟なスキーマにデータを移行するための変換ロジックを設定します。 | MongoDB DBA | 
| データを移行します。 |  AWS Glue Studioで移行をスケジュールします。 | MongoDB DBA | 

### 操作統合の設定
<a name="configure-operational-integration"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| クラスターに接続します。 | MongoDB Atlas クラスターに接続します。 | アプリ開発者 | 
| データを操作します。 | クラスターデータと対話します。 | アプリ開発者 | 
| クラスターをモニタリングします。 | MongoDB Atlas クラスターをモニタリングします。 | MongoDB DBA | 
| データをバックアップおよび復元します。 | クラスターデータをバックアップし、復元します。 | MongoDB DBA | 

## トラブルシューティング
<a name="stream-data-from-ibm-db2-to-mongodb-atlas-troubleshooting"></a>


| 問題 | ソリューション | 
| --- | --- | 
| 問題が発生した場合 | MongoDB Atlas CloudFormation Resources リポジトリの「[トラブルシューティング](https://github.com/mongodb/mongodbatlas-cloudformation-resources/tree/master#troubleshooting)」を参照してください。 | 

## 関連リソース
<a name="stream-data-from-ibm-db2-to-mongodb-atlas-resources"></a>

特に明記されていない限り、以下のリンクはすべて MongoDB ドキュメントのウェブページに移動します。

**移行ガイド**
+ [での MongoDB Atlas への移行 AWS](https://docs.aws.amazon.com/prescriptive-guidance/latest/migration-mongodb-atlas/) (AWS 規範ガイダンス)

発見と評価
+ 「[メモリ](https://docs.atlas.mongodb.com/sizing-tier-selection/#memory)」
+ 「[Atlas サンプルデータセットによるサイジングの例](https://www.mongodb.com/docs/atlas/sizing-tier-selection/#example--the-service-sample-data-sets)」
+ 「[モバイルアプリケーションのサイジング例](https://www.mongodb.com/docs/atlas/sizing-tier-selection/#example--mobile-app)」
+ 「[ネットワークトラフィック](https://docs.atlas.mongodb.com/sizing-tier-selection/#network-traffic)」
+ 「[クラスターの自動スケーリング](https://www.mongodb.com/docs/atlas/sizing-tier-selection/#cluster-auto-scaling)」
+ 「[Atlas サイジングテンプレート](https://view.highspot.com/viewer/5f438f47a4dfa042e97130c5)」

セキュリティとコンプライアンスの設定
+ 「[IP アクセスリストエントリの設定](https://docs.atlas.mongodb.com/security/ip-access-list/)」
+ [データベースユーザーの設定](https://docs.atlas.mongodb.com/security-add-mongodb-users/)
+ [Atlas UI へのアクセスの設定](https://docs.atlas.mongodb.com/organizations-projects/)
+ [カスタムデータベースロールの設定](https://docs.atlas.mongodb.com/security-add-mongodb-roles)
+ [データベースユーザーの設定](https://docs.atlas.mongodb.com/security-add-mongodb-users/#atlas-user-privileges)
+ 「[ネットワークピアリング接続の設定](https://docs.atlas.mongodb.com/security-vpc-peering/)」
+ [Atlas のプライベートエンドポイントについて学ぶ](https://docs.atlas.mongodb.com/security-private-endpoint/)
+ [多要素認証オプションの管理](https://docs.atlas.mongodb.com/security-two-factor-authentication/)
+ 「[LDAP によるユーザー認証と認可の設定](https://docs.atlas.mongodb.com/security-ldaps/)」
+ 「[Atlas データレイク](https://docs.mongodb.com/datalake/)」
+ 「[顧客キー管理による静的暗号化](https://docs.atlas.mongodb.com/security-kms-encryption/)」
+ [ロールを引き受けるための各種方法](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) (IAM ドキュメント)
+ 「[クライアント側のフィールドレベルの暗号化の設定](https://docs.mongodb.com/manual/core/security-client-side-encryption)」
+ [自動暗号化](https://docs.mongodb.com/manual/core/security-automatic-client-side-encryption) 
+ [MongoDB Atlas のセキュリティコントロール](https://webassets.mongodb.com/_com_assets/cms/MongoDB_Atlas_Security_Controls-v7k3rbhi3p.pdf)
+ [MongoDB トラストセンター](https://www.mongodb.com/cloud/trust)
+ [クラスターのセキュリティ機能の設定](https://docs.atlas.mongodb.com/setup-cluster-security/)

**AWS** **上に新しい MongoDB Atlas 環境を設定する**
+ 「[クラウドプロバイダーとリージョン](https://docs.atlas.mongodb.com/cloud-providers-regions/)」
+ [グローバルクラスターの管理](https://docs.atlas.mongodb.com/global-clusters/)
+ [クラスター階層の選択](https://www.mongodb.com/docs/atlas/manage-clusters/#select-cluster-tier)
+ [追加の設定](https://docs.atlas.mongodb.com/cluster-additional-settings/)
+ [Atlas の使用開始](https://docs.atlas.mongodb.com/getting-started/)
+ [Atlas UI へのアクセスの設定](https://docs.atlas.mongodb.com/organizations-projects/)

**データを移行する**
+ [データを移行またはインポートする](https://www.mongodb.com/docs/atlas/import/)

**クラスターのモニタリング**
+ [クラスターをモニタリングする](https://docs.atlas.mongodb.com/monitoring-alerts/)

オペレーションの統合
+ 「[クラスターへの接続](https://docs.atlas.mongodb.com/connect-to-cluster/)」
+ [データを操作する](https://docs.atlas.mongodb.com/data-explorer/)
+ [クラスターをモニタリングする](https://docs.atlas.mongodb.com/monitoring-alerts/)
+ [データをバックアップ、復元、およびアーカイブする](https://docs.atlas.mongodb.com/backup-restore-cluster/)

**GitHub リポジトリ**
+ [を使用して MongoDB Atlas にデータをストリーミングする AWS Glue](https://github.com/mongodb-partners/Stream_Data_into_MongoDB_AWS_Glue?tab=readme-ov-file#troubleshooting)