DEV Community

Discussion on: How I built a Simple Sprint Dashboard with AWS Amplify

Collapse
 
enix79 profile image
enix79

Who is saying putting everything in one table is best practice? There are several reasons amplify creates a separate table for every @model object type:

  • You can query the objects of tables by the primary key. Keep in mind that the maximum amount of GSIs is 30 (and they are not free). In a complex model it might not be enough.
  • You can assign an object to other tables/objects, i.e. assign same address id to user (user private address) and company (company business address). Reusing same object keeps your data redundancy free and avoids duplicates, i.e. "My street 1"and "My stret 1".
  • You can set the authorization on your data more granular and convenient with @auth directive, which you didn't use in your project so far.
Collapse
 
pubudusj profile image
Pubudu Jayawardana

Great. Thanks for the suggestions @enix79 . Really helpful 🙏

Collapse
 
alexandermchan profile image
Alex Chan

Many of the resources from github.com/alexdebrie/awesome-dyna... recommend single table design. Rick Houlihan in particular has some pretty convincing talks on why and how to achieve this.

Collapse
 
enix79 profile image
enix79

Thank you, I will look into it.