dod
OTP architecture advice
Hi there!
Which approach would you choose for the following:
App receives events notification from external source. As long as notification received, app needs to collect data from external API. After data from API received the call to API has to be repeated after 10 sec. And repeated again after 20 sec. An again after 40 sec and so on. In other words each notification should trigger N calls each call should be made after 10 x 2^n seconds.
Notifications occurs randomly with random rate. If at some point of time API call result in stop command no further calls has to be done.
What would you use and how would you structure an application? Supervised Tasks, GenStage, GenServer, would you spawn a new process for each call or would you track timings in single process? Could you provide architecture example?
Thanks!
Most Liked
Qqwy
Here are some questions that probably require an answer before a choice can be made:
-
What should happen on app restart or (partial) crash? Is it required to continue the sending of these requests at that case, or is it okay to drop them in cases like these?
-
How expensive will these API calls be? Will there be other work that has to be calculated locally to send it to the API? How much storage will be required to keep track of the notification-data that will be used in some way to invoke the API? (What kind of data are we talking about?)
-
How tight is the time window? Is it a problem if at some point a call is a second late?
-
What should the app do if the API is not responding or crashing when you call it?
-
How will the app receive these notifications? By an external party making a request, or does it have to fetch the data itself?
-
What kind of parties will create these notifications? Will there only be a couple hundreds per minute at best, or possibly millions?
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









