Atlas オーガニゼーション、プロジェクト、クラスターに関するガイダンス
項目一覧
組織、プロジェクト、クラスターは、Atlasエンタープライズ資産の基盤です。
組織レベルでは、セキュリティ制御を実装し、1 つ以上のプロジェクトに取り組むユーザーを作成できます。
プロジェクトは、より細かいセキュリティの分離と承認の境界を提供します。
クラスター は、Atlas のクラウドデータベースです。
このページの基本的なガイダンスを使用して、貴社の階層と予想されるクラスターおよびプロジェクトの数に基づいて、組織、プロジェクト、クラスターのレイアウトを設計してください。このガイダンスは、貴社の請求およびアクセスのニーズに合わせながら、セキュリティとパフォーマンスを最初から最適化するのに役立ちます。
Atlas の組織、プロジェクト、およびクラスターの機能
Atlas エンタープライズプロパティのセキュリティ設定とガバナンスを定義するには、次のレベルの階層を使用します。
Atlas 階層のレベル | 説明 |
---|---|
(任意)支払組織 | |
組織 | 組織はその下に多くのプロジェクトを含めることができ、共有統合とセキュリティ設定を適用するためのコンテナを提供します。複数の Atlas 組織を管理する場合、Atlas Federation Management Console を使用すると、組織所有者のロールを持つユーザーが IdP を SSO 用に管理し、それらを複数の組織にリンクできます。組織は多くの場合、会社内の事業部(BU)または部署に対応します。組み込みの Atlas Cost Explorer は、組織レベルでクラウド支出を集計し、その下のプロジェクトレベルとクラスターレベルで明細項目を分解します。請求APIを活用することで、さらにカスタマイズが可能です。 |
プロジェクト | データプレーンのセキュリティ構成(データベースクラスター、ネットワークセキュリティ、その他のデータサービスを含む)は、プロジェクトレベルで行われます。プロジェクトは多くの場合、アプリケーションと環境(例:カスタマーポータルアプリケーション・本番環境)に関連付けられます。各プロジェクトごとに、選択したクラウドプロバイダーに基づいて、AWSおよびAzureの各リージョンに1つの専用VPCまたはVNetがあります。 |
クラスター | Atlasは、プロジェクト用に専用のVPC/VNet内の各クラスターをプロビジョニングします。セキュリティ構成は、クラスタ、データベース、およびコレクション・レベルのアクションに適用できるデータベース・ユーザのロールと権限を除き、プロジェクト内のクラスタ間で共有されます。 |
Atlas の組織、プロジェクト、クラスターに関する推奨事項
開発環境、テスト環境、ステージング環境、本番環境
サンドボックスおよびテストプロジェクトとクラスターをアプリケーションプロジェクトおよびクラスターから分離するために、次の4つの環境を使用することをお勧めいたします。
environment | 説明 |
---|---|
開発(Dev) | 開発者が安全なサンドボックス環境で新しいことを自由に試みることができます。 |
テスト(テスト) | 開発環境で作成された特定のコンポーネントまたは関数をテストします。 |
ステージング | すべてのコンポーネントと機能をステージングして、本番にデプロイする前にアプリケーション全体が期待どおりに動作することを確認します。ステージングはテスト環境と似ていますが、新しいコンポーネントが既存のコンポーネントと連携することが保証されます。 |
本番環境(Prod) | エンドユーザー様のために稼働中のアプリケーションのバックエンドです。 |
Atlas のローカル配置
For development and testing purposes, developers can use the Atlas CLI to create a local Atlas deployment. By working locally from their machines, developers can cut down on costs for external development and testing environments.
Developers can also run Atlas CLI commands with Docker to build, run, and manage local Atlas deployments using containers. Containers are standardized units that contain all of the software needed to run an application. Containerization allows developers to build local Atlas deployments in secure, reliable, and portable test environments. To learn more, see Docker を使用したローカル Atlas 配置の作成.
組織およびプロジェクトの階層
一般的には、一元的に管理される支払い組織を推奨し、支払い組織にリンクされた各事業部または部門ごとに1つの組織を推奨します。次に、下位環境(開発環境またはテスト環境)と上位環境用にそれぞれ1つのクラスターを含むプロジェクトを作成してください。これらのプロジェクトでクラスターを作成することができます。詳細については、以下の「推奨階層」を参照してください。
組織ごとに 250プロジェクトの制限に簡単に達する場合は、環境ごとに 1 つの組織を作成することをお勧めします。たとえば、下位環境と上位環境用に 1 つずつ、または開発、テスト、ステージング、本番環境でそれぞれ 1 つなどです。この設定には、追加の分離の利点があります。制限を増やすこともできます。詳細については、「 Atlas サービスの制限 」を参照してください。
推奨階層
事業部全体で共通のチームと権限があり、組織あたりの 250 プロジェクトという引き上げ可能な制限を下回っている場合は、次の階層を考えてみてください。
推奨階層 2:分散型ビジネスユニット/部門
組織が非常に分散化されており、契約および請求の責任者としての役割を勤める一元化された機能がない場合は、次の階層を検討してください。この階層では、各BU、部門、またはチームがそれぞれのアトラス組織を持っています。この階層は、各チームがかなり独立しており、社内で人員や権限を共有していない場合、またはクラウドプロバイダーのマーケットプレイスを通じて、または独自の契約で直接クレジットを購入したい場合に役立ちます。この階層には支払い組織が存在しません。
Cluster Hierarchy
To maintain isolation between environments, we recommend that you deploy each cluster within its own project, as shown in the following diagram. This allows administrators to maintain different project configurations between environments and uphold the principle of least privilege, which states that users should only be granted the least level of access necessary for their role.
However, this hierarchy may make it more complicated to share project-level configurations such as private endpoints and CMKs across clusters. To learn more, see When to Consider Multiple Clusters Per Project.
When to Consider Multiple Clusters Per Project
The following diagram shows an organization whose projects each contain multiple Atlas clusters, grouped by environment. Deploying multiple clusters within the same project simplifies administration when one application uses multiple backing clusters, or the same team is responsible for multiple applications across environments. This eases the setup cost for features such as private endpoints and customer-managed keys, because all clusters in the same project share the same project configuration.
However, this cluster hierarchy may violate the principle of least privilege.
Deploy multiple clusters within the same project only if both of the following are true:
Each team member with access to the project is working on all other applications and clusters in the project.
You are creating clusters for development and testing environments. In staging and production environments, we recommend that clusters in the same project should belong to the same application and be administered by the same team.
リソースタグの付与
レポートおよび統合のための解析を容易にするために、次の詳細を使用してクラスターまたはプロジェクトにタグを付けることをお勧めします。
BU または部署
teamName
ApplicationName
environment
バージョン
メール問い合わせ
重要度(クラスターに保存されているデータの階層を示し、PII や PHI などの機密性の高い分類を含みます)
タグを使用した請求データの解析について詳しくは、Atlas 請求データの機能をご覧ください。
Atlas クラスター サイズ ガイド
In a dedicated deployment (cluster size M10
+), Atlas
allocates resources exclusively. We recommend dedicated deployments
for production use cases because they provide higher security and performance than shared
clusters.
The following cluster size guide uses "t-shirt sizing," a common analogy used in software development and infrastructure to describe capacity planning in a simplified manner. Use t-shirt sizing recommendations only as approximate starting points in your sizing analysis. Sizing a cluster is an iterative process based on changing resource needs, performance requirements, workload characteristics, and growth expectations.
重要
This guidance excludes mission-critical applications, high-memory workloads, and high-CPU workloads. For these use cases, contact MongoDB Support for customized guidance.
You can estimate the cluster resources that your deployment requires by using your organization's approximate data size and workload:
必要なストレージの合計:未加工データ全体の 50%
必要な RAM の合計: 未加工データサイズの 10%
必要な CPU コアの合計 :データベース操作 1 秒あたりの予想ピーク読み取り/書込み操作数 割かつ 4000
Total Storage IOPS Required: expected peak read/write database operations per second (min IOPS = 5%, max IOPS = 95%)
Use the following cluster size guide to select a cluster tier that ensures performance without over-provisioning. This table displays the default storage and performance capabilities for each cluster tier, as well as whether or not the cluster tier is suitable for staging and production environments.
T シャードのサイズ | クラスター階層 | ストレージ範囲: Amazon Web Services/ Google Cloud Platform | ストレージ範囲: Azure | CPUs (#) | デフォルトの RAM | デフォルトの IOPS | Suitable For |
---|---|---|---|---|---|---|---|
小 |
| 10 GB から 128 GB | 8 GB から 128 GB | 2 | 2 GB | 1000 | 開発/テストのみ |
Med |
| 10 GB から 512 GB | 8 GB から 512 GB | 2 | 8 GB | 3000 | Prod |
大 |
| 10 GB から 4 TB | 8 GB から 4 TB | 16 | 32 GB | 3000 | Prod |
X-Large |
| 10 GB から 4 TB | 8 GB から 4 TB | 32 | 128 GB | 3000 | Prod |
[1] | M10 は共有 CPU 階層です。規制の厳しい業界や機密データの場合、最小の開始階層はM30 であるべきです。 |
クラスター階層とそれをサポートするリージョンの詳細については、各クラウドプロバイダーのAtlasドキュメントをご覧ください。
オートメーションの例:Atlas 組織、プロジェクト、クラスター
次の例では、オートメーション用の Atlas ツール を使用して組織、プロジェクト、クラスターを作成します。
これらの例では、次のような他の推奨される構成も適用されます。
開発用またはテスト環境では、クラスター階層が
M10
に設定されています。アプリケーションサイズに推奨されるクラスター層については、 クラスター サイズガイドを使用してください。単一リージョン、3ノードレプリカセット/シャード配置トポロジー。
この例では、Amazon Web Services、Azure、Google Cloud Platform をどちらも使用しています。これら 3 つのクラウドプロバイダーのいずれかを使用できますが、クラウドプロバイダーと一致するようにリージョン名を変更する必要があります。クラウドプロバイダーとそのリージョンの詳細については、「 クラウドプロバイダー 」を参照してください。
中規模アプリケーション用のクラスター階層が
M30
に設定されました。クラスターサイズガイドを使用して、アプリケーションのサイズに応じた推奨クラスター階層を学びます。単一リージョン、3ノードレプリカセット/シャード配置トポロジー。
この例では、Amazon Web Services、Azure、Google Cloud Platform をどちらも使用しています。これら 3 つのクラウドプロバイダーのいずれかを使用できますが、クラウドプロバイダーと一致するようにリージョン名を変更する必要があります。クラウドプロバイダーとそのリージョンの詳細については、「 クラウドプロバイダー 」を参照してください。
注意
Atlas CLI を使用してリソースを作成する前に、次の手順を実行する必要があります。
組織を作成
各BUに対して次のコマンドを実行してください。ID と名前を変更して、実際の値を使用してください。
atlas organizations create ConsumerProducts --ownerId 508bb8f5f11b8e3488a0e99e --apiKeyRole ORG_OWNER --apiKeyDescription consumer-products-key
この例に関する構成オプションと詳細については、atlas 組織の作成を参照してください。
ユーザーIDと組織IDを取得するには、次のコマンドをご覧ください。
プロジェクトを作成する
アプリケーションと環境のペアごとに次のコマンドを実行します。ID と名前を変更して、 値を使用します。
atlas projects create "Customer Portal - Prod" --tag environment=production --orgId 32b6e34b3d91647abb20e7b8
その他の構成オプションとこの例に関する情報については、「 Atlas プロジェクト作成 」を参照してください。
プロジェクトIDを取得するには、次のコマンドをご覧ください。
カスタマー キー管理による暗号化の設定
ステージング環境と本番環境では、クラスターをプロビジョニングする際に、カスタマー鍵管理による暗号化を有効にすることをお勧めします。開発やテストの場合、規制の厳しい業界や機密データを保管する場合を除き、コスト削減のためにカスタマー鍵管理による暗号化をスキップすることを検討してください。詳細については、Atlas の組織、プロジェクト、およびクラスターに関する推奨事項。をご覧ください。
Atlas CLI を使用して、カスタマーキー管理で暗号化を管理することはできません。代わりに、次のメソッドを使用してください。
プロジェクトごとに 1 つのクラスターを作成します。
開発環境およびテスト環境では、作成したプロジェクトごとに次のコマンドを実行します。ID と名前を変更して、 値を使用します。
atlas clusters create CustomerPortalDev \ --projectId 56fd11f25f23b33ef4c2a331 \ --region EASTERN_US \ --members 3 \ --tier M10 \ --provider GCP \ --mdbVersion 8.0 \ --diskSizeGB 30 \ --tag bu=ConsumerProducts \ --tag teamName=TeamA \ --tag appName=ProductManagementApp \ --tag env=Production \ --tag version=8.0 \ --tag email=marissa@acme.com \ --watch
ステージング環境と本番環境において、作成した各プロジェクトごとに次の cluster.json
ファイルを作成してください。ID と名前を変更して、あなたの値を使用してください。
{ "clusterType": "REPLICASET", "links": [], "name": "CustomerPortalProd", "mongoDBMajorVersion": "8.0", "replicationSpecs": [ { "numShards": 1, "regionConfigs": [ { "electableSpecs": { "instanceSize": "M30", "nodeCount": 3 }, "priority": 7, "providerName": "GCP", "regionName": "EASTERN_US", "analyticsSpecs": { "nodeCount": 0, "instanceSize": "M30" }, "autoScaling": { "compute": { "enabled": false, "scaleDownEnabled": false }, "diskGB": { "enabled": false } }, "readOnlySpecs": { "nodeCount": 0, "instanceSize": "M30" } } ], "zoneName": "Zone 1" } ], "tag" : [{ "bu": "ConsumerProducts", "teamName": "TeamA", "appName": "ProductManagementApp", "env": "Production", "version": "8.0", "email": "marissa@acme.com" }] }
cluster.json
ファイルを作成した後、作成した各プロジェクトに対して次のコマンドを実行してください。このコマンドは、cluster.json
ファイルを使用してクラスターを作成します。
atlas cluster create --projectId 5e2211c17a3e5a48f5497de3 --file cluster.json
その他の構成オプションとこの例に関する情報については、atlas クラスターの作成を参照してください。
注意
Terraform でリソースを作成する前に、次の手順を実行する必要があります。
支払い組織を作成し、組織のAPIキーを作成します。ターミナルで次のコマンドを実行し、APIキーを環境変数として保存してください。
export MONGODB_ATLAS_PUBLIC_KEY="<insert your public key here>" export MONGODB_ATLAS_PRIVATE_KEY="<insert your private key here>"
プロジェクトとデプロイメントを作成する
開発環境およびテスト環境では、アプリケーションと環境のペアごとに次のファイルを作成します。各アプリケーションと環境ペアのファイルを 独自のディレクトリに配置します。ID と名前を変更して、 値を使用します。
main.tf
# Create a Project resource "mongodbatlas_project" "atlas-project" { org_id = var.atlas_org_id name = var.atlas_project_name } # Create an Atlas Advanced Cluster resource "mongodbatlas_advanced_cluster" "atlas-cluster" { project_id = mongodbatlas_project.atlas-project.id name = "ClusterPortalDev" cluster_type = "REPLICASET" mongo_db_major_version = var.mongodb_version replication_specs { region_configs { electable_specs { instance_size = var.cluster_instance_size_name node_count = 3 } priority = 7 provider_name = var.cloud_provider region_name = var.atlas_region } } tags { key = "BU" value = "ConsumerProducts" } tags { key = "TeamName" value = "TeamA" } tags { key = "AppName" value = "ProductManagementApp" } tags { key = "Env" value = "Test" } tags { key = "Version" value = "8.0" } tags { key = "Email" value = "marissa@acme.com" } } # Outputs to Display output "atlas_cluster_connection_string" { value = mongodbatlas_advanced_cluster.atlas-cluster.connection_strings.0.standard_srv } output "project_name" { value = mongodbatlas_project.atlas-project.name }
variables.tf
# Atlas Organization ID variable "atlas_org_id" { type = string description = "Atlas Organization ID" } # Atlas Project Name variable "atlas_project_name" { type = string description = "Atlas Project Name" } # Atlas Project Environment variable "environment" { type = string description = "The environment to be built" } # Cluster Instance Size Name variable "cluster_instance_size_name" { type = string description = "Cluster instance size name" } # Cloud Provider to Host Atlas Cluster variable "cloud_provider" { type = string description = "AWS or GCP or Azure" } # Atlas Region variable "atlas_region" { type = string description = "Atlas region where resources will be created" } # MongoDB Version variable "mongodb_version" { type = string description = "MongoDB Version" } # Atlas Group Name variable "atlas_group_name" { type = string description = "Atlas Group Name" }
terraform.tfvars
atlas_org_id = "32b6e34b3d91647abb20e7b8" atlas_project_name = "Customer Portal - Dev" environment = "dev" cluster_instance_size_name = "M10" cloud_provider = "AWS" atlas_region = "US_WEST_2" mongodb_version = "8.0"
プロバイダー.tf
# Define the MongoDB Atlas Provider terraform { required_providers { mongodbatlas = { source = "mongodb/mongodbatlas" } } required_version = ">= 0.13" }
ステージング環境と本番環境において、各アプリケーションと環境のペアごとに以下のファイルを作成してください。各アプリケーションと環境のペアごとにファイルをそれぞれのディレクトリに配置してください。ID と名前を変更して、貴方の値を使用してください。
main.tf
# Create a Group to Assign to Project resource "mongodbatlas_team" "project_group" { org_id = var.atlas_org_id name = var.atlas_group_name usernames = [ "user1@example.com", "user2@example.com" ] } # Create a Project resource "mongodbatlas_project" "atlas-project" { org_id = var.atlas_org_id name = var.atlas_project_name # Assign the Project the Group with Specific Roles team_id = mongodbatlas_team.project_group.team_id role_names = ["GROUP_READ_ONLY", "GROUP_CLUSTER_MANAGER"] } # Create an Atlas Advanced Cluster resource "mongodbatlas_advanced_cluster" "atlas-cluster" { project_id = mongodbatlas_project.atlas-project.id name = "ClusterPortalProd" cluster_type = "REPLICASET" mongo_db_major_version = var.mongodb_version replication_specs { region_configs { electable_specs { instance_size = var.cluster_instance_size_name node_count = 3 } priority = 7 provider_name = var.cloud_provider region_name = var.atlas_region } } tags { key = "BU" value = "ConsumerProducts" } tags { key = "TeamName" value = "TeamA" } tags { key = "AppName" value = "ProductManagementApp" } tags { key = "Env" value = "Production" } tags { key = "Version" value = "8.0" } tags { key = "Email" value = "marissa@acme.com" } } # Outputs to Display output "atlas_cluster_connection_string" { value = mongodbatlas_advanced_cluster.atlas-cluster.connection_strings.0.standard_srv } output "project_name" { value = mongodbatlas_project.atlas-project.name }
variables.tf
# Atlas Organization ID variable "atlas_org_id" { type = string description = "Atlas Organization ID" } # Atlas Project Name variable "atlas_project_name" { type = string description = "Atlas Project Name" } # Atlas Project Environment variable "environment" { type = string description = "The environment to be built" } # Cluster Instance Size Name variable "cluster_instance_size_name" { type = string description = "Cluster instance size name" } # Cloud Provider to Host Atlas Cluster variable "cloud_provider" { type = string description = "AWS or GCP or Azure" } # Atlas Region variable "atlas_region" { type = string description = "Atlas region where resources will be created" } # MongoDB Version variable "mongodb_version" { type = string description = "MongoDB Version" } # Atlas Group Name variable "atlas_group_name" { type = string description = "Atlas Group Name" }
terraform.tfvars
atlas_org_id = "32b6e34b3d91647abb20e7b8" atlas_project_name = "Customer Portal - Prod" environment = "prod" cluster_instance_size_name = "M30" cloud_provider = "AWS" atlas_region = "US_WEST_2" mongodb_version = "8.0" atlas_group_name = "Atlas Group"
プロバイダー.tf
# Define the MongoDB Atlas Provider terraform { required_providers { mongodbatlas = { source = "mongodb/mongodbatlas" } } required_version = ">= 0.13" }
この例に関するその他の設定オプションや情報については、MongoDB & HashiCorp TerraformおよびMongoDB Terraform ブログ記事をご覧ください。
ファイルを 作成した後、各アプリケーションと環境ペアのディレクトリに移動し、次のコマンドを実行して Terraform を初期化してください。
terraform init
Terraform プランを表示するには、次のコマンドを実行してください。
terraform plan
次のコマンドを実行して、アプリケーションと環境のペアに対して1つのプロジェクトと1つのデプロイメントを作成してください。コマンドは、ファイルとMongoDB & HashiCorp Terraformを使用して、プロジェクトとクラスターを作成します。
terraform apply
プロンプトが表示されたら、yes
を入力し、Enter
を押して設定を適用してください。
次のステップ
組織、プロジェクト、クラスターの階層とサイズを計画した後、次の推奨リソースを参照するか、左側のナビゲーションを使用して、Well-Architected フレームワークの各柱の機能とベストプラクティスを見つけてください。