Currently I am using a DynamoDB instance for my social media application. While designing the schema I sticked to the "one table" rule. So I am putting every data in the same table like posts, users, comments etc.
Now I want to make flexible queries for my data. Here I found out that I could use the @searchable
annotation to create an Elastic Search instance for a table which is annotated with @model
In my GraphQL schema I only have one @model
, since I only have one table. My problem now is that I don't want to make everything in the table searchable, since that would be most likely very expensive. There are some data which don't have to be added to the Elastic Search instance (For example comment related data).
How could I handle it ? Do I really have to split my schema down into multiple tables to be able to manage the @searchable
annotation ? Couldn't I decide If the row should be stored to the Elastic Search with help of the Partitionkey / Primarykey, acting like a filter ?