Storage of sql scripts: inside db or filesystem?

Hi All,

I’m developing an app in which has the ability for admins to make a ‘snapshot’ of the apps data at a particular point in time. this function simply calls mysqldump, piping all table structure and data into a gzipped file. All backups have a timestamp, reason for backup and reference to the file itself.

The app itself will be ran as a SAAS app so there could be potentially hundreds of admins and so thousands of these backup files. The compressed size of the backup will be around 4-40kb for 95% of cases

My question is, do you think I should store the actual sqlbackup393945.gz etc files as a BLOB inside the DB or just have a reference to the file inside the backup db record?

As with most people, i’ve always kept away from storing images etc as BLOBs so it feels slightly wrong to do it here, but on the flipside, feels ‘neater’ in this case for some reason…

Any thoughts appreciated!

Well the whole idea of having a backup is recovery should something fail, right. Storing a backup, in the very storage area you backed up, seems convoluted, confusing and downright crazy man :stuck_out_tongue:

I would keep a backup gzip file on a remote device mounted at boot, like a external HDD or USB.

Cheers,
Alex