Closed hsb1007 closed 6 months ago
/bounty $30
💎 $30 bounty created by eronka
🙋 If you start working on this, comment /attempt #34
along with your implementation plan
👉 To claim this bounty, submit a pull request that includes the text /claim #34
somewhere in its body
📝 Before proceeding, please make sure you can receive payouts in your country
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to eronka/culero!
👉 Add a bounty • Share on socials
Attempt | Started (GMT+0) | Solution |
---|---|---|
🟢 @mehulmathur16 | #44 |
@hsb1007 can I be assigned?
@hsb1007 Thanks for assigning.
Adding a comment to address the caching issue:
Considering that we have a caching layer set (using nest cache or anything else), we can follow this approach:
userId -> score
userId
, see if the key is present. If yes, return it. If no, compute the score, store the cache, return the data.P.S. for better performance, we can use pg-boss
to schedule jobs to run on postgres since we are already using psql.
@hsb1007 thoughts?
Adding a comment to address the caching issue:
Considering that we have a caching layer set (using nest cache or anything else), we can follow this approach:
- We maintain a key witht the user id. The relation will be
userId -> score
- Whenever the review data is updated/added, we first write the data in the db, then we compute the score, then we add it in cache asynchronously.
- Whenever we try retrieving the data, we can check the cache for
userId
, see if the key is present. If yes, return it. If no, compute the score, store the cache, return the data.P.S. for better performance, we can use
pg-boss
to schedule jobs to run on postgres since we are already using psql.@hsb1007 thoughts?
Sounds awesome! @mehulmathur16 can you please incorporate this?
Adding a comment to address the caching issue: Considering that we have a caching layer set (using nest cache or anything else), we can follow this approach:
- We maintain a key witht the user id. The relation will be
userId -> score
- Whenever the review data is updated/added, we first write the data in the db, then we compute the score, then we add it in cache asynchronously.
- Whenever we try retrieving the data, we can check the cache for
userId
, see if the key is present. If yes, return it. If no, compute the score, store the cache, return the data.P.S. for better performance, we can use
pg-boss
to schedule jobs to run on postgres since we are already using psql. @hsb1007 thoughts?Sounds awesome! @mehulmathur16 can you please incorporate this?
@mehulmathur16 All good, I will raise it as a separate issue!
@hsb1007 I'll look into this.
💡 @mehulmathur16 submitted a pull request that claims the bounty. You can visit your bounty board to reward.
🎉🎈 @mehulmathur16 has been awarded $30! 🎈🎊
API to get user's average review score 1. overall 2. each category (professionalism/ reliability / communication).
1 API for logged in user 2 API for other user's profile
What would be the best way to handle the caching this?