To provide fast response for public events request, we have to cache parsed events
Related with #5
Acceptance criteria
Events are stored in Redis DB
The key of event is PublicEvent:YYYYMMDD, where YYYY - year, MM - month, DD - day
One key can contain several events, if events will be in one day
Events should be loaded from VK.COM:
Update interval should be set in appsettings.json
The source of events(list of vk groups) should be set in appsettings.json
If one source in unavailable, it should not affect to other sources
Points to discuss
_1. We want to see latest events and upcoming events on one page, how we can load it ? loading by months
If we're using a tree to store events, what will be root ? n/a
What will be in one slice ? How we can make it based on tree ? One chunk - one month ? +
If we'll cache events today, but user'll request it tomorrow, which chunk should be loaded ? for current month_
Because, we don't have a lot of events, we can store it using date as a hash. The key will follow this pattern: PublicEvent:YYYYMMDD, which is a pointer to list of public events, which will be started at YYYYMMDD ( YYYY year, MM month, DD day) UTC time
But, we need to provide opportunity to load data for several days (interaval), from date to date. To reach that, the backed should make several requests to the cache and apply UNION operator for all results, to make one collection of events.
Caching chunks of Public Events
To provide fast response for public events request, we have to cache parsed events
Related with #5
Acceptance criteria
PublicEvent:YYYYMMDD
, where YYYY - year, MM - month, DD - dayPoints to discuss
_1. We want to see latest events and upcoming events on one page, how we can load it ? loading by months
Because, we don't have a lot of events, we can store it using date as a hash. The key will follow this pattern:
PublicEvent:YYYYMMDD
, which is a pointer to list of public events, which will be started at YYYYMMDD ( YYYY year, MM month, DD day) UTC timeBut, we need to provide opportunity to load data for several days (interaval), from date to date. To reach that, the backed should make several requests to the cache and apply UNION operator for all results, to make one collection of events.