Updated on 2024-10-30 GMT+08:00

API Compatibility

This section describes GeminiDB DynamoDB APIs and precautions.

Precautions

  • GeminiDB DynamoDB API allows you to add, delete, and modify tables only through DynamoDB APIs. Tables can only be read on the console.
  • Tables created through non-DynamoDB APIs cannot be used on GeminiDB DynamoDB instances.
  • In the current version, traffic statistics, traffic limit, and transaction functions (TransactWriteItems and TransactGetItems) are not supported.
  • In the current version, on-demand backup APIs CreateBackup, DescribeBackup, DeleteBackup, ListBackups, and RestoreTableFromBackup are not supported.
  • Hash or partition keys determine where items are stored in an internal storage device of a GeminiDB DynamoDB instance. Amazon DynamoDB uses a dedicated hash function, while GeminiDB DynamoDB API uses the Murmur3 algorithm. As a result, the sequence of data returned by a scan operation is different.
  • A load balancing plug-in evenly sends requests from applications to all nodes. If this plug-in is not used, requests are sent only to a specified endpoint address. To obtain the load balancing plug-in code package, contact customer service of GeminiDB DynamoDB API.
  • The table or index name cannot contain periods (.).
  • Due to different encoding methods, the size of each row of data in a table on a GeminiDB DynamoDB instance is not strictly limited to 400 KB.
  • All DDL APIs are synchronous APIs.

Load Balancing

DynamoDB applications typically connect to a URL and then distribute requests within a server. To evenly distribute requests of GeminiDB DynamoDB API to all nodes, a cost-effective and small-capacity database is attached to DynamoDB SDK. Before DynamoDB SDK sends requests, an interceptor changes the destination address in the request header to an IP address of any available node in the current cluster to achieve load balancing. The following is an example:

TABLE_NAME ='user'

// seed url
URL = boto3_lb.setup(['***.***.***.***'],'http',8000,'fake.domain.com')

dynamodb = boto3.resource('dynamodb', endpoint_url=URL,region_name='None', aws_access_key_id='None', aws_secret_access_key='None')

Supported Expressions

GeminiDB DynamoDB ConditionExpression supports the following function syntax:

function ::=
    attribute_exists (path)
    | attribute_not_exists (path)
    | attribute_type (path, type)
    | begins_with (path, substr)
    | contains (path, operand)
The value of operand in contains(path,operand) can only be an attribute value (that is, the input value placeholder).

GeminiDB DynamoDB UpdateExpression supports the following function syntax:

update-expression ::=
     [ SET action [, action] ... ]
     [ REMOVE action [, action] ...]
     [ ADD action [, action] ... ]
     [ DELETE action [, action] ...]

 set-action ::=
     path =value

 value ::=
     operand
     | operand '+' operand
     | operand '-' operand

 operand ::=
     path | function

 function ::=
     if_not_exists (path, value)
     | list_append (list1, list2)

 remove-action ::=
     path

 add-action ::=
     path value

 delete-action ::=
     path value
In the SET path = operand syntax, the value of operand cannot be set to path.
In the SET path = operand1 '+'|'-' operand2 syntax, the value of operand1 must be set to path, and the value of operand2 must be an attribute value.
In the SET path = if_not_exists (path, value) syntax, values of the two path parameters must be the same, and the values must be expression attribute values.
All values can only be placeholder expressions, for example, :placeholder.

Compatible APIs

Table 2 CreateTable API Compatibility

API

Parameter

Mandatory

Supported

Description

CreateTable

Request parameters

AttributeDefinitions

Yes

Yes

-

KeySchema

Yes

Yes

-

TableName

Yes

Yes

The value contains 3 to 48 characters. The regular expression is ([\w-]+).

BillingMode

No

No

Billing parameter, which is not supported.

GlobalSecondaryIndexes

No

Yes

-

LocalSecondaryIndexes

No

Yes

-

ProvisionedThroughput

No

Yes

-

SSESpecification

No

No

This parameter is not supported in the current version and is being planned.

StreamSpecification

No

No

This parameter is not supported in the current version and is being planned.

Tags

No

No

This parameter is not supported in the current version and is being planned.

Response parameter

TableDescription

-

Yes

-

Table 3 UpdateTable API Compatibility

API

Parameter

Mandatory

Supported

Description

UpdateTable

Request parameters

