Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quartz Scheduler - What is the diff between RAM and JDBC Job store

I want to use Quartz Scheduler framework in my application. I came across two types of JobStores:

1) RAM Job Store

2) JDBC Job store.

I am wondering in which case I have to use which job store. And what is the pros and cons between them.

Any thoughts on this is really helpful for me and I appreciate it.

like image 857
Narendra Avatar asked Nov 29 '12 19:11

Narendra


2 Answers

JDBC job store saves information about fired triggers and jobs in the database, thus:

  • it won't lose firings if application was down when trigger was suppose to fire (this depends on chosen misfire instruction)

  • you can cluster your scheduler, where each node uses the same database

  • JDBC job store is considerably slower

RAM job store is applicable only in non-clustered application where loosing a firing is not a big deal. It's also much faster. If you want to use Quartz with RAM job store, most likely you don't need Quartz at all. Both Spring and EJB provide mechanisms to run periodic jobs, both time and CRON based.

like image 125
Tomasz Nurkiewicz Avatar answered Nov 10 '22 15:11

Tomasz Nurkiewicz


The RAM Job Store is very fast, but very volatile - jobs won't survive a server restart.

The JDBC Job Store is a little slower, but since the jobs are in a persistent store (the database), they will survive a restart.

So, if you only have short-lived job schedules, and it's ok to lose them when the server restarts or the application is redeployed, then you can use the RAM Job Store.

If you need the assurance that your jobs will survive a shutdown / restart, then you should use the JDBC job store.

like image 3
GreyBeardedGeek Avatar answered Nov 10 '22 15:11

GreyBeardedGeek