vishal

Posted on

# Back Of The Envelop Estimation

Back of the envelop estimation is exactly what the name implies “Back Of The Envelop”. Back-of-the-envelope (BOE) estimation is a quick and approximate method of estimating an unknown value.

The method is based on using simple and rough approximations, along with basic mathematical operations and known values, to estimate an unknown value. For example, you may use proportions, ratios, and order-of-magnitude calculations to estimate a value, rather than using complex formulas or exact measurements.

A “back of the envelope” (BOE) estimation is a rough calculation that is often used in the early stages of system design to quickly estimate the order of magnitude of a quantity or to gain a rough understanding of the feasibility of a project. BOE estimates are not intended to be precise, but they can provide valuable information that can guide further research and development.

Let’s say you want to design a new application something like Youtube, You need to be aware of the rough estimations for speed, throughput, or capacity.

For this blog, we’ll understand how BOE can be used to estimate the resources that are required, the amount of storage that we required, the throughput that we are targeting and how scalable the system needs to be.

## Power of two

For calculating the data volume , we can use something called Power of 2. One bit represent the smallest unit of memory in computer, A byte is made up of 8 bits and 1024 bytes made up a kilobyte.

## Example

Let’s say you are designing a system for a large company that is basically like YouTube. They have large user base , each users can upload videos of any size and view video. Here are some numbers:

Let’s understand how much data is being uploaded to the server each day and what will be the QPS for the system to process.

• Daily active users : 1 billion
• Daily video upload 100 million( let’s say 10% of users upload )
• Average user upload 1 video a day
• Average video size: 500MB

Use these numbers, Let’s quickly create a BOE estimation

## Estimation

Query per second (QPS) estimation:

• we have 1 billion DAU.
• 10% of the user uploads 1 video per day
``````Daily uploaded video = 1 billion * 10%= 100 million

Query per second = (100 million * 1 video ) / 24 hours / 3600 seconds = ~1200 (approx)

Peek QPS = 2 * QPS = ~ 2400
``````

We’ll have 2400 requests per second in peek hours.

Let’s estimate media storage:

• We have 1 billion DAU
• Each user uploads 1 video per day
• Each video has 500MB of size.
``````Daily users uploaded video = 1 billion * 10%= 100 million

Media storage per day = 100 million * 1(videos a day)* 500MB= 50 PB(Petabyte) storage

Media storage per year = 50 PB * 365 = 19 exabyte per year

``````

we need 19 exabyte of storage to store media for a single year.

Back-of-the-envelope estimation is all about the process. Solving the problem is more important than obtaining results

## Power of 10

It is difficult to perform complicated math operations during the estimation. For example, what is the result of “99987 / 9.1”? There is no need to spend time to solve complicated math problems. Precision is not expected. Use round numbers and approximation to your advantage. The division question can be simplified as follows: “100,000 / 10”

In estimation, a power of 10 refers to a factor of 10 that is raised to a certain exponent. For example, 10³ (10 to the 3rd power) is equal to 1,000. This concept is often used to express very large or very small numbers in a more manageable form.

```For example, instead of writing out 0.000000001, it can be written as 10^-9 (10 to the -9th power). This makes it easier to perform calculations and to understand the order of magnitude of a number. ```

## The rule of 72

The Rule of 72 is a quick way to estimate the number of years it will take for an investment to double in value given a fixed annual rate of return. It works by dividing 72 by the annual rate of return as a percentage.

How this is valid in our case, the rule of 72 can be used to calculate the time when our traffic can be double for the platform.

let say our application is growing with a pace of 8% per month. so we can use this rule to calculate how much time it will take to double the traffic for our app.

`72/8 = 9 month`

It will take 9 months to double the traffic with this 8% increase in traffic each month.

It’s important to note that the Rule of 72 is only an approximation and it only works with fixed rate of change.

In conclusion, Back of the envelop estimation can help you in figuring out a rough estimation for your storage, load on server so that you can plan things accordingly before designing your systems.