As good of a developer you are, you are not immune to data loss, mistake happen either by you or an outside force, so it is important to have a backup strategy in place and this need to be done before you need it.

One of the most popular backup strategy is the 3-2-1 backup strategy, but what does it mean and how can you implement it for almost no cost and effort?

What is the 3-2-1 backup strategy?

The basic concept of the 3-2-1 backup strategy is as follows:

  1. Make three copies of the data to be protected.
  2. Store the copies on two different types of storage media.
  3. Send one copy of the data off-site.

Don’t be too literal

The 3-2-1 backup strategy is a general concept, and depending on your needs, budget and policies, you can adapt it to your needs, for example, I myself try to stick to the concept but my local copy is not necessarily off-site, and my backups are mostly on the cloud.

Triple Copies

The fundamental concept revolves around creating three copies of your essential data. This triple redundancy acts as a robust defense against data loss, providing multiple layers of protection.

One copy is the production data and the other two are backups. The production data is the original data that is actively used by my organization.

Again feel free to adapt this to your needs..

Diverse Storage Media

To ensure integrity of data, these three copies are stored on two different types of storage media. One could be a local disk, while the other could be a cloud storage service.

I use my local computer and two differents cloud storage services, one is Digital Ocean and the other is SnapShooter.

Off-Site Storage

The third element of the strategy involves keeping one copy of the data off site. This off-site storage ensures that even in the face of on-premises disasters or data center compromises, a secure and accessible backup is available for recovery, usually in the cloud.

How to implement it?

Depending how sensitive your data is, and how much you are willing to spend, a lot of different solutions can be used to implement the 3-2-1 backup strategy, but since I myself have a small startup and limited budget, I will show you how I implemented it.

It is also important to make sure that your backup strategy is automated and tested, in case of failure you want to be notified and be able to fix it as soon as possible.

Triple Copies

The first copy is the production data, this production data is stored on a cloud server hosted by Digital Ocean and is itself backed up daily by Digital Ocean for free, this is what I use daily and is the data I work on. (The daily backup by digital ocean is not part of the 3-2-1 backup strategy)

The second copy is a backup and store on SnapShooter, SnapShooter is a service that allows you to backup your Digital Ocean droplets and volumes to a variety of storage providers, I use it for free to backup my production database and files to their own storage.

The third copy is also a backup and is stored on my local machine using a Cronjob that runs every day and download the database and files from my Digital Ocean server for free.

As you can see, except the price you pay for the Digital Ocean server and your computer, the rest is 100% free for a small startup a one backup job.

Diverse Storage Media

2 of the 3 copies are stored on the cloud on different providers and locations, the third copy is stored on my local machine, 1 is physically in my office and the other 2 are in the cloud.

Off-Site Storage

Finally, 2 of the 3 copies are stored off-site, making sure that even in the worst case scenario I can recover my data and since I use two different cloud providers, I am protected against a single point of failure.

Make it automated and simple

What I like about SnapShooter and Digital Ocean is that I don’t have to write a single line of code to make it work, I just need to set it up once from their web interface and it will run automatically every day.

For my CRON job, again I use the simplest solution, Digital Ocean give me a link to download the backup, so I just use wget to download the file and store it in a folder.

Sure you can use their API and a Python script, but can you trust yourself to update in the future ? Are you sure that it is robust enough to handle any failure ?

Pratice the worst case scenario

On a final note, I would like to emphasize the importance of testing your backup strategy and the recovery process, for example, can you restore your data in case of failure? how long does it take? how much data will you lose?

Create a new server, restore your data and services and take note of how long it took you, what was the process and what you struggled with, this will greatly improve your efficiency in case of failure.

Backing up your data is important and it is already a good step, but if you can’t recover your data in a minimal amount of time, then you are not fully protected.

Conclusion:

The 3-2-1 backup strategy is a simple and effective way to make sure that you don’t lose your data, even if you are a small startup with limited budget, you can still implement it for almost no cost and effort.


I hope this article was helpful, if you have any question or suggestion, feel free to reach out to me on :

You can use my articles with no cost or attribution, feel free to edit them and make them your own.