I'm currently optimizing my application, and I want to find out which way would be faster and better performance-wise in the following scenario.
I have a table with 4 fields - id, user, status, entryTime
.
I'm doing write to this endpoint around 100 times every 10 seconds, so in average 10 writes per second.
The primary key is user
, and the clustering key is entryTime and id
.
I have an endpoint, where I need to retrieve all entries between a specific entryTime
for a specific user, so, for example, for user with ID 1
, where entryTime
is greater than 2019-06-04T07:58:28.000Z
and less than 2019-06-04T08:58:28.000Z
.
Another endpoint is, where I have to retrieve with specific status
for a specific user.
Is it better to create a materialize view for the 2nd endpoint (where I need to retrieve the status), with different keys, or to add SASI index?
Since the table is updated frequently as well, and written frequently, from what I've read, the writes take around 10% performance, but does it apply to all tables, which has frequent read/writes?
Are there any check points for future reference which I can follow to determine if I should go for materialized view or SASI index?