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: 
Another approach is to use a `UUID` generator for primary keys, as these are *highly* unlikely to clash. 

IMO you are more likely to experience errors consolidating primary key counters across highly available `DynamoDB` tables than from clashes in generated `UUID`s.

For example, in Node:

`npm install uuid`

```
var uuid = require('uuid');

// Generate a v1 (time-based) id
uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'

// Generate a v4 (random) id
uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'

```

Taken from SO [answer](https://stackoverflow.com/a/23327039/410072).
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).