The “Barretbyte”

July 20th, 2010 by Barrett Lyon
A number of years ago while I was creating the billing and stats system at BitGravity, I ran into a small conundrum on how to calculate what constitutes a Gigabyte of data. There has been a lot of confusion as to what the policy is for calculating various measures of data transfer, due to the fact that there is no “hard” policy on if a GB is 1000 or 1024 MB.

There are two different definitions of gigabyte in general use:

1,000,000,000 bytes or 10^9^ bytes is the decimal definition, used in telecommunications (such as network speeds) and most computer storage manufacturers (such as hard disks and flash drives). This usage is compatible with SI.

1,073,741,824 bytes, equal to 1024^3^, or 2^30^ bytes. This is the definition commonly used for computer memory and file sizes. (This is equivalent to 1,024 megabytes, where one megabyte is 1,048,576 bytes or 2^30^ bytes.) Since 1999, the International Electrotechnical Commission (IEC) recommends that this unit should instead be called a gibibyte (abbreviated GiB).

I decided to do what was best for the customer and the company by splitting the difference between the two. The billing system ran well and after a year or two another developer Tim Dietrich (whom now works at 3Crowd) coined my measurement as a “Barretbyte”. At first he was rather disturbed and he thought I was over billing customers because of the averaged calculation, so I had to dig out the old code and my thinking and it turns out what we were doing as actually very fair to both the company and the customer.

The Barretbyte is (commonly misspelled as a BarrettByte) is the equivalent of a Gigabyte. It’s symbolized by GbB. The Barretbyte defines a billable Gigabyte as 1000 Megabytes, and a Megabyte as 1024 Kilobytes or 1048576000 bytes.

This is important because if your business is focused on billing in Gigabytes, it’s difficult to decided which one to choose. The GB is 6.87% less data than a GiB. The Barretbyte is somewhere in the middle at 4.63% larger than a GB but smaller than a GiB. As a content delivery network, that difference can cut heavily into the margin of the business. If a Gigabyte is calculated as a GB it harms the customer’s bill by almost 7% and if it’s calculated as a GiB it harms the CDN’s profit margin by nearly the same.

The following chart shows the math that constitutes the conversion between the various units:

8 bits = 1 byte
1024 bytes = 1 Kilobyte (KB) 1,024 bytes
1024 KB = 1 Megabyte (MB) 1,048,576 bytes
1 GB = 1 Gigabyte (GB) 1,000,000,000 bytes
1 GbB = 1 Gigabyte (a.k.a. Barretbyte GbB) 1,048,576,000 bytes
1 GiB = 1 Gigabyte (GiB) 1,073,741,824 bytes

This has become a standard in billing for data transfered at BitGravity, 3Crowd, and a number of other Content Delivery Networks.

Tags: , ,

3 Responses to “The “Barretbyte””

  1. DB says:

    So what happens when you switch to Terabyte measurements?

  2. Barrett Lyon says:

    You run into the same exact problem with Terabyte measurements. There is SI TB and TiB, so one could split the difference.

    What we did was 1TB = 1000 GbB or 1048576000000 bytes

    vs. 1099511627776 bytes with the TiB or just a flat 1000000000000 bytes with the SI TB.

    This becomes a huge issue because the difference between a TiB and TB is nearly 9% which is a major problem for a CDN.

    1000 GbB as the count for 1TB and a TB is only ~5%

  3. Chuck says:

    And that is why all your business partners think you’re awesome!! You’re always looking out for everyone’s best interest instead of just your own.

Leave a Reply