Which is preferable - Background or Scheduled jobs

rajalakshmi12
Mega Expert

Hi All,

After going through many threads in the forum on the same topic, I would really need to know which is preferable to use.

Scheduled Jobs or Background script ?

Pro's of Scheduled job - Scheduler worker, asynchronous, ease to kill/cancel the job

But there are other features in Background script such as recovery/roll back of the script and now it also gives us the additional input on what are the other tables are getting updated due to this running script, It captures the query as well as the result in the logs.

Please clarify me!

 

Thanks & Regards,

Raji.

 

 

4 REPLIES 4

siva_
Giga Guru

When you say background i think you are referring to fix scripts 

Thanks

Siva

siva_
Giga Guru

Both should be fine unless and until you want to have that run at a specified time for multiple repetitive intervals but roll back would be a bigger gift if you miss anything 

In my opinion , i would go with fix scripts and also run it at a time where i feel there would be less performance impact for the users

 

Thanks,

siva

SaiRaviKiran Ak
Giga Guru

If you want to run script for only one time then you can use background script.

 

If you want your code to be executed every time like weekly basis or daily etc you can go for scheduled jobs

Alikutty A
Tera Sage

Hello,

Background scripts is a server side Javascript executor and are used for smaller admin purposes ie if you need to test out a simple script, execute minor data updates or similar changes. It runs synchronously so keeps the user on wait until the execution is completed. It is not recommended to execute longer duration scripts in here like deletion etc and used for one time tasks.

Scheduled jobs on the other hand are automated process where you could get a script executed on demand or scheduled basis. They run on the background as a worker job in the sys_trigger table asynchrnously and have additional functionalities other than executing scripts like reporting scheduling, generate template data etc. It is more advanced feature and is mostly used to automate your process.

Thanks