What is the difference between windows service and Timer Jobs?
What do you have to select ( windows service or Timer jobs) to do your scheduled jobs?
Timer Job vs. Windows Service
Comparison
|
Timer Job
|
Window Service
|
Maintenance downtime
|
Yes
|
No
|
Logging User Interface
|
Yes
|
No
|
Control
|
By Central Admin
|
By Service.msc
|
Policy of Failure
|
No
|
yes
|
Backup and Restore
|
Automatically
|
Manually
|
Availability
|
High
|
Medium
|
Deployment Server
|
Deployed on App Server only
|
Deployed on all Web Servers
|
Maintenance
-
Timer jobs require downtime to deploy
-
Windows Service doesn't require downtime to install/update.
Details:
When you
want to update timer jobs, you need to update WSP Solution, re-activate timer
jobs feature, and reset SharePoint Timer Service, where windows service can be
installed simply using IntallUtil.exe and a simple command.
-
Windows Service has no ready-to-use logging
page for last time job got executed and status of jobs executed.
-
SharePoint Central Administration can be used to show status of all the jobs executed and their
status as in the below figure.
Figure 1 |
Control
-
Timer jobs controlled easily by central admin.
-
Windows Service controlled by Services.msc utility.
-
a policy on failure can be defined in windows
service where it is not in Timer Jobs
Details:
-
You can enable/disable, change schedule of time job, stop,
view running timer jobs, view history of timer jobs, and view log file for the
executed timer jobs from Central administration of SharePoint as in figure 1
& 2 where you can also stop/start view status and log on account as in
figure 2.
Figure 2 |
Figure 4 |
Backup and Restore
-
Timer
jobs backup and restore with same process of SharePoint backup/restore.
-
Administrator needs to manually manage backup and restore of
Schedule Tasks
Availability
-
Custom Timer Jobs provides the power to specify Job LockTypes
which guarantees that multiple instances of same job will never execute at the
same time
If
your job does something with the files in the Web-Frontend server,
you might want to use a ContentDatabase Timer Lock Type.
-
If you
edit files and pages -> use ContentDatabase Timer Job Lock Type ->
will be run on each web front-end
-
If you
edit on List and do not need to duplicate records -> Use Job Lock
Type -> only once will be run.
-
No
multiple instances guaranteed. Administrator needs to make sure that no two
instances are running at the same time.
Deployment
-
Task Scheduler need to be installed on all web servers using
IntallUtil.exe utility.
-
Timer Jobs Installed
on Farm Only using WSP solution.