so I'm junior programmer and I'm pretty much having hard time to figure this out by myself.
I'm creating IoT web application based on MVC 5, with Code First database approach which does next things:
- Communicate with sensors over MQTT protocol (mosquitto broker)
- Shows values and some basic data from sensors on site
- Does value data import from sensor to database per user (or topic, cause every user has unique topic) every 5 hours
- Sends out data back to broker to activate some part of hardware after user specifies time between hardware activations and for long long hardware is gonna be active.
So the troubles I'm facing are:
1. How do I save data per user if user is logged out/ user is offline/ application is offline?
2. How do I create timer to do data saving every 5 hours?
Any ideas which could help me out are appreciated.
I'm trying to find out easiest way to solve this.
What I have tried:
I've seen that Quartz.NET, cron, HttpRuntime.Cache (with item expiration), Console Application, Web Service could help me out with this problem, but I dont quite understand their doing.
About data saving I also got informed about mosquitto persistence which saves data on broker till client connects, so I'm also wondering how good that approach is?