All Products
Search
Document Center

PolarDB:Compatibility and Limits

Last Updated:Mar 28, 2026

PolarDB for PostgreSQL supports the mainstream Amazon DynamoDB API operations. Before you migrate data or run your application against PolarDB, read this topic to understand which operations are supported, how PolarDB behavior differs from native DynamoDB, and what limits apply.

Assess compatibility before migrating

PolarDB provides a local static code analysis tool, polardb_ddb_code_digest, to help you evaluate how much of your existing codebase will work without modification.

How it works

image
  1. Code scanning: The tool recursively scans your project directories and parses source files. Go and Python are supported.

  2. API analysis: The tool extracts all DynamoDB API calls, parameter names, constants, and expression structures based on the official AWS SDK specifications.

  3. Report generation: The tool removes all business data values and generates a structured report listing the APIs, parameters, and their usage frequency in your project.

Use this report to check your API usage against the limits in this topic.

Install and run the tool

Prerequisites

Before you begin, ensure that you have:

  • Python 3.9.6 or later

  • The project directory containing your Go or Python source files

Steps

  1. Download polardb_ddb_code_digest.tar.gz to your application environment.

  2. Unzip the file and go to the unzipped directory.

  3. (Optional) Create a virtual environment to isolate project dependencies:

    python3 -m venv venv && source venv/bin/activate
  4. Install the project dependencies:

    pip3 install -r requirements.txt
  5. Scan your source files:

    • Python project: ``bash python3 main.py --dir <path/to/dir> --lang python > scan_output.log ``

    • Go project: ``bash python3 main.py --dir <path/to/dir> --lang go > scan_output.log ``

Behavior differences and limits

This section describes how PolarDB differs from native DynamoDB. Unsupported parameters fall into two categories:

  • Ignored: The parameter is silently accepted but has no effect. The request succeeds, but the parameter value is not applied.

  • Error: The parameter is rejected and causes the request to fail with an error.

Deprecated parameters

PolarDB follows the current DynamoDB API specification. Deprecated parameters are not supported. Replace them with their modern equivalents before migrating.

Deprecated parameterReplacement
AttributeUpdatesUpdateExpression
ExpectedConditionExpression
AttributesToGetProjectionExpression
ConditionalOperatorConditionExpression or FilterExpression
KeyConditionsKeyConditionExpression
QueryFilterFilterExpression
ScanFilterFilterExpression

Consistency

PolarDB does not support per-request strong consistency reads (ConsistentRead=true). The consistency level is configured at the DynamoDB endpoint and applies to all requests on that endpoint.

Billing and capacity parameters

All DynamoDB billing and capacity parameters are ignored or not returned. This includes:

  • Request parameters ignored: ReturnConsumedCapacity

  • Response fields not returned: ConsumedCapacity, ItemCollectionMetrics

  • Statistics parameters not supported: ReturnItemCollectionMetrics

Index projections

When specifying NonKeyAttributes for a secondary index, the projected fields cannot include the table's primary key (partition key or sort key) or the index's own primary key.

Atomicity in batch operations

In PolarDB, batch operations are atomic: all operations in a single request either succeed or fail together.

  • `BatchWriteItem`: UnprocessedItems in the response is always empty because partial failures do not occur.

  • `BatchGetItem`: UnprocessedKeys in the response is always empty for the same reason.

Primary key conflicts in batch and transactional operations

PolarDB and native DynamoDB handle primary key conflicts differently:

OperationNative DynamoDBPolarDB
BatchWriteItem: PutItem and DeleteItem on the same primary key in one requestNot allowedAllowed
BatchGetItem: duplicate primary keys in one requestNot allowedAllowed; returns one item per duplicate key
TransactWriteItems: multiple operations on the same primary key in one transactionNot allowedAllowed
TransactGetItems: multiple operations on the same primary key in one transactionNot allowedAllowed

Transaction failure behavior

When a TransactWriteItems transaction is canceled because a condition check fails, PolarDB and native DynamoDB behave differently.

Native DynamoDB attempts all operations and then returns the status of each one:

