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).
For those coding in Java, [DynamoDBMapper](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBMapper.html) can now generate unique UUIDs on your behalf.

> 
> DynamoDBAutoGeneratedKey
> 
> 
> Marks a partition key or sort key property as being auto-generated.
>  DynamoDBMapper will generate a random UUID when saving these
>  attributes. Only String properties can be marked as auto-generated
>  keys.
> 
> 
> 

Use the [DynamoDBAutoGeneratedKey](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBMapper.Annotations.html) annotation like this

```
@DynamoDBTable(tableName="AutoGeneratedKeysExample")
public class AutoGeneratedKeys { 
    private String id;

    @DynamoDBHashKey(attributeName = "Id")
    @DynamoDBAutoGeneratedKey
    public String getId() { return id; }
    public void setId(String id) { this.id = id; } 

```

As you can see in the example above, you can apply both the DynamoDBAutoGeneratedKey and DynamoDBHashKey annotation to the same attribute to generate a unique hash key.