Design considerations - Cognito User Profiles Export Reference Architecture

Design considerations

One-way scheduled export

This solution automatically exports data from your primary user pool to Amazon DynamoDB on a scheduled basis. If you create a new user pool and populate it by running the ImportWorkflow AWS Step Functions workflow, you can configure scheduled exports of this new user pool by launching a new instance of this solution and configuring it to point to the new user pool.

Solution configuration

When launching the AWS CloudFormation template, there are two parameters you can use to influence the solution’s behavior.

Export frequency

This parameter sets the schedule expression for the Amazon CloudWatch Events rule that starts the ExportWorkflow Step Functions workflow. The AWS CloudFormation template will have options for every day, seven days, or 30 days. If you require a different schedule, update the CloudWatch Events rule after the solution is deployed.

Cognito transactions per second (TPS)

This parameter sets the maximum number of times an Amazon Cognito API is called per second. While the ExportWorkflow Step Functions workflow is running, API calls are made to list users and groups in the primary user pool. When the ImportWorkflow Step Functions workflow is running, it adds groups and adds users to groups. These API calls count against your existing Cognito API limits. This parameter can reduce the risk of the solution inadvertently impacting your applications. Lowering this value results in this solution taking longer to run.

User pool Cognito TPS setting Action Approximate run time
10,000 users No groups 10 Sync workflow 2.62 minutes
Recovery workflow 8.13 minutes
5 Sync workflow 2.66 minutes
Recovery workflow 8.32 minutes
10,000 users Each user in one group 10 Sync workflow 4.76 minutes
Recovery workflow 29.24 minutes
5 Sync workflow 4.82 minutes
Recovery workflow 47.73 minutes
100,000 users No groups 10 Sync workflow 21.82 minutes
Recovery workflow 56.31 minutes
100,000 users Each user in one group 10 Sync workflow 40.26 minutes
Recovery workflow 290.24 minutes
250,000 users No groups 10 Sync workflow 54.79 minutes
Recovery workflow 128.2 minutes
250,000 users Each user in one group 10 Sync workflow 98.65 minutes
Recovery workflow 678.29 minutes
500,000 users No groups 10 Sync workflow 146.52 minutes
Recovery workflow 247.63 minutes
500,000 users Each user in one group 10 Sync workflow 181.46 minutes
Recovery workflow 1,313.31 minutes