Pre-load exchange rates and security prices in the background #1615
Labels
💡 Improvement
Improvements to an existing feature or flow
🔧 Backend
⚡ Performance
Performance issues to address
Up to this point, we have dynamically "found or fetched" exchange rates and security prices in the app. If we don't find it in the database, we hit our provider, Synth.
As we write more complex aggregation queries in the app (ie budgeting insights, portfolio returns, etc), this will become more of an issue as many of these require a basic join on rates/prices tables.
There have already been some performance issues highlighted due to the on-demand loading of these rates, so we should move towards pre-fetching rather than on-demand.
When to fetch on-demand
We will keep our on-demand fetching for a few useful cases:
When to preload
All historical calculations and queries should assume that a rate/price is available in the DB, and provide reasonable fallbacks (ie conversion rate of 1 for exchange rates, last known price for stock prices)
This allows for easier joins on these tables.
Preloading spec
The text was updated successfully, but these errors were encountered: