hotosm / old-export-tool

Version 1 of the Export Tool is suspended - please see V3 https://github.com/hotosm/osm-export-tool
16 stars 18 forks source link

zip sql downloads #79

Closed harry-wood closed 9 years ago

harry-wood commented 10 years ago

We could zip up some of the download types, so

extract.sqlite, extract.sql, extract.spatiallite would become extract.sqlite.zip, extract.sql.zip, extract.spatiallite.zip

This would save a lot of disk space, and also bandwidth of users downloading them.

For existing files, I think we simply need to zip the files (such as /home/hot/var/runs/013968/extract.sql ) and then modify a filename which is stored in the database, to have the .zip extension. Could make a script which does both.

To change it for new downloads as they are created, we'd need to add a zipping step in the script, and have it write the different filename in the DB. but I'd be inclined just to solve it as a script as above.

The only disadvantage would be a slight increase in complexity for anyone using the downloads. They now have to unzip them first. For the sql & sqllite files, you kind of have to have a reasonable level of tech know-how to be using these files anyway, so can't imagine that being a major extra hurdle.

harry-wood commented 10 years ago

Oh I've just seen we do actually zip the "postgres dump" SQL files nowadays. Not sure when that change was made to the run process, but I see older runs still have uncompressed .sql files.

dodobas commented 10 years ago

yeah... SQL dumps are zipped , https://github.com/hotosm/hot-exports/blob/master/backend/export_request_processor.pl#L122