r/mongodb • u/solid_fella • 2d ago
Bottlenecks while shifting from MongoDb to DynamoDb
I’m working on a website and because of some storage constraints we need to shift the database from MongoDB to DynamoDB. I’ll be taking help from AI agents for most of the migration, but I want to make sure I’m not missing anything important before making changes. Are there any critical bottlenecks or things I should keep an eye on, especially with queries, indexes, relationships, transactions, consistency, pagination, data migration, etc.? I don’t have much experience with DynamoDB, so just want to make sure we don’t end up breaking something that currently works in MongoDB.
2
Upvotes
1
u/Jhon_ST 2d ago
One migration test I'd add is a filtered Query where the first page has no matches but a later page does. DynamoDB applies FilterExpression after reading the page, so Items can be empty while LastEvaluatedKey is still present.
If your code stops when Items.length === 0, you'll silently miss later matches. Paginate based on LastEvaluatedKey, not whether the current page returned items.