Open iokiwi opened 10 months ago
Calling out to an external API to get exchange rates on every request is suboptimal for several reasons.
Either we will have to pay for API usage or we are placing unfairly placing unnecessary load on a service run for free.
We should keep a table in our database with a recent exchange rate and the time it was updated.
We can update the table on a schedule or inflight if the data has become 'stale' according.
I am considering a redis cluster for this just for the sake of learning redis :)
cosmos db :D ?
I would recommend using arq to schedule a CRON job for fetching and updating the rates in the local database. arq is a great library that allows you achieve this. PS. it's built using asyncio.
Calling out to an external API to get exchange rates on every request is suboptimal for several reasons.
Either we will have to pay for API usage or we are placing unfairly placing unnecessary load on a service run for free.
We should keep a table in our database with a recent exchange rate and the time it was updated.
We can update the table on a schedule or inflight if the data has become 'stale' according.