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: 
I've had the same problem and created a small web service just for this purpose. See this blog post, that explains how I'm using [stateful.co](http://www.stateful.co) with DynamoDB in order to simulate auto-increment functionality: <http://www.yegor256.com/2014/05/18/cloud-autoincrement-counters.html>

Basically, you register an atomic counter at [stateful.co](http://www.stateful.co) and increment it every time you need a new value, through RESTful API. The service is free.
Incase you are using NoSQL DynamoDB then using Dynamoose ORM, you can easily set default unique id. Here is the simple user creation example

// User.modal.js

```
const dynamoose = require("dynamoose");

const userSchema = new dynamoose.Schema(
  {
    id: {
      type: String,
      hashKey: true,
    },
    displayName: String,
    firstName: String,
    lastName: String,
  },
  { timestamps: true },
);

const User = dynamoose.model("User", userSchema);

module.exports = User;

```

// User.controller.js

```
const { v4: uuidv4 } = require("uuid");    
const User = require("./user.model");

exports.create = async (req, res) => {
  const user = new User({ id: uuidv4(), ...req.body }); // set unique id
  const [err, response] = await to(user.save());
  if (err) {
    return badRes(res, err);
  }
  return goodRes(res, reponse);
};

```