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
Post a Comment