How to design a DynamoDB index that has 4 filters in the UI

Viewed 114

I am trying to design an index that can respond to my access pattern. In the UI, I have one collection that can be filtered by 4 attributes:

  • customer
  • date
  • type
  • creditor

I was reading the documentation and Alex Debrie's book, and I was inclined to use the Composite Sort Key strategy for filtering. Even though, I have a problem: I can filter my data combining any of these attributes. For example:

  • I can only fill the customer and date filter
  • Or just select type as a filter
  • Or just select date as a filter
  • etc (All combination of filters)

If I had the 4 filters, I would just use the pattern date#type#customer#creditor and it would work. But how can I design these indexes in order to have the flexibility of multiple filters, but not all of them are needed.

Thanks

0 Answers
Related