Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Change from MongoDB to PostgreSQL #601

Open
2 of 8 tasks
Floppy opened this issue Apr 16, 2021 · 0 comments
Open
2 of 8 tasks

Change from MongoDB to PostgreSQL #601

Floppy opened this issue Apr 16, 2021 · 0 comments

Comments

@Floppy
Copy link
Member

Floppy commented Apr 16, 2021

The version of MongoDB we're using is old and being retired from MongoDB Atlas on April 30th 2021, and we're in dependency hell trying to update it. Given the changes to the app to remove stored CSV data (from ages back), we don't really need MongoDB any more, so we can change to something more standard, i.e. PostgreSQL.

I propose to do this in a series of discrete steps, each of which will be deployed live and verified as working as they are completed.

  1. Move MongoDB models into a Legacy namespace. Create non-ActiveRecord models in the global namespace which transparently delegate everything to the legacy variants. Tests should not be changed. Move mongooid models to legacy #602, Change everything to use legacy models explicitly #603
  2. Move non-DB methods out of Legacy models into concerns and service objects, leaving legacy models as bare Mongoid config only.
  3. Create new ActiveRecord models, with a PostgreSQL DB and schema
  4. Create a task to copy all data from Legacy models into ActiveRecord ones. Run and verify correctness of migrated data
  5. Change Delayed::Job to use postgres, not mongodb
  6. Remove all legacy model delegation from new models, thus making the app use the new AR-backed data.
  7. Remove legacy models and MongoDB-related dependencies
  8. Retire MongoDB Atlas server
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant