Fundamentals of Amazon DynamoDB Single Table Design with Rick Houlihan

Поділитися
Вставка
  • Опубліковано 11 вер 2024

КОМЕНТАРІ • 53

  • @StephenBlackstone
    @StephenBlackstone 3 роки тому +24

    For all the "talks" and whatever people do trying to get the big idea out, theres something nice about being able to just watch a guy use the tool and do it. This was extremely helpful

  • @shashank_rajak
    @shashank_rajak 2 роки тому +5

    So far the best video to understand single table design on dynamoDB, learnt a lot about this powerful db

  • @tejaschachcha
    @tejaschachcha 4 роки тому +15

    You have got an enviable workplace Rick. One of the best sessions for DynamoDb single table modelling.

    • @explorer-xe7rt
      @explorer-xe7rt 3 роки тому +16

      I assumed it was a background. The light on the face has cool colours, whereas the light in the background has warm colours.

  • @neaumusic
    @neaumusic 2 роки тому +6

    I really appreciate the workflow of writing the access patterns out and writing the model step by step. It’s really difficult to find design patterns for typical entity relationships, and this is extremely helpful. I’m still trying to figure out when a GSI/LSI is warranted, it seems like they make many to many relationships easy. It seems like Table/PK/SK are the only real hierarchies to index something, and if you needed to access it from the other direction you either need another index, duplicate/pointer nodes and multiple requests, or a scan. It seems dynamodb is really a cache for direct lookups and there are costs to maintain that cache for instant lookups.
    My current table model is to use an ID appended to sort keys so that I can use Queries, just haven’t seen this model anywhere and I’m trying to figure out if I’ll run into issues - EDIT it looks like Alex DeBrie’s single table design video shows this pattern around 53:00, exactly what I was thinking

  • @AS-zw4lk
    @AS-zw4lk 2 роки тому +7

    For a dolt like myself this video really helped me reason and make peace with my 'normalization' biased thinking. I still hate myself a little (for going to the dark side) but I am starting to see the advantages in single table design. Thank you for your efforts.

  • @ryunosukehayashi2654
    @ryunosukehayashi2654 2 роки тому +1

    I am japanese.I was impressed with this video.

  • @MrJ0Ker666
    @MrJ0Ker666 2 роки тому +1

    Excellent video for DynamoDb single table modeling. The presentation style was very interesting, loved it, thanks!

  • @AnonYTChannelName
    @AnonYTChannelName 6 місяців тому +1

    I'm curious about the ids for customer, product, warehouse, etc. How do we ensure there aren't id collisions across entities? Are these ids UUIDs and therefore all entities can take their ids from the same "stream" of generated ids, and we don't worry about separate sequences of ids for each entity?

  • @rishabhjain7781
    @rishabhjain7781 Рік тому +1

    My team has been delaying this because of the complexity. Now I know how to convince them step by step. Crack the entity relation ship and then the access pattern and then start modeling. Now see if the model satisfies the access pattern. Boom !! Thanks for this video.

  • @HaibertBuilds
    @HaibertBuilds Рік тому +2

    It was understandable in the first half, but got unclear real quick... thanks for the efforts still.

  • @the-dark-matter
    @the-dark-matter 6 місяців тому

    You are a GOD!!!!! Hands down, this is the best explanation out there!

  • @cloud_architector
    @cloud_architector 3 роки тому +1

    Thanks for your video, it's very helpful!! this topic is pretty complicated especially if you are from sql like me

  • @danixlt
    @danixlt 3 роки тому +13

    Would be great if you would share data model for Nosql workbench.

    • @rossenpetrov3705
      @rossenpetrov3705 3 роки тому +7

      The data model used is this:
      github.com/aws-samples/amazon-dynamodb-design-patterns/tree/master/examples/an-online-shop

  • @akashmaurya563
    @akashmaurya563 3 роки тому +7

    would you please give the workbench data model files

  • @shailendraacharya
    @shailendraacharya 2 роки тому +3

    I have seen almost all videos of ric and alex but there is a common use case related to get all data of a particular entity which is similar to select * from table. how should we approach that? if we keep it in a partition it can create a hot partition issue

  • @andreymashukov7576
    @andreymashukov7576 8 місяців тому

    00:05 Focus on single table design benefits
    01:52 Challenges with multi-table data model and large hierarchical documents.
    05:12 Understanding use case and data modeling for single table
    06:48 Entities include customers, products, orders, invoices, payments, warehouses, and shipments
    10:05 Decorating objects with attributes and indexing for efficient querying
    11:43 Designing the data model using NoSQL Workbench
    15:13 Implementing access patterns for querying DynamoDB tables.
    16:57 Iterating through result set and switching on object type for dynamic wrapping.
    20:09 Query table by product id and warehouse id
    21:43 Redesigning the data model to handle complex access patterns.
    24:47 Consider adding individual items to separate partitions for efficient indexing.
    26:28 Payments are added to orders and entered on the invoice item
    29:53 Using partitions in DynamoDB Single Table Design
    31:25 Consider consolidating related data into a single object when it makes sense.
    34:36 Creating a new index and adding index attributes to the data model
    36:20 Structuring data for different customer needs
    39:36 Querying GSI1 for different access patterns
    41:13 Iterating through shipments and updating status using secondary index
    44:26 Implementing Time To Live (TTL) for automatic data removal after a specified time period
    45:52 Different access patterns may require varied amounts of metadata, so it's important to design data models that minimize unnecessary data retrieval.
    49:18 Using selective prefixes for querying customer data in Amazon DynamoDB
    50:48 Understanding data reading and filtering in DynamoDB
    54:10 Efficient data modeling is essential for scaling systems and reducing inefficiency.
    55:46 Single table design model represents the design implemented thousands of times at Amazon and across the customer base.
    Crafted by Merlin AI.

  • @paracha3
    @paracha3 3 роки тому +1

    It took me at least two watches of this video to wrap my head around it

  • @thobiaskarlsson1698
    @thobiaskarlsson1698 2 роки тому

    Thank you Rick! Awesome stuff!

  • @huscachafe
    @huscachafe 3 роки тому +16

    Excellent ! 👏🏻 is it possible that you can share the files of this example in workbench? To see in local environment. Pls 🙌🏻🙏🏻

    • @localGhost
      @localGhost 3 роки тому +2

      This would be so wonderful! Please!

    • @dahooo2
      @dahooo2 3 роки тому

      Yes please it would be great

    • @saurabhshri
      @saurabhshri 3 роки тому +3

      They are available here: github.com/aws-samples/amazon-dynamodb-design-patterns/tree/master/examples/an-online-shop

    • @huscachafe
      @huscachafe 3 роки тому

      @@saurabhshri thanks a lot !

  • @shobhitsharma3141
    @shobhitsharma3141 9 місяців тому +1

    if i have to fetch details of a customer c#123 (like name, email etc) and all their orders, is it possible to fetch that in a single query?
    I can do that in two calls by first fetching customer data via PK=c#123 AND SK=c#123, and later via PK=o#123 AND SK=o#123

  • @guynicholas666
    @guynicholas666 Рік тому

    I realize this is an old video now, but it would be very helpful if you provided a link to the final data model file you import. You move through the data pretty fast and being able to check it out at my leisure would be very helpful.
    It's still a great video though!

  • @khanhdo3988
    @khanhdo3988 3 роки тому +1

    At 10:26, does the sort key really allow querying with an "in" condition? AFAIK, we cannot currently do this.

  • @MrJkreddy
    @MrJkreddy 3 роки тому +1

    Awesome Rick

  • @andreadiotallevi5780
    @andreadiotallevi5780 Рік тому

    I feel like a kid who has just discovered a new amazing toy

  • @user-fn2fj5uw6t
    @user-fn2fj5uw6t Рік тому

    I heard a saying that DDB transactions feature eliminates the need to design single table. Is that true?

  • @jeremyllanta
    @jeremyllanta 3 роки тому +2

    Hey, very interesting approach, what would be the best method for a get all Customer or get all Product for example?

    • @ahmadnabil2441
      @ahmadnabil2441 3 роки тому +2

      I think you can add an attribute called "shop" for example on each customer and product record and create a gsi where pk = shop, sk starts with c# or p#

  • @vincentrouilhac4532
    @vincentrouilhac4532 Рік тому +1

    Great video ! I have a question though, I'm new to DynamoDB so there is one missing piece I did not get, in 20:15 if I have a product Id I can query for that product all warehouses "begins with w" but how do I get both quantity available and warehouses' name in a single query (without having replication of attribute)? Do I need to query warehouses' name for each Id ?

    • @me-vn9wk
      @me-vn9wk 2 місяці тому

      Create custom index or use scan with primary id and then sort the data. Second one is expensive and first one is custom pre build with the usecase in mind.

  • @ruslanmuzhikov3962
    @ruslanmuzhikov3962 3 роки тому

    Awesome lesson!

  • @NikhilSwamiExperimental
    @NikhilSwamiExperimental 3 роки тому

    SUPER VIDEO!!!!!!!!!!!!!!!!!!!!!

  • @tiagovinicius1941
    @tiagovinicius1941 3 роки тому

    Is the sound ok over there? Here it is kinda breaking up

  • @matthewwoo6684
    @matthewwoo6684 2 роки тому

    For your GSIs then, do you always use an ALL projection? It seems like to use patterns like this you can't limit the projection

  • @XaphanMusic
    @XaphanMusic 2 роки тому

    Is there any chance to get the DB modeling file?

  • @gearoidoconnor2584
    @gearoidoconnor2584 3 роки тому +1

    What tool is he using that says AWS visualizer?

    • @a99881
      @a99881 3 роки тому

      NoSQL Workbench - docs.aws.amazon.com/amazondynamodb/latest/developerguide/workbench.html

  • @taylant1833
    @taylant1833 7 місяців тому

    I dont understand why Rick creates a second GSI. Can someone please explain it to me? Thanks

    • @me-vn9wk
      @me-vn9wk 2 місяці тому

      That helps to query data by not using primary keys and for custom purpose like ' give me the top warehouses running out of product data' etc.
      We can't build different tables for our custom usecases so effectively model data in few tables and build index to support custom query or use scan.

  • @PAD637
    @PAD637 2 роки тому

    Is it possible to get an import file of this schema?

  • @ahmadnabil2441
    @ahmadnabil2441 3 роки тому +1

    What if for example the customer for some reason edits his name how will i update the customer name in all other records for example in orders where it has the old customer name?

    • @ahmadnabil2441
      @ahmadnabil2441 3 роки тому

      @4§4§r1 But how will this approach store the customer name in the order record?
      The customer might have multiple orders stored in a list or a map in the customer record and i can't make a gsi on a list or map to be able to project his name.
      I don't think there is a way around this except for fetching all customer orders and updating each order to change the customer name.

    • @ahmadnabil2441
      @ahmadnabil2441 3 роки тому

      @Veerabramhendra Swamy Pothuluri I actually ended up considering this solution, i guess after all i can't optimize for both reads and writes. I will either store customer name in each order and optimze for reads but then i'll have to deal with updating each record if the customer edits his name, Or just store the customer id and for every order record i'll have to fetch the customer name which is also a bit too much. But anyways thanks for your response i really apperciate it.

    • @GrizzlyNetch
      @GrizzlyNetch 3 роки тому +1

      @@ahmadnabil2441 also worth noting that in some cases you want to keep the previous customer name so copying it to record can actually be feature especially in case of invoices (eg. when customer is company and you need to keep the previous name intact on old records)

    • @ahmadnabil2441
      @ahmadnabil2441 3 роки тому +1

      @@GrizzlyNetch Oh, I never thought of that my usecase is actually kinda similar. Thank you very much for the advice.

  • @zelinpu5022
    @zelinpu5022 3 роки тому

    Hi Rick, maybe you could post the data model file so that we can play around on our own? :)