r5
r5 copied to clipboard
Remove MongoJack and consolidate MongoDB utils
A process that started many years ago, this removes the MongoJack dependency and completes the incremental replacement of the Persistence
module and its collections with the AnalysisDB
and AnalysisCollection
types.
In light of a possible database switch in the near future, it seemed more straightforward to continue to use String
based IDs everywhere, instead of switching to a MongoDB specific ObjectID
type.
Our average collection already uses String
IDs, but this will require a migration for aggregation areas, data sources, and data groups.
Other notes:
- Switched from arrays to
List
s in MongoDB model classes. - Added a
DbResultWriter
that setscompleted: true
on regional analyses when they are complete. - Made two
OSMCache
methods static (cleanId
andgetKey
) so that theBundleController
no longer requires it as a component dependency. - Updated the MongoDB driver from v3.11.0 to v4.7.2. MongoDB currently provides documentation for v4.3 to v4.8.
- Removed unused HTTP endpoints (and their handlers) in the
AggregationAreaController
,BundleController
,DataSourceController
, andRegionalAnalysisController
. - Refactored
BundleController
's created method, breaking it up into smaller steps. - Refactored
RegionalAnalysisController
's create method. Some benefits:- The
FileStorage
andAnalysisDB
components no longer need to be injected through theBroker
to theMultiOriginAssembler
. Result writers are created in the controller with what they need. - Moved the
RegionalTask
creation into theAnalysisRequest
object, where much of the logic already lived. More refactoring can certainly be done here, but it is a good first step. - Removed any usage of the
RegionalTask
stored on aRegionalAnalysis
. This means that we only need to serialize it into MongoDB, we don't need to handle deserializing it.
- The
This will resolve https://github.com/conveyal/r5/issues/758.