medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
469 stars 217 forks source link

Retention Policy for mRDT photos #5749

Open kennsippell opened 5 years ago

kennsippell commented 5 years ago

Is your feature request related to a problem? Please describe. Muso's mRDT scale-up is scheduled for July. Muso's projection is that post-scale-up they will capture 10 photos per CHV per day, which would be several thousand images per day (3000?). There is reason to believe that after time this would cause some server-side bloating and potential slow-down. We would benefit from some sort of retention policy or hot/cold storage solution.

Describe the solution you'd like We can consider having a cron script which removes old photos from CouchDB. Potentially moving them to AWS's glacier storage if they need to be retained.

kennsippell commented 5 years ago

Sample image taken today was around ~300kb. So 3000 images/day x 300 kb/image ~= 900 MB/day if Muso's projections are correct.