Hey, thanks for the video; it's very helpful! I have a question regarding the order and order items and the way you modeled them in DynamoDB. I understand the reason for moving orderItem to a different partition key, as you don't need to fetch all order items when fetching a customer with orders. But why did you use the following partition key (PK) for the order item: ORDER##ITEM#, and not just create a PK with ORDER# and two sort keys (SK) with ITEM#? For example, instead of this PK: ORDER#1#ITEM#1, SK:ORDER#1#ITEM#1, , GSI1PK: ORDER#1, GSI1SK: ITEM#1 PK: ORDER#1#ITEM#2, SK: ORDER#1#ITEM#2, , GSI1PK: ORDER#1, GSI1SK: ITEM#2 do this PK: ORDER#1 SK: ITEM#1, , GSI1PK: ORDER#1, GSI1SK: ITEM#1 PK: ORDER#1 SK: ITEM#2, , GSI1PK: ORDER#1, GSI1SK: ITEM#2
@emcohz8 ай бұрын
I also have the same question!
@albintsafack12325 ай бұрын
Thank's for this tutorial. please what if we need the list of all customers ?
@alexbdebrie5 ай бұрын
Good question! DynamoDB excels at OLTP-like queries where you're operating on a specific, limited number of rows -- create an Order for this Customer, or view the 10 most recent Orders for this Customer. These queries partition well and are narrowly focused based on fixed parameteres. DynamoDB is not as good at 'table-wide queries', such as 'Give me all the Customers in my application'. There are some ways to do that, but it's tricky. It's usually best done in an OLAP database (if used for internal analytics) or something else like ElasticSearch
@ced42983 жыл бұрын
Love the Air Force 1s and 2s examples!
@alexbdebrie3 жыл бұрын
Haha, you know it
@MauNunes8 ай бұрын
This video is amazing, however I've been trying to implement this code using Java Spring Boot but I don't know how could I implement this transaction to display the message 'Customer with this username already exists.' and 'Customer with this email already exists'. In my implementation if i send the same username and email nothing happended.
@andresm90513 жыл бұрын
Great video, how to handle the same order for mutiples entries in dynamodb, like PK = store#id, SK=order#id and customer in your example customer#id, SK=order#id because store and customer will share the same order, how to handle it, to avoid duplication data and unneeded WUC consume? thanks a lot.
@rickfarina98354 жыл бұрын
Hi Alex, Awesome Content!! I have 2 questions. 1. Will you be adding the additional examples from the DynamoDB Book (I only see 3 videos currently)? 2. Are you making the node.js code available? :) Thanks Alex
@alexbdebrie4 жыл бұрын
Thanks, Rick! These videos are just a preview of what you get in The DynamoDB Book. If you want all the videos, they are included in the Premium package of the book. Likewise, the Node.js code for all 5 examples in the book is available in both the Plus and the Premium packages.
@rickfarina98354 жыл бұрын
@@alexbdebrie Hi Alex and thanks for getting back... I did eventually figure that out and purchased the full package :)
@cafeconlechecodes2 жыл бұрын
Hi, Alex. I'm starting to learn AWS and your videos and writing is helping me to better understand the DB on AWS. Do you recommend to use the Single-Table design for apps made with AWS Amplify?
@alexbdebrie2 жыл бұрын
Great to hear! I generally recommend a similar philosophy with GraphQL. It can add complexity to your resolvers but will be more performant. That said, I've seen many folks that have opted to use more isolated resolvers and a waterfall strategy for resolving a big graph in a GraphQL query, and that can work as well.
@shailendraacharya3 жыл бұрын
Hi Alex these are great content and i have gone through almost all of your videos. We have a use case where we have to retrieve all customers or all orders. But whatever i have seen there we have customer or order as pk or sk. To serve this use case we have to scan whole table which is not a good idea. is there anyway to do that ?
@alexbdebrie3 жыл бұрын
Hey there, it's a good question and one I get a lot. I need to write up the different options on these. It's tricky because you can give them the same partition key in a secondary index, but that can often result in a hot partition that hits partition throughput limits. What is the use case for this? Is this a production, user-facing use case, or more for internal processing?
@shailendraacharya3 жыл бұрын
@@alexbdebrie we are designing it for production from scratch and we had seperate table earlier but now we moving on single table design. We are able to cover almost all use cases but this get all customer, get all orders and there sub tasks are difficult to approach. It would be really great if you can put some light on this. Thanks you so much alex for your prompt reply btw
@alexbdebrie3 жыл бұрын
@@shailendraacharya I probably won't have a blog post in the next week or so. If you send me an email (alexdebrie1@gmail.com) and tell me the basic overview, I can point you in the right direction.
@shailendraacharya3 жыл бұрын
@@alexbdebrie thank you so much alex and I really appreciate your prompt response for helping me in design db. I will write you email today with all details.
@shailendraacharya3 жыл бұрын
@@alexbdebrie I have sent email with all details.
@abhishek.26nov4 жыл бұрын
Thanks Alex, enjoyed this and your talk at reInvent 2019. I have a question. In this example you have created GSI1PK, and GSI1SK, while in your talk at reInvent for a similar example, you used inverted index (swapping PK and SK). Is there any particular reason for indexing of separate fields here?
@alexbdebrie4 жыл бұрын
Good question! I changed my mind on that as I went. I almost never recommend re-using attributes across indexes anymore. In my opinion, it causes more headache than it's worth. If you're using overloaded primary keys and indexes, it's too hard to make sure they overlap correctly when you're re-using them. It also limits your flexibility if you need to add additional access patterns in the future. Stick with the pattern in this video, rather than the re:Invent one :)
@alakdam39703 жыл бұрын
Thanks Alex. Wish I could see more tutorial like this :D because I can't afford your book 🙈
@alexbdebrie3 жыл бұрын
Hey Alak! Glad you liked it. Email me about the book, and we'll work something out :)
@alakdam39703 жыл бұрын
@@alexbdebrie Thank you replying on my comment. alakdam2004@gmail.com is my email account.
@oribrosh64582 жыл бұрын
Great video, source code??
@alexbdebrie2 жыл бұрын
Thanks, Ori! This is from The DynamoDB Book. You can get the source code with the Plus or Premium package, and this video (plus videos for all chapters) are available in the Premium Package. www.dynamodbbook.com/
@timidboy022 жыл бұрын
I wish he'd consider parity pricing for the book as it's too expensive in my currency. 🥺
@alexbdebrie2 жыл бұрын
Email me/ DM me on Twitter! I'm always happy to give a discount :)