DEV Community

JA Proger
JA Proger

Posted on

VolBack: Backup tool Part 1

Intro

VolBack?
What's it?
I started to think about potential sum of volumes of everyday backups.
Backup is a full copy of the system for a unit of time (UT).
We know that this is of the most important backend parts of any computer system.
We know that backups have weaknesses... There's only one — duplication. Funny thing is that duplication in the case of backups is essential.

Math section

Imagine we have a CRM, which has a lifetime of 3 days.
We need to backup it each day.

  • Day 1. We added 100 mb
  • Day 2. We added 50 mb
  • Day 3. We added 30 mb

What does it mean?

  • Backup for day 1: 100 mb
  • Backup for day 2: 100 mb + 50 mb =150 MB
  • Backup for day 3: 150 mb + 30 mb =180 MB

Nice!

So the total backup volume will be: 100 mb + 150 mb + 180 mb =430 MB.

To handle this calculations I find a mathematical formula for this process.

Sn=nx1+i=1n1(ni)ai,n>1 S_n = n \cdot x_1 + \sum_{i=1}^{n-1} (n - i) * a_i, n > 1

Where:

  • n: quantity of UT (second, hour, day, etc)
  • x1x_1 : initial value of volume at first UT
  • a: array of a values (additions in volume at each IT)

Development

I will expand this method in case when we don't now additions' values.

Watch the repository https://github.com/ja-proger/VolBack. Now available on Swift
Write down any ideas in the comments below!

Top comments (0)