Following some other SO questions, I'm developing a website monitoring application as a pet project with the goal of learning more about Node.js + Redis.
What I have planned is to let users add urls and add them to a Redis SET. Every minute, I get the SET results, do a HTTP Get request and print the response.
This seem to work fine, however, I have a couple of questions:
Given that Redis SET does not allow repeated keys (which will save me from doing a request to the same URL), how do I control when a user removes the URL from his account but another user has the same URL? Can I have an
INCRvalue in the URL key so I know how many users have the URL in their account?Given that I do an HTTP request every minute and I want to use Redis to save the results (response time, up/down, etc), what's the best way to save all that data in Redis (results from the requests to each url every minute)? Shall I save each response in a unique Redis key?
In order to show results to the user in real-time, what's the best way to query the results and parse it in real-time?
Thanks for the help.