AttributeDefinitions

No

Yes

-

BillingMode

No

No

Billing parameter, which is not supported.

GlobalSecondaryIndexesUpdates

Yes

Yes

CREATE and DELETE statements are supported. UPDATE statements are not supported.

ProvisionedThroughput

No

No

Billing parameter, which is not supported.

ReplicaUpdates

No

No

Strong consistency parameter by default

SSESpecification

No

No

This parameter is not supported in the current version and is being planned.

StreamSpecification

No

No

This parameter is not supported in the current version and is being planned.

TableName

Yes

Yes

-

Response parameter

TableDescription

-

Yes

-

Table 4 DescribeTable API Compatibility

API

Parameter

Mandatory

Supported

Description

DescribeTable

Request parameter

TableName

Yes

Yes

-

Response parameter

Table

-

Yes

The itemCount field is not supported.

Table 5 ListTables API Compatibility

API

Parameter

Mandatory

Supported

Description

ListTables

Request parameters

ExclusiveStartTableName

No

Yes

-

Limit

No

Yes

-

Response parameters

LastEvaluatedTableName

-

Yes

-

TableNames

-

Yes

-

Table 6 DeleteTable API Compatibility

API

Parameter

Mandatory

Supported

Description

DeleteTable

Request parameter

TableName

Yes

Yes

-

Response parameter

TableDescription

-

Yes

-

Table 7 PutItem API Compatibility

API

Parameter

Mandatory

Supported

Description

PutItem

Request parameters

Item

Yes

Yes

-

TableName

Yes

Yes

-

ConditionalOperator

No

No

Deprecated parameter. For details, see ConditionExpression.

ConditionExpression

No

Yes

-

Expected

No

No

Deprecated parameter. For details, see ConditionExpression in this API.

ExpressionAttributeNames

No

Yes

-

ExpressionAttributeValues

No

Yes

-

ReturnConsumedCapacity

No

No

Billing parameter, which is not supported.

ReturnItemCollectionMetrics

No

No

Statistics parameter, which is not supported.

ReturnValues

No

Yes

-

Response parameters

Attributes

-

Yes

-

ConsumedCapacity

-

No

Billing parameter, which is not supported.

ItemCollectionMetrics

-

No

Statistics parameter, which is not supported.

Table 8 UpdateItem API Compatibility

API

Parameter

Mandatory

Supported

Description

UpdateItem

Request parameters

Key

Yes

Yes

-

TableName

Yes

Yes

-

AttributeUpdates

No

No

Deprecated parameter. For details, see UpdateExpression in this API.

ConditionalOperator

No

No

Deprecated parameter. For details, see UpdateExpression in this API.

ConditionExpression

No

Yes

-

Expected

No

No

Deprecated parameter. For details, see UpdateExpression in this API.

ExpressionAttributeNames

No

Yes

-

ExpressionAttributeValues

No

Yes

-

ReturnConsumedCapacity

No

No

Billing parameter, which is not supported.

ReturnItemCollectionMetrics

No

No

Statistics parameter, which is not supported.

ReturnValues

No

Yes

-

UpdateExpression

No

Yes

-

Response parameters

Attributes

-

Yes

-

ConsumedCapacity

-

No

Billing parameter, which is not supported.

ItemCollectionMetrics

-

No

Statistics parameter, which is not supported.

Table 9 GetItem API Compatibility

API

Parameter

Mandatory

Supported

Description

GetItem

Request parameters

Key

Yes

Yes

-

TableName

Yes

Yes

-

AttributesToGet

No

No

Deprecated parameter. For details, see ProjectionExpression in this API.

ConsistentRead

No

No

Strong consistency parameter by default

ExpressionAttributeNames

No

Yes

-

ProjectionExpression

No

Yes

-

ReturnConsumedCapacity

No

No

Billing parameter, which is not supported.

Response parameters

ConsumedCapacity

-

No

Billing parameter, which is not supported.

Item

-

Yes

-

Table 10 DeleteItem API Compatibility

API

Parameter

Mandatory

Supported

Description

DeleteItem

Request parameters

Key

Yes

Yes

-

TableName

Yes

Yes

-

ConditionalOperator

No

No

Deprecated parameter. For details, see ConditionExpression in this API.

ConditionExpression

No

Yes

-

Expected

No

No

Deprecated parameter. For details, see ConditionExpression in this API.

