79317080

Date: 2024-12-30 08:13:02
Score: 1.5
Natty:
Report link

IMO the approach you have described looks OK. In case if MongoDB is source of truth, Redis should be updated afterwards.
What about the question, how often Sync between MongDB and Redis should be done, it depends of application business needs(mean how long final customer can accept old data) and also how often a device entity is updated during the day, if it is multiple times, will be better to send an end of day update.
About Sync approach, I would sugget you to have a look at this article. Even if it is written for Kafka, you can get an idea of how to decouple Document update, from publishing an update notification to RabbitMq, by tailing oplog replica set MongoDB collection.

Reasons:
  • Blacklisted phrase (1): this article
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: artiomi