The 7 DynamoDB sins
7 bad practices in DynamoDB and learning how to avoid them to build better, more scalable and efficient databases.
Over the past 7 days, I posted one "bad practice" (sin) that developers often make.
These were a mix of bad designs I had either seen or heard of, people doing.
I decided to talk about them and use them as a theme of the 7 deadly sins.
My previous 7 posts delved into the details of each bad practice and how to remedy it.
Here's the summary of the 7 DynamoDB sins:
1. Ignoring Partition key design (Pride)
Partition key design is perhaps the most important concept in DynamoDB, learn it well to design powerful databases.
Learn partition key design here:
https://aws.plainenglish.io/how-to-efficiently-model-your-data-with-amazon-dynamodb-bd5fef6ce96b
2. Querying without projection expressions (Greed)
Projection expressions allow you to get back only the attributes you need, making queries more efficient.
Learn projection expressions here:
https://towardsaws.com/how-dynamodb-projection-expressions-help-you-optimize-costs-and-performance-49c53397f903
3. Abusing Scans instead of queries (Lust)
Scans have their use cases, but most of the time you do not want to use them, use queries instead.
Learn about this here:
https://towardsaws.com/dynamodb-query-vs-scan-which-method-to-use-and-when-388133e86273
4. Mimicking relational database designs (Envy)
DynamoDB isn't a relational database and treating it as one, will highly degrade performance and efficiency, learn how it differs from SQL.
Learn about it here:
https://medium.com/aws-in-plain-english/the-5-most-common-mistakes-developers-make-in-dynamodb-1211c304d32e
5. Over provisioning read/write capacity (Gluttony)
Provisioning too much throughput capacity without right-sizing or understanding how much you need leads to waste and higher costs.
Learn how DynamoDB capacity works here:
https://medium.com/success-with-aws/aws-dynamodb-advanced-understanding-the-scaling-features-in-the-console-4f5d216bd2a1
6. Ignoring DynamoDB limitations (Wrath)
Like every tool, Dynamo has its limitations. Understanding these will help you enormously to design better and more efficient queries and tables.
Learn about Dynamo’s limitations here:
https://towardsaws.com/understanding-dynamodbs-limitations-to-design-better-databases-3c98e9aa3316
7. Neglecting to monitor (Sloth)
Monitoring your tables is critical for performance, costs and other metrics, don't set and forget your database, monitor it constantly for optimizations.
Learn about monitoring here:
https://towardsaws.com/5-ways-to-monitor-your-dynamodb-tables-like-a-pro-5a56073caae8
I hope these 7 bad practices have taught you a good deal about DynamoDB and some bad practices to avoid.
If you are curious and want to learn further, I suggest this blog to learn more about DynamoDB.
👋 My name is Uriel Bitton and I’m committed to helping you master Serverless, Cloud Computing, and AWS.
🚀 If you want to learn how to build serverless, scalable, and resilient applications, you can also follow me on Linkedin for valuable daily posts.
Thanks for reading and see you in the next one!