ExpressionAttributeNames

No

Yes

-

ExpressionAttributeValues

No

Yes

-

ReturnConsumedCapacity

No

No

Billing parameter, which is not supported.

ReturnItemCollectionMetrics

No

No

Statistics parameter, which is not supported.

ReturnValues

No

Yes

-

Response parameters

Attributes

-

Yes

-

ConsumedCapacity

-

No

Billing parameter, which is not supported.

ItemCollectionMetrics

-

No

Statistics parameter, which is not supported.

Table 11 BatchWriteItem API Compatibility

API

Parameter

Mandatory

Supported

Description

BatchWriteItem

Request parameters

RequestItems

Yes

Yes

-

ReturnConsumedCapacity

No

No

Billing parameter, which is not supported.

ReturnItemCollectionMetrics

No

No

Statistics parameter, which is not supported.

Response parameters

ConsumedCapacity

-

No

Billing parameter, which is not supported.

ItemCollectionMetrics

-

No

Statistics parameter, which is not supported.

UnprocessedItems

-

Yes

-

Table 12 BatchGetItem API Compatibility

API

Parameter

Mandatory

Supported

Description

BatchGetItem

Request parameters

RequestItems

Yes

Yes

None

ReturnConsumedCapacity

No

No

Billing parameter, which is not supported.

Response parameters

ConsumedCapacity

-

No

Statistics parameter, which is not supported.

Responses

-

Yes

-

UnprocessedKeys

-

Yes

-

Table 13 Query API Compatibility

API

Parameter

Mandatory

Supported

Description

Query

Request parameters

TableName

Yes

Yes

-

AttributesToGet

No

No

Deprecated parameter. For details, see ProjectionExpression in this API.

ConditionalOperator

No

No

Deprecated parameter. For details, see ProjectionExpression in this API.

ConsistentRead

No

No

Strong consistency parameter by default

ExclusiveStartKey

No

Yes

-

ExpressionAttributeNames

No

Yes

-

ExpressionAttributeValues

No

Yes

-

FilterExpression

No

Yes

-

IndexName

No

Yes

-

KeyConditionExpression

No

Yes

-

KeyConditions

No

No

Deprecated parameter. For details, see KeyConditionExpression in this API.

Limit

No

Yes

-

ProjectionExpression

No

Yes

-

QueryFilter

No

No

Deprecated parameter. For details, see FilterExpression in this API.

ReturnConsumedCapacity

No

No

Billing parameter, which is not supported.

ScanIndexForward

No

Yes

-

Select

No

Yes

SELECT COUNT is not supported.

Response parameters

ConsumedCapacity

-

No

Billing parameter, which is not supported.

Count

-

Yes

-

Items

-

Yes

-

LastEvaluatedKey

-

Yes

-

ScannedCount

-

Yes

-

Table 14 Scan API Compatibility

API

Parameter

Mandatory

Supported

Description

Scan

Request parameters

TableName

Yes

Yes

-

AttributesToGet

No

No

Deprecated parameter. For details, see ProjectionExpression in this API.

ConditionalOperator

No

No

Deprecated parameter. For details, see ConditionExpression in this API.

ConsistentRead

No

No

Strong consistency parameter by default

ExclusiveStartKey

No

Yes

-

ExpressionAttributeNames

No

Yes

-

ExpressionAttributeValues

No

Yes

-

FilterExpression

No

Yes

-

IndexName

No

Yes

-

Limit

No

Yes

-

ProjectionExpression

No

Yes

-

ReturnConsumedCapacity

No

No

Billing parameter, which is not supported.

ScanFilter

No

No

Deprecated parameter. For details, see FilterExpression in this API.

Segment

No

Yes

-

Select

No

Yes

SELECT COUNT is not supported.

TotalSegments

No

Yes

-

Response parameters

ConsumedCapacity

No

No

Billing parameter, which is not supported.

Count

-

Yes

-

Items

-

Yes

-

LastEvaluatedKey

-

Yes

-

ScannedCount

-

Yes

-

Table 15 UpdateTimeToLive API Compatibility

API

Parameter

Mandatory

Supported

Description

UpdateTimeToLive

Request parameters

TableName

Yes

Yes

-

TimeToLiveSpecification

Yes

Yes

-

Response parameter

TimeToLiveSpecification

-

Yes

-