1

I am currently trying to define my backup strategy for my AWS EC2 server. I already use Google Drive to backup my apache root folder. This also automatically doubles as a deployment strategy since the drive folder is linked to my local repo on my home PC.

I was wondering if I could also include the database data directory and have it synced with Google Drive? Or should I rather stick with conventional SQL dumps for backup?

Chris
  • 173
  • 1
  • 5
  • 2
    Why not use Amazon S3 or Glacier for your backups? – joeqwerty Jan 20 '16 at 18:11
  • 1
    "This also automatically doubles as a deployment strategy since the drive folder is linked to my local repo on my home PC." I'm not sure I'd call that a "deployment strategy" for anything important. – ceejayoz Jan 20 '16 at 18:19
  • @ceejayoz ok, let's rather say, Changes to my website will be automatically affect the website hosted on the server – Chris Jan 20 '16 at 19:18
  • @joeqwerty It could be anything like OneDrive, GDrive, Dropbox, etc. I am just not aware of a live sync option for S3. (i.e. software that runs on the server and constantly checks for file changes) – Chris Jan 20 '16 at 19:20
  • @Chris I'm saying any sort of "automatically live sync local to production" is a bad idea for anything important. Typically you'd want some sort of CI in between and a proper deployment process. – ceejayoz Jan 20 '16 at 19:24

1 Answers1

2

Big, constantly changing files as the one backing relational databases are not good candidate for this kind of continuous backup. I strongly advise you to dump your databases (with the relevant utility) and then to upload the dumps on Google Drive.

Also, pay attention that Google Drive does not automatically empty the trash folder. This means that if you rotate your local dumps, deleting the old ones, they will continue to use space on your Google Drive account (in the Trash). So you will need to periodically empty your Trash folder, in a manual or programmatical manner.

shodanshok
  • 44,038
  • 6
  • 98
  • 162
  • I do not really know how DBs save to the file system, but my data folder (PostgreSQL) contains lots of small chunks (few KB), rather than one big file. I assumed that only few of those small parts change during transactions – Chris Jan 20 '16 at 19:26
  • 1
    Sure, but these files are **constantly** changing. Moreover, as your database grows, these files grow with it. – shodanshok Jan 20 '16 at 19:29