In the previous post, I mentioned my plan to write a recommendation system using Redis and Nodejs. In this article, we look closer at the most important business objectives.
The recommendation system I'm creating will be used in the product-based application, similar to e-commerce apps. Will be difficult to measure direct leads as it's integrated with various partners and websites and it may vary from one to another. So recommendations will be calculated based on events with different weights.
For now, I think about something like opening product page +1 score, give a like to product +2, comment +2, go to the details +5 and so on. For each tag associated with the product composite key with the event will be created.
Back to high-level requirements, the number of products will be relatively low when compared to full feature e-commerce and up to about ~10k items. Cold start which means a situation when the user didn't make any interaction before should be solved by choosing products popular among the overall audience of users.
The needs and tastes of the user may change so the composite of user-tag-event should expire, this can be done in Redis by setting TTL or in the more general database by WHERE clause plus maintenance worker or trigger for periodical cleanup.
In the next post, we will look more closely at the implementation. My initial thoughts are to use Redis TimeSeries to gather events and then use aggregation per composite for each user tag in a certain time span. However, it may be different as I need to dive deeper into Redis structures. If you have any advices or comments, you are welcome.