TransactionCanceledException: Transaction cancelled, please refer cancellation reasons for specific reasons [ConditionalCheckFailed, None, ConditionalCheckFailed]

PolarDB aborts immediately at the first failed operation and returns a single error:

ConditionalCheckFailedException: The conditional request failed

Update your error handling logic to account for this difference if your application inspects per-operation failure details.

UpdateItem: removing a non-existent nested attribute

When using REMOVE a.b to remove a nested attribute where the parent attribute a does not exist:

  • Native DynamoDB: returns an error.

  • PolarDB: silently succeeds and performs no operation.

Query and Scan: ScannedCount and Count

In PolarDB, ScannedCount and Count in the response always have the same value. PolarDB does not differentiate between the number of items scanned before and after a FilterExpression is applied. Native DynamoDB returns different values when a filter reduces the result set.

Error messages

Error messages for some operations may differ from those returned by native DynamoDB.

Detailed parameter support

The tables below list every request and response parameter for each supported API operation.

Column legend:

ValueMeaning
YesSupported
NoNot supported

The Remarks column explains the behavior for unsupported parameters: whether the parameter is silently ignored or causes the request to fail with an error.

CreateTable

API nameParameter typeParameter nameRequiredSupportedRemarks
CreateTableRequest parametersAttributeDefinitionsYesYes-
KeySchemaYesYes-
TableNameYesYes-
BillingModeNoNoIgnored if included in the request.
DeletionProtectionEnabledNoYes-
GlobalSecondaryIndexesNoYes-
LocalSecondaryIndexesNoYes-
OnDemandThroughputNoNoIgnored if included in the request.
ProvisionedThroughputNoYesIgnored if included in the request.
ResourcePolicyNoNoIgnored if included in the request.
SSESpecificationNoNoIgnored if included in the request. To enable encryption, use Set TDE.
StreamSpecificationNoNoIgnored if included in the request. For streaming replication, use Subscription Management.
TableClassNoNoIgnored if included in the request.
TagsNoNoIgnored if included in the request.
WarmThroughputNoNoIgnored if included in the request.
Response parametersTableDescription-Yes-

DescribeTable

API nameParameter typeParameter nameRequiredSupportedRemarks
DescribeTableRequest parametersTableNameYesYes-
Response parametersTable-Yes-

ListTables

API nameParameter typeParameter nameRequiredSupportedRemarks
ListTablesRequest parametersExclusiveStartTableNameNoYes-
LimitNoYes-
Response parametersLastEvaluatedTableName-Yes-
TableNames-Yes-

UpdateTable

API nameParameter typeParameter nameRequiredSupportedRemarks
UpdateTableRequest parametersTableNameYesYes-
AttributeDefinitionsNoYes-
BillingModeNoNoIgnored if included in the request.
DeletionProtectionEnabledNoYes-
GlobalSecondaryIndexUpdatesNoYesThis is a synchronous operation. Perform it during off-peak business hours.
GlobalTableWitnessUpdatesNoNoAn error is reported if included in the request.
MultiRegionConsistencyNoNoAn error is reported if included in the request.
OnDemandThroughputNoNoIgnored if included in the request.
ProvisionedThroughputNoNoIgnored if included in the request.
ReplicaUpdatesNoNoAn error is reported if included in the request.
SSESpecificationNoNoIgnored if included in the request. To enable encryption, use Set TDE.
StreamSpecificationNoNoIgnored if included in the request. For streaming replication, use Subscription Management.
TableClassNoNoIgnored if included in the request.
WarmThroughputNoNoIgnored if included in the request.
Response parametersTableDescription-Yes-

DeleteTable

API nameParameter typeParameter nameRequiredSupportedRemarks
DeleteTableRequest parametersTableNameYesYes-
Response parametersTableDescription-Yes-

PutItem

