Question: In my db scheme, I need a autoincrement primary key. How I can realize this feature? 

PS For access to DynamoDB, I use [dynode](https://github.com/Wantworthy/dynode), module for Node.js.

Answer: 
*Addition to @yadutaf's answer*

AWS supports [Atomic Counters](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html#WorkingWithItems.AtomicCounters).

Create a separate table (`order_id`) with a row holding the latest order\_number:

```
+----+--------------+
| id | order_number |
+----+--------------+
|  0 |         5000 |
+----+--------------+

```

This will allow to increment order\_number by `1` and get the incremented result in a callback from AWS DynamoDB:

```
config={
  region: 'us-east-1',
  endpoint: "http://localhost:8000"
};
const docClient = new AWS.DynamoDB.DocumentClient(config); 

let param = {
            TableName: 'order_id',
            Key: {
                "id": 0
            },
            UpdateExpression: "set order_number = order_number + :val",
            ExpressionAttributeValues:{
                ":val": 1
            },
            ReturnValues: "UPDATED_NEW"
        };

docClient.update(params, function(err, data) {
   if (err) {
                console.log("Unable to update the table. Error JSON:", JSON.stringify(err, null, 2));
   } else {
                console.log(data);
                console.log(data.Attributes.order_number); // <= here is our incremented result
    }
  });

```

 Be aware that in some *rare* cases their might be problems with the connection between your caller point and AWS API. It will result in the dynamodb row being incremented, while you will get a connection error. Thus, there might appear some unused incremented values.

You can use incremented `data.Attributes.order_number` in your table, e.g. to insert `{id: data.Attributes.order_number, otherfields:{}}` into `order` table.
Auto Increment is not good from performance perspective as it will overload specific shards while keeping others idle, It doesn't make even distribution if you're storing data to Dynamodb.

`awsRequestId` looks like its actually V.4 UUID (Random), code snippet below to try it: 

```
exports.handler = function(event, context, callback) {
    console.log('remaining time =', context.getRemainingTimeInMillis());
    console.log('functionName =', context.functionName);
    console.log('AWSrequestID =', context.awsRequestId);
    callback(null, context.functionName);
};

```

In case you want to generate this yourself, you can use <https://www.npmjs.com/package/uuid> or [Ulide](https://github.com/ulid/javascript) to generate different versions of UUID based on [RFC-4122](http://www.ietf.org/rfc/rfc4122.txt) 

* V1 (timestamp based)
* V3 (Namespace)
* V4 (Random)

For Go developers, you can use these packages from [Google's UUID](https://github.com/google/uuid), [Pborman](https://github.com/pborman/uuid), or [Satori](https://github.com/satori/go.uuid). Pborman is better in performance, check these [articles and benchmarks](http://antoniomo.com/blog/2017/05/28/unique-ids-in-golang-part-2/) for more details. 

More Info on Universal Unique Identifier Specification could be found [here](https://en.m.wikipedia.org/wiki/Universally_unique_identifier).