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.
Create the new `file.js` and put this code:

```
exports.guid = function () {
    function _p8(s) {
        var p = (Math.random().toString(16)+"000000000").substr(2,8);
        return s ? "-" + p.substr(0,4) + "-" + p.substr(4,4) : p ;
    }
    return (_p8() + _p8(true) + _p8(true)+new Date().toISOString().slice(0,10)).replace(/-/g,"");
}

```

Then you can apply this function to the primary key id. It will generate the UUID.