What is the best architecture to perform custom operations (application-level) at an interval?
-
Define a static class, define a timer in it, and set the interval. Perform the operation in timer’s tick event: Seems like a bit dirty and unreliable.
-
Define a windows service, handle operations in the service: Reliable, but needs much more work and it’s preferable to have a simpler solution with fewer lines of code. Also, this needs access to the host system (Not applicable if you’re on a shared hosting).
Is there any specific design pattern which is considered best practice for this kind of work?
Create a Console Application and use Windows Task Scheduler.