this is my current project structure, the get request has a field that needs external validation
the idea is the endpint dispatch the validation async to a task or spawn (for what I researched, if I dont need a explicity return, spawn its more lightweith and swits me more) and then retrieve the result with a get request via another endpoint, and leave tha
the task to registry the result on the ets and the db, the possible states for the value
would be
value = processing
value = acceptd (waiting for payment)
value = denied ({error, reason}
can I trust the task to perform all its duties without being supervised?
the info registered on db will have a timestamp of 2 or 3 mins, after this everything will be dropped, so it the get request doesnt find the value on the ets for any reason (if too many request hits the post endpoint, the value may be dropped from the ets, I will yet think on the cache logic) neither on the db, it can be assumed that the response was {:error, reason}, but fot that I need to trust that everything delegated to the the asyncs will be executed
also, do I need to protect my system against ets random crashs? and if yes, besides using supervisor to restart it there is a way to retrieve the data?
fyi, the application will be running on cloud with 2cpu and 3gb ram