evtstore icon indicating copy to clipboard operation
evtstore copied to clipboard

Does multiple instances of event handler prevent that events will be processed with correct order?

Open gtsamtsouris opened this issue 1 year ago • 5 comments

Does multiple instances of event handler ensure that events will be processed with correct order?

gtsamtsouris avatar May 15 '23 11:05 gtsamtsouris

Hi

You should ensure that only one instance of an event handler is processing events. In my own apps I use database locks to guarantee this.

Seikho avatar May 15 '23 11:05 Seikho

Hi @Seikho, I'd like to explore more on the use of database locks. How did you implement this? or any pointers on what I have to research more on this. Thank you. I've used your library in production.

jbalatero avatar Mar 06 '24 04:03 jbalatero

What database are you using? I mostly use Postgres and MongoDB and have a mutex implementation for both.

Seikho avatar Mar 11 '24 03:03 Seikho

Thanks for the reply, I'm using MySQL 8

jbalatero avatar Mar 11 '24 03:03 jbalatero

I'd start by doing something like this: https://github.com/n8j1s/node-mysql-semaphore/blob/master/lib/mysql-semaphore.js

Seikho avatar Mar 11 '24 04:03 Seikho