Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a hack to allow us to reset the URL that the code connects to
The database code has currently been optimized for a 1:1 mapping between the server and the database, where the server needs to make multiple intensive queries to the database, for example, to read trajectory information from the database for multiple users at a time, for the post-processing. This has led to design decisions in which we cache the database connection and re-use it, to avoid overloading the server with multiple queries. We are now getting some requests for federated data. A concrete example is e-mission/e-mission-eval-private-data@952c476 where we wanted to compare the characteristics of multiple datasets (e-mission/e-mission-eval-private-data#28) An upcoming example would be to "roll up" multiple dashboard deployments (e.g. from individual cities) into a program level dashboard. We anticipate that these will be low, volume, intermittent accesses to generate analyses and metrics. The long-term fix is probably to create a FederatedTimeseries (similar to the AggregateTimeseries that merges data across users). But for now, we just implement a hack to reset the connection and reconnect it to a different URL. This means that we cannot access all databases in parallel, we will need to access them serially. But for the current use case, that is sufficient since we can concatenate all the data and work with it later.
- Loading branch information