I am currently building a simple newsletter app, where users can get invited via their emails to read a newsletter.
I have the current example table setup:
- where i use autogenerated Ids and emails as partition keys and generic keywords as sort keys,
- for defining newsletter-email relationship I use newsletter ID as PK and emails as SK's
I use 1 GSI, which uses base table SK as PK and base table PK as SK - this gives me the following aggregated view:
- my desired access pattern is to allow invited users to list their newsletters with simple nextToken AWS mapping template resolver pagination.
My question is - for my use case, the "newsletter email relationship data" and "newsletter data" has to be identical, so that I can show a preview of my newsletters in the newsletter list and at the same time, display newsletter itself after the user clicks on one of the listed newsletters and displays the newsletter detail.
- Is there a way to achieve this without redundancy?
- If not, how do i keep the hundreds of newsletter email relationship data in sync with the newsletter data? Do i really need to perform hundreds of PutItem operations via TransactionPutItem every time i update the name of my newsletter?
- Is there some methodology I am missing?