问题
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.
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/13633404/quartz-scheduler-what-is-the-diff-between-ram-and-jdbc-job-store