API nameParameter typeParameter nameRequiredSupportedRemarks
PutItemRequest parametersItemYesYes-
TableNameYesYes-
ConditionalOperatorNoNoDeprecated. Use ConditionExpression.
ConditionExpressionNoYes-
ExpectedNoNoDeprecated. Use ConditionExpression.
ExpressionAttributeNamesNoYes-
ExpressionAttributeValuesNoYes-
ReturnConsumedCapacityNoYesBilling-related parameter. Ignored.
ReturnItemCollectionMetricsNoNoStatistics-related parameter. Not supported.
ReturnValuesNoYes-
ReturnValuesOnConditionCheckFailureNoYes-
Response parametersAttributes-Yes-
ConsumedCapacity-NoBilling-related parameter. Not returned.
ItemCollectionMetrics-NoStatistics-related parameter. Not returned.

UpdateItem

API nameParameter typeParameter nameRequiredSupportedRemarks
UpdateItemRequest parametersKeyYesYes-
TableNameYesYes-
AttributeUpdatesNoNoDeprecated. Use UpdateExpression.
ConditionalOperatorNoNoDeprecated. Use UpdateExpression.
ConditionExpressionNoYes-
ExpectedNoNoDeprecated. Use UpdateExpression.
ExpressionAttributeNamesNoYes-
ExpressionAttributeValuesNoYes-
ReturnConsumedCapacityNoYesBilling-related parameter. Ignored.
ReturnItemCollectionMetricsNoNoStatistics-related parameter. Not supported.
ReturnValuesNoYes-
ReturnValuesOnConditionCheckFailureNoYes-
UpdateExpressionNoYes-
Response parametersAttributes-Yes-
ConsumedCapacity-NoBilling-related parameter. Not returned.
ItemCollectionMetrics-NoStatistics-related parameter. Not returned.

GetItem

API nameParameter typeParameter nameRequiredSupportedRemarks
GetItemRequest parametersKeyYesYes-
TableNameYesYes-
AttributesToGetNoNoDeprecated. Use ProjectionExpression.
ConsistentReadNoNoCan only be set to false. Configure the consistency level at the endpoint.
ExpressionAttributeNamesNoYes-
ProjectionExpressionNoYes-
ReturnConsumedCapacityNoYesBilling-related parameter. Ignored.
Response parametersConsumedCapacity-NoBilling-related parameter. Not returned.
Item-Yes-

DeleteItem

API nameParameter typeParameter nameRequiredSupportedRemarks
DeleteItemRequest parametersKeyYesYes-
TableNameYesYes-
ConditionalOperatorNoNoDeprecated. Use ConditionExpression.
ConditionExpressionNoYes-
ExpectedNoNoDeprecated. Use ConditionExpression.
ExpressionAttributeNamesNoYes-
ExpressionAttributeValuesNoYes-
ReturnConsumedCapacityNoYesBilling-related parameter. Ignored.
ReturnItemCollectionMetricsNoNoStatistics-related parameter. Not supported.
ReturnValuesNoYes-
ReturnValuesOnConditionCheckFailureNoYes-
Response parametersAttributes-Yes-
ConsumedCapacity-NoBilling-related parameter. Not returned.
ItemCollectionMetrics-NoStatistics-related parameter. Not returned.

BatchWriteItem

API nameParameter typeParameter nameRequiredSupportedRemarks
BatchWriteItemRequest parametersRequestItemsYesYes-
ReturnConsumedCapacityNoNoBilling-related parameter. Ignored.
ReturnItemCollectionMetricsNoNoStatistics-related parameter. Not supported.
Response parametersConsumedCapacity-NoBilling-related parameter. Not returned.
ItemCollectionMetrics-NoStatistics-related parameter. Not returned.
UnprocessedItems-YesBehavior differs from native DynamoDB. Always empty. See Atomicity in batch operations.
ParameterSecondary parameterTertiary parameterRequiredSupportedRemarks
RequestItemsDeleteRequestKeyYesYes-
PutRequestItemYesYes-

BatchGetItem

API nameParameter typeParameter nameRequiredSupportedRemarks
BatchGetItemRequest parametersRequestItemsYesYes-
ReturnConsumedCapacityNoNoBilling-related parameter. Ignored.
Response parametersConsumedCapacity-NoBilling-related parameter. Not returned.
Responses-Yes-
UnprocessedKeys-YesBehavior differs from native DynamoDB. Always empty. See Atomicity in batch operations.
ParameterSecondary parameterRequiredSupportedRemarks
RequestItemsConsistentReadNoYes-
ExpressionAttributeNamesNoYes-
KeysYesYes-
ProjectionExpressionNoYes-
AttributesToGetNoNoDeprecated. Use ProjectionExpression. An error is reported if included in the request.

