Restic backup for a strong and reliable infrastructure
There are two categories of people: those who make backups, and those who don’t… yet.
The need for backup
In a world dependent on digital information, backing up your files is a clear necessity.
There are many solutions to backing up, from a simple copy-paste to an external storage device to more complex and commercial backup solutions like Acronis. In theory, the main action of copying files is the same in most cases, the difference is in the communication with the backup device and the ways the system is configured. You should always go for the most reliable solution which should be safe(encrypted) and hardy.
In our case, we opted for Minio s3 object storage as a basis for a solid backup system.
It is a free, open-source s3 object storage solution.
3-2-1 backup strategy
In this post, we describe how to make a backup. Nevertheless, the entire back upping system must be a bit more complex than the periodical copying the data from A to B. The time-proved rule of backing up your data is the strategy 3-2-1.
The backup plan must be the following:
3: You must have 3 copies of all your important data
2: Two of those backups must be on different storage media, at the best glance physically distributed
1: At least one of the copies must be offsite – somewhere physically remote from other copies
Please also remember – cloud is just a computer. If you rely on iCloud or Google Drive – it is just one copy. So you require at least two more.
The solutions, which are the subject of this blog post are simply tools. A correct usage may be implemented for Example using the mentioned 3-2-1 strategy.
How we select candidates
There are a lot of backup tools available. Choosing the right one can be tricky. We were looking for easy-to-use tools with a simple architecture. Important also was to minimize costs of backing up – so the favor was given to free, open-source solutions. We did an investigation of recent blog posts and reviews on the mentioned topic.
Why do we choose Restic over Duplicacy or Kopia?
Frontal comparison of backup tools
Tool | Initial backup, h:m:s | Increment, m:s | Backup Size, GB | Deduplication ratio, % |
Kopia | 0:19:20 | 1:45 | 213 | 27-30 |
Restic | 0:50:00 | 6:06 | 211 | 28-30 |
Duplicacy | 1:26:43 | 10:05 | 170 | 41-42 |
Duplicacy
Initial backup
- 267G /home
- 158G /user/backup/duplicacy/
- 279,640,892 / 165,118,848 ⇒ 0.59
- Deduplication Ratio = 1 – 0.59 = 0.41
Executed in
Average Memory Usage
Increment 30 GB
- 292G /home
- 170G /user/backup/duplicacy
- 178,094,988 / 305,394,604 ⇒ 0.58
- Deduplication Ratio = 1 – 0.58 = 0.42
Executed in
Kopia
Initial backup
- 268G /home
- 188G /user/backup/kopia
- 196,618,832 / 280,653,672 ⇒ 0.70
- Deduplication Ratio = 1 – 0.7 = 0.3
Executed in
Average Memory Usage
Increment 30 GB
- 292G /home
- 213G /user/backup/kopia
- 222,926,632 / 305,370,780 ⇒ 0.73
- Deduplication Ratio = 1 – 0.73 = 0.27
Executed in
Restic
Initial backup
- 268G /home
- 187G /user/backup/restic
- 195,093,008 / 280,783,604 ⇒ 0.70
- Deduplication Ratio = 1 – 0.7 = 0.3
Executed in
Average Memory Usage
Increment 30 GB
- 292G /home
- 211G /user/backup/restic
- 220,534,196 / 305,370,268 ⇒ 0.72
- Deduplication Ratio = 1 – 0.72 = 0.28
Executed in
Restic backup solution fits us better
As we can see Kopia is the fastest while Duplicacy has the biggest deduplication ratio.
Duplicacy has the least CPU usage and Restic has the most.
So just by comparing these performance stats, we could say that Kopia being the fastest and having less load on the memory than Restic, is the best solution.
However, we must take into consideration the user-friendly side of things:
- Duplicacy is not free and has a weak community.
- Kopia and Restic come with free documentation however I would say that Restic has the most resources and example deployments.
- Duplicacy and Kopia support compression, Restic unlike the other two don’t, however as a workaround it allows you to take the output of a compressed file as a stdin and back it up.
- Restic lacks a GUI interface.
In conclusion, Duplicacy is slow, you need to pay to use it and the logic behind it is a bit complicated.
Restic and Kopia are quite similar:
- free
- easy to use
- lightweight
- good community support
So it is between Kopia and Restic.
Kopia seems to be very efficient and offers a lot of features, however, it is just starting to get popular and developers just recently announced a steady release.
So for now we will keep using Restic and keep an eye on Kopia’s development.
We deployed Restic and we explain below how we structured it.
Deployment of Restic backup
We automated the task using Ansible and systemd ( cron would be the other option) services and timers, and it functions smoothly. Automation can be easily done using environmental variables which Restic supports apart from the CLI commands. Another point that makes things easier is using tags. You can mark your backups with tags and then restore them accordingly. For example, If I want to restore only backups from Server 2, I can tag the backups with the hostname of Server 2.
If you want to back up only selected folders or even types of files, Restic has you covered. It has command options to exclude or include certain folders or types of data, very useful! Also, Restic uses encryption and everyone who has the password for the backup can access it. Simple and safe.
Also limiting the bandwidth according to your needs comes in handy when you want to avoid congestion.
Restic is an excellent backup tool that will take care of your backup needs.
It is secure, fast, and adjustable you should give it a try.
Check out our Ansible role for deployment of Restic with a rich variety of settings
If you have questions or need support in managing your backups, simply contact us!