Multi-tenant DynamoDB tables create a common operational problem.
Imagine one table contains data for hundreds or thousands of customers:
Tenant A
Tenant B
Tenant C
...
Tenant 1000Now one customer asks for a copy of its data.
Or a deployment corrupts records for one tenant and the engineering team needs to recover only that customer's data.
Before filtered export, the practical options were often much broader. Teams could export the whole table and filter the data afterward, or write application code to read the tenant's records and copy them somewhere else.
Amazon DynamoDB now supports filtered export to Amazon S3, allowing developers to select the items and attributes that should be included in an export. The feature works with both full and incremental exports and uses DynamoDB's point-in-time recovery data rather than consuming table read capacity.
That changes the workflow considerably.
Instead of:
4 TB DynamoDB Table
|
v
Full Export
|
v
Filter Tenant Data
|
v
Desired Datasetyou can request:
DynamoDB Table
|
v
Filtered Export
|
+-- Tenant Condition
+-- Attribute Filter
+-- Attribute Projection
|
v
Amazon S3
|
v
Only Required DataFor multi-tenant systems, this can be useful for recovery, data sharing, tenant migration, compliance workflows, and analytics.
What Is DynamoDB Filtered Export?
DynamoDB export to Amazon S3 already allows full and incremental exports.
A full export captures table data as it existed at a selected point in time within the point-in-time recovery window.
An incremental export captures changes within a specified time window.
Filtered export adds another layer:
Export
|
+-- Which items?
|
+-- Which attributes?
|
+-- Which point in time?AWS introduced filtered export in October 2026. It allows a FilterSpecification to define:
KeyConditionExpressionFilterExpressionProjectionExpressionExpressionAttributeNamesExpressionAttributeValues
These expressions determine which items qualify and which attributes are written to S3.
Why This Matters for Multi-Tenant Applications
Consider a SaaS application with this table:
CustomerData
--------------------------------
TenantId
RecordId
Type
Status
CreatedAt
CustomerName
Email
Address
PaymentInformationSuppose the table contains:
Tenant A -> 500 GB
Tenant B -> 300 GB
Tenant C -> 200 GB
...
Total -> 4 TBA customer wants its data exported.
A full export would include every tenant.
The application would then need to identify the requested tenant's records.
Filtered export lets the export itself select the tenant.
Conceptually:
KeyConditionExpression
|
v
TenantId = "tenant-123"
|
v
Only matching partitionThis is especially useful when the tenant identifier is part of the DynamoDB partition-key design.
How Filtered Export Works
There are three important filtering concepts.
Key Condition
The key condition identifies the partition to export.
For example:
TenantId = "tenant-123"A key condition follows DynamoDB Query-style rules. It can specify one partition-key value and optionally a condition on the sort key.
Filter Expression
A filter expression can further restrict which items are included.
For example:
Status = "ACTIVE"This allows the export to select items based on non-key attributes.
Projection Expression
Projection determines which attributes are actually written.
For example:
TenantId,
RecordId,
Status,
CreatedAtThis is important when you want to share data without exporting every attribute.
The result is:
Tenant
|
v
Key Condition
|
v
Matching Items
|
v
Filter Expression
|
v
Selected Items
|
v
Projection Expression
|
v
Selected Attributes
|
v
S3Example DynamoDB Table Design
Consider a multi-tenant table:
PK SK
--------------------------------
TENANT#1001 ORDER#5001
TENANT#1001 ORDER#5002
TENANT#1002 ORDER#6001
TENANT#1003 ORDER#7001The item might look like:
{
"TenantId": "tenant-1001",
"OrderId": "order-5001",
"Status": "COMPLETED",
"CreatedAt": "2026-09-20T10:15:00Z",
"CustomerName": "Example Customer",
"Email": "[email protected]"
}If the application uses TenantId as the partition key, the export can target that partition.
A conceptual filter specification looks like:
{
"KeyConditionExpression": "#tenant = :tenant",
"ExpressionAttributeNames": {
"#tenant": "TenantId"
},
"ExpressionAttributeValues": {
":tenant": {
"S": "tenant-1001"
}
}
}This selects the requested tenant.
Exporting One Tenant With the AWS CLI
The AWS CLI supports the --filter-specification option on export-table-to-point-in-time.
A simplified example is:
aws dynamodb export-table-to-point-in-time \
--table-arn arn:aws:dynamodb:us-east-1:123456789012:table/CustomerData \
--export-time 2026-09-30T00:00:00Z \
--s3-bucket my-dynamodb-exports \
--s3-prefix exports/tenant-1001/ \
--export-format DYNAMODB_JSON \
--filter-specification '{
"KeyConditionExpression": "#tenant = :tenant",
"ExpressionAttributeNames": {
"#tenant": "TenantId"
},
"ExpressionAttributeValues": {
":tenant": {
"S": "tenant-1001"
}
}
}'The exact table ARN, bucket, region, and timestamp should come from the environment where the export is being performed.
The important part is the filter specification.
Selecting Specific Attributes
Sometimes the tenant's entire dataset should not be shared.
For example, the item contains:
TenantId
OrderId
Status
CreatedAt
CustomerName
Email
PaymentInformation
InternalNotesThe receiving system may only need:
TenantId
OrderId
Status
CreatedAtUse a projection expression:
{
"KeyConditionExpression": "#tenant = :tenant",
"ProjectionExpression": "#tenant, OrderId, #status, CreatedAt",
"ExpressionAttributeNames": {
"#tenant": "TenantId",
"#status": "Status"
},
"ExpressionAttributeValues": {
":tenant": {
"S": "tenant-1001"
}
}
}The exported item will contain only the selected attributes.
This is an important security improvement.
You do not have to export sensitive attributes and then depend on another process to remove them later.
Filtering Sensitive Data
Suppose a tenant requests its historical data for an audit.
The source item contains:
TenantId
OrderId
Status
CustomerName
Email
Phone
PaymentToken
InternalNotesThe external audit system needs:
TenantId
OrderId
Status
CreatedAtThe projection should explicitly select those fields.
Source Item
|
+-- TenantId -> Export
+-- OrderId -> Export
+-- Status -> Export
+-- CreatedAt -> Export
+-- Email -> Exclude
+-- Phone -> Exclude
+-- PaymentToken -> Exclude
+-- InternalNotes -> ExcludeThis is safer than exporting everything and trying to redact it afterward.
However, projection is an attribute allow-list, not a content scanner. If an included free-text field contains personal information, that information is still exported. AWS specifically notes that projection controls which attributes are written but does not inspect the values inside those attributes.
Filter Expression vs Key Condition
This distinction is important.
A key condition can restrict the partition being processed.
For example:
TenantId = "tenant-1001"A filter expression is applied after the relevant data is read for the export.
For example:
Status = "ACTIVE"Therefore:
Key Condition
|
v
Reduces Partitions Considered
|
v
Filter Expression
|
v
Selects Matching ItemsAWS notes that a key condition can reduce the data processed when it identifies a partition key, while a filter expression selects items without reducing the underlying data processed.
This is similar to an important DynamoDB concept: filtering is not the same thing as reducing the amount of data that has to be read.
Full Export vs Incremental Export
Filtered export works with both export types.
Full Filtered Export
A full filtered export gives you matching data as it existed at a selected point in time.
For example:
September 30, 2026
|
v
Tenant 1001
|
v
Point-in-Time ExportThis is useful for:
Tenant migration
Historical data sharing
Data recovery
Creating an isolated dataset
Incremental Filtered Export
An incremental export captures changes within a time window.
For example:
10:00
|
+-- Item changed
|
+-- Item deleted
|
+-- Item inserted
|
11:00You can filter those changes to a particular tenant.
This can be especially useful during incident recovery.
Recovering One Tenant After a Bad Deployment
Consider a multi-tenant application.
A bad deployment modifies records for one tenant between 10:00 and 10:45.
The table contains:
Tenant A
Tenant B
Tenant C
Tenant D
...You do not want to restore the entire table.
With filtered incremental export, the recovery workflow can look like:
DynamoDB PITR
|
v
Incremental Export
|
+-- Tenant = A
+-- Corruption Window
|
v
Amazon S3
|
v
Review Data
|
v
Recover Required ItemsAWS demonstrates this type of recovery workflow using filtered incremental export for a single tenant rather than restoring the entire table.
This is one of the strongest use cases for the feature.
Important Point: Export Is Not a Direct Restore
A filtered export writes data to Amazon S3.
It does not automatically rewrite the original DynamoDB table.
That separation is useful.
The workflow becomes:
DynamoDB
|
v
Filtered Export
|
v
S3
|
v
Review / Transform
|
v
Controlled RecoveryYou can inspect the exported data before deciding what should be written back.
This is much safer than immediately modifying production records.
Join the conversation! Your thoughts help the community grow.