I get some data from third party HTTP API. I get each datum (json → store as map) at random intervals. And I get all the data within 10 minutes (upper limit) from the API.
I do not want to keep inserting into my postgres database each time I get a datum from API.
Instead, I want to store each datum as a list of maps and then insert at once.
What is the best practice in this case?
- use ETS?
- use Genserver?
- simple prepending all the data to a list of maps (where a map in list represents a data point)
- Enlightening approach that I am unaware of.