Member-only story
DynamoDB Data Modeling
5 Step guide to design your DynamoDB database.
As we all know, DynamoDB is a NoSQL database service offered by AWS that supports key-value and document data structures. Data modeling in DynamoDB is much different from traditional relational database systems. Since we are very familiar with relational modeling, most of the new users try to follow the same approach in DynamoDB and end up with a large AWS bill at the end. To avoid situations like this, we must always follow the best practices and recommended methods with DynamoDB. If you follow the correct steps you can achieve a millisecond's latencies at any scale of data for a cheap price. In this article, I will guide you through a 5 step process that will help you to model data for your application.
Best Practices to follow
As I mentioned earlier DynamoDB is a NoSQL database. But the specialty of this database system is the DynamoDB provides consistent performance at any scales and it guarantees milliseconds latency at any scale. Following best practices will help you to achieve this goal easily.
Forget about relational data modeling
If you are using DynamoDB please shift away from anything you know about relational data modeling and thinking. Consider this as a new separate approach and proceed. Don't fake a relational model in your DynamoDB model.
Identify the access patterns
You must identify almost all access patterns before table designing. It will be difficult to identify all the patterns at the beginning, but try to identify as much as possible.
One Table
In most cases, once you identify all access patterns you will feel that you just need only one table for your application. Amazon also insists on using one table for one application. This table will contain records for all your entities, which means all the data in a single table and this will lead you for efficient queries. This will also help you to reduce the bill as well.