Alex DeBrie writes about AWS, especially DynamoDB data modeling, single-table design, and API Gateway.
HN commenters point to his single-table design article as the main reference for DynamoDB data modeling and recommend it to people designing similar databases.
Stopped reading when this guy started talking about Single Table DDB being best practice and linking to AWS when he clearly did zero research on AWS recommendations with GraphQL including from the AWS Hero Alex Debrie he mentions:
https://www.alexdebrie.com/posts/dynamodb-graphql/
https://aws.amazon.com/blogs/mobile/single-table-vs-multi-table-dynamodb-appsync/
https://aws.amazon.com/blogs/mobile/enhancing-dynamodb-single-table-design-with-appsync-access-and-security-features/
Also he mentions the race condition around clients connecting to the backend between queries and mutations, then in the same breath says the DataStore client handles this but also it's mistake is being reliant on Subscriptions? This contradiction doesn't make sense.
There are some legit bugs in this article though that I've seen, like that Analytics one. It's really a Pinpoint issue though when you dig under the covers that I've been waiting for them to solve for years.
> It's just odd to me that I had to make this change in the first place. I wonder how many millions of dollars AWS is raking in just because devs are unaware of things like that.
AWS documentation very clearly outlines the behavior of a query and a scan. The internet is full of guides [1][2] on how to model your data so you utilize queries vs. scans.
If the developers at your company misuse a product, and aren't aware of these features when does personal responsibility come in? How is AWS as a platform suppose to discern that the trade-off with a GSI is what you want, and how is this scenario not generalized to every product? People misuse SQL databases all the time, for example.
1 - https://www.alexdebrie.com/posts/dynamodb-single-table/
2 - https://www.sensedeep.com/blog/posts/2021/dynamodb-singletable-design.html
If anyone's looking for an open-source search tool for grepping across repos (or even one large repo) at insane speed, I highly recommend livegrep:
https://github.com/livegrep/livegrep
Demo at https://livegrep.com/search/linux
We used it at Stripe and it was quite popular; often, searching even a single repo was faster on livegrep than with ripgrep locally.
A post reviewing it: https://www.alexdebrie.com/posts/faster-code-search-livegrep/
A post by its creator, nelhage, on its impact: https://blog.nelhage.com/post/reflections-on-performance/ and another on its architecture: https://blog.nelhage.com/2015/02/regular-expression-search-with-suffix-arrays/
No2SQL is just physically implementing a normalized logical model on a NoSQL database instead of an RDBMS. That can be done with classes, methods, and attributes (OOP) providing RDBMS functionality like constraints and data types.
In DynamoDB you can use a single table model [1] to construct collections, which are similar to joins. The partition key is like a foreign key in an RDBMS. The sort key is like a combination of the normalized table identifier and primary key.
All of this can be as transparent to the business logic as it is in an RDBMS.
[1]: https://www.alexdebrie.com/posts/dynamodb-single-table/
Thank you! Glad you found DynamoDBGuide.com helpful :)
Yep, I do talk about aggregations in the book. One strategy that I've discussed is available in a blog post here[0] and involves using DynamoDB Transactions to handle aggregates.
If you're looking for large-scale aggregates for analytics (e.g. "What are my top-selling items last month?"), I have an Analytics supplement in the Plus package that includes notes on different patterns for analytics w/ DynamoDB.
Let me know if that helps!
[0] - https://www.alexdebrie.com/posts/dynamodb-transactions/#handling-counts-and-preventing-duplicates
Your example itself shows why you would not want to do this. The database still has to read through all the rows up to the OFFSET point...
You are not supposed to do the same query patterns. My argument is that you can substitute your relational database, by changing the app and the layout of the data to match the proper patterns for DynamoDB.
"Migrating to DynamoDB from a relational database" - https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/migration-guide.html
""How to model one-to-many relationships in DynamoDB" - https://www.alexdebrie.com/posts/dynamodb-one-to-many/