How to assign foreignkey in DynamoDB?

DynamoDB does not have foreign keys. It is a NoSQL database that doesn't support that kind of relational data. There is no data integrity maintained between tables, so this sort of behavior is not built in. If you want to have this sort of behavior, you will have to model your data storage in DynamoDB a different way.

From the FAQ explaining that it is not a relational database:

While Amazon DynamoDB tackles the core problems of database scalability, management, performance, and reliability, it does not have all the functionality of a relational database. It does not support complex relational queries (e.g. joins) or complex transactions. If your workload requires this functionality, or you are looking for compatibility with an existing relational engine, you may wish to run a relational engine on Amazon RDS or Amazon EC2. While relational database engines provide robust features and functionality, scaling a workload beyond a single relational database instance is highly complex and requires significant time and expertise.


Dynomodb does not have foreign keys. Dynomodb is non-relational database, but it contains tables .