You could use Task Scheduling. Which would still require you to run one cron, but has some advantages over manually writing cron jobs.
Nov 4, 2019
3
Level 14
Persist Redis store periodically
Hey all, I'm thinking on counting blog article hits with Redis, and want to save the result to DB eg. daily. The point is not to stress the DB on every visitor hit..
My idea is, I make a cron job, and every midnight I get all view count values of articles from Redis, and save them to DB. Finally reset the count values to 0.
Is there a better way to do that? I know that Redis can natively persist store data, but saving to DB I can build a nice chart stat, and own the data after years, even Redis doesn't play a role later
thanks
Please or to participate in this conversation.