I'm working on a data modeling challenge in DynamoDB involving two entities: Class and Student. I have several million records for Student and a few hundred for Class. A Student can belong to multiple Classes, and a Class can have multiple Students.
Access Pattern Challenge: I need to efficiently list all Students who are not enrolled in a specified Class. The primary challenges I'm facing are:
- DynamoDB does not support querying based on negative conditions directly.
- Avoiding full table scans.
- Minimizing application-level filtering. Given these constraints, how can I model my data in DynamoDB to support this access pattern through a single query operation?
Additional Context:
The solution should ideally allow retrieval of full profile details for each Student. The dataset includes several million Student records, which necessitates a highly efficient querying approach.