Query

API nameParameter typeParameter nameRequiredSupportedRemarks
QueryRequest parametersTableNameYesYes-
AttributesToGetNoNoDeprecated. Use ProjectionExpression.
ConditionalOperatorNoNoDeprecated. Use FilterExpression.
ConsistentReadNoNoCan only be set to false. Configure the consistency level at the endpoint.
ExclusiveStartKeyNoYes-
ExpressionAttributeNamesNoYes-
ExpressionAttributeValuesNoYes-
FilterExpressionNoYes-
IndexNameNoYes-
KeyConditionExpressionNoYes-
KeyConditionsNoNoDeprecated. Use KeyConditionExpression.
LimitNoYes-
ProjectionExpressionNoYes-
QueryFilterNoNoDeprecated. Use FilterExpression.
ReturnConsumedCapacityNoNoBilling-related parameter. Ignored.
ScanIndexForwardNoYes-
SelectNoYes-
Response parametersConsumedCapacity-NoBilling-related parameter. Not returned.
Count-YesBehavior differs. Always equals ScannedCount.
Items-Yes-
LastEvaluatedKey-Yes-
ScannedCount-Yes-

Scan

API nameParameter typeParameter nameRequiredSupportedRemarks
ScanRequest parametersTableNameYesYes-
AttributesToGetNoNoDeprecated. Use ProjectionExpression.
ConditionalOperatorNoNoDeprecated. Use FilterExpression.
ConsistentReadNoNoCan only be set to false. Configure the consistency level at the endpoint.
ExclusiveStartKeyNoYes-
ExpressionAttributeNamesNoYes-
ExpressionAttributeValuesNoYes-
FilterExpressionNoYes-
IndexNameNoYes-
LimitNoYes-
ProjectionExpressionNoYes-
ReturnConsumedCapacityNoNoBilling-related parameter. Ignored.
ScanFilterNoNoDeprecated. Use FilterExpression.
SegmentNoNoNot supported. An error is reported if included in the request.
SelectNoYes-
TotalSegmentsNoYes-
Response parametersConsumedCapacity-NoBilling-related parameter. Not returned.
Count-YesBehavior differs. Always equals ScannedCount.
Items-Yes-
LastEvaluatedKey-Yes-
ScannedCount-Yes-

TransactWriteItems

API nameParameter typeParameter nameRequiredSupportedRemarks
TransactWriteItemsRequest parametersTransactItemsYesYes-
ClientRequestTokenNoYes-
ReturnConsumedCapacityNoYesBilling-related parameter. Ignored.
ReturnItemCollectionMetricsNoNoStatistics-related parameter. Not supported.
Response parametersConsumedCapacity-NoBilling-related parameter. Not returned.
ItemCollectionMetrics-NoStatistics-related parameter. Not returned.
ParameterSecondary parameterRequiredSupportedRemarks
TransactItemsConditionCheckNoYes-
PutNoYes-
UpdateNoYes-
DeleteNoYes-

TransactGetItems

API nameParameter typeParameter nameRequiredSupportedRemarks
TransactGetItemsRequest parametersTransactItemsYesYes-
ReturnConsumedCapacityNoYesBilling-related parameter. Ignored.
Response parametersConsumedCapacity-NoBilling-related parameter. Not returned.
Responses-Yes-

DescribeTimeToLive

API nameParameter typeParameter nameRequiredSupportedRemarks
DescribeTimeToLiveRequest parametersTableNameYesYes-
Response parametersTimeToLiveDescription-Yes-

UpdateTimeToLive

API nameParameter typeParameter nameRequiredSupportedRemarks
UpdateTimeToLiveRequest parametersTableNameYesYes-
TimeToLiveSpecificationYesYes-
Response parametersTimeToLiveSpecification-Yes-
ParameterSecondary parameterRequiredSupportedRemarks
TimeToLiveSpecificationAttributeNameYesYes-
EnabledYesYes-