tushar
Oban running on multiple nodes
Hi ,
My requirement is I have to publish messages to Kafka based on events raised by my phoenix app , I am evaluating Oban to be aligned with the outbox pattern , our application will be deployed in 3 nodes in production with a single postgres DB to read/write from , the “outbox” or the Oban’s Repo will be hosted in the same DB.
My doubt is when it comes to multi node where all the Oban workers from the different nodes will be reading from the same table . whats the behaviour as in when all the 3 workers will read from the same table , will there be any chances of clash as in when all the 3 workers are reading the same event to publish ?
Or such a scenario is not at all possible ?
If it is possible is there any workaround/pattern available to avoid the same ?
Marked As Solved
mbuhot
You can see the code used to reserve jobs uses locks: https://github.com/sorentwo/oban/blob/master/lib/oban/query.ex#L21
This post explains the general technique:
Also Liked
egze
Workers will not process the same job simultaneously, so it is safe.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








