Let's say in my main table I have objects that have the following pattern :
Partition Key = user_user@email.com
Range Key = project_001
Role = owner
It's a simple object that says what is the role if a specific user in a specific project.
But then I want to get all user roles in a project, so I made a GSI that inverts the key orders by using Range Key Begins With "user_"
Partition Key = project_001
Range Key = user_user@email.com
Role = owner
But what happens when I delete a object in this GSI? Will it delete the respective object it replicated from the main table? Or do I need to manually keep them synchronized?