mysql - Best Practice for synchronized jobs in Application clusters -


we have got 3 rest-applications within cluster. each application server can receive requests "outside".

now got timed events, analysing database , add/remove rows database, send emails, etc.

the problem is, each application server start timed events , happens 2 application server starting analysing job @ same time.

we got sql table in back.

our idea lock table within sql database, when starting job. if table locked, exit job, because other application started analyse.

what's practice insert kind of semaphore ?

any ideas ?

don't use semaphores, on complicating things, use message queueing, queue tasks , them executed in row.

make 1 separate node/process/child_process consume queue , task done.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -