Backblaze B2 Cloud Storage is a highly affordable and scalable cloud storage solution designed for businesses and individuals. It's built on a durable, redundant architecture that ensures your data is safe and always available.
Backblaze B2 was created by the same company that offers Backblaze Personal Backup, a popular online backup service. This means you can trust the technology and expertise behind B2.
B2 Cloud Storage is a cloud storage service that allows you to store and access files over the internet. It's based on a flat-rate pricing model, making it easy to budget and scale your storage needs.
Getting Started
To get started with Backblaze B2, you'll need to create a valid Backblaze account. This is the first step in using B2 as an origin.
You can create a Backblaze account on the Backblaze website. This will give you access to all the features and tools you need to use B2.
To set up and configure B2, you have two options: using the Backblaze web interface or the B2 command line tool. Both methods work for public buckets, but if you want to use private buckets, you'll need to use the command line tool.
For more details on how to install the command line tool, check out Backblaze's B2 documentation.
You can integrate your B2 data buckets with Fastly using either the B2 Cloud Storage API or the S3 Compatible API. The S3 Compatible API is great for existing S3 integrations and SDKs, but keep in mind that buckets created before May 4th, 2020, won't work with this API.
Here are the two APIs you can use:
Authentication and Authorization
You can use your KeyID and ApplicationKey to log in to Backblaze B2, and the application key can be restricted to a single bucket.
This means you can control who has access to your data by limiting the application key to a specific bucket, giving you more flexibility and security.
To log in, simply use your KeyID and ApplicationKey, and you're good to go.
Authenticating Application Key
Authenticating Application Key is a straightforward process that involves using your KeyID and ApplicationKey to log in. You'll need to have these two pieces of information handy.
The ApplicationKey can be restricted to a single bucket, which is a great security feature to limit access to sensitive data. This ensures that even if your ApplicationKey is compromised, it can't be used to access other buckets.
Public
When setting up public access to your files, you have the option to make them available to everyone. This means that anybody can download the files in the bucket.
Setting it to allPublic means that everybody is allowed to download the files in the bucket.
Bucket Management
Bucket Management with Backblaze B2 is surprisingly straightforward. You can edit bucket lifecycle rules to specify after how many days a file in a bucket should be hidden or deleted.
To manage your bucket, you can also add cloud storage as a destination in Retrospect, which has a new set type called "Cloud". This feature allows you to set the maximum storage usage, up to 100TB. If you have an existing bucket, you can type it into "Bucket", otherwise Retrosort will walk you through creating a new one.
Private Bucket Creation
Creating a private bucket is a straightforward process. To start, you'll need to create an application key specific to the bucket, rather than using your master application key.
The Backblaze documentation has more information on application keys, but it's recommended to use the least amount of privileges possible. This means creating a key with only the necessary permissions.
You can optionally set the key to expire after a certain number of seconds, up to a maximum of 1000 days or 86,400,000 seconds. However, if you choose an expiration, you'll need to create a new application key and update your configuration periodically.
The keyID and applicationKey are the two values returned when creating an application key.
Here are the requirements for creating a bucket:
- Must be between 6 and 50 characters long;
- Can only consist of alphanumeric characters or “-”;
- Are case insensitive;
- Are globally unique;
- Cannot begin with “b2-” (reserved for Backblaze use).
Edit Bucket Lifecycle Rules
Editing bucket lifecycle rules is a crucial part of bucket management. You can specify after how many days a file in a bucket should be hidden or deleted.
To effectively manage your files, you should consider setting up bucket lifecycle rules. This will help you maintain a clean and organized bucket.
Files in a bucket can be set to be hidden after a specified number of days, making it easier to manage your storage.
Backblaze B2 Fireball
Backblaze B2 Fireball is a great option for cloud backup, and it's supported by Retrospect Backup. You'll want to create a Cloud Backup Set for the Fireball device, not a Disk Backup set.
Creating a Cloud Backup Set is crucial when integrating Backblaze B2 Fireball with Retrospect Backup. This will ensure your backups are stored securely in the cloud.
Affordable Longterm Storage
You can rent a 5x5 foot storage unit for around $80-$100 per month, which is a relatively affordable option for long-term storage.
In fact, many storage facilities offer discounts for long-term rentals, which can bring the cost down to around $50-$70 per month.
Keep in mind that prices may vary depending on the location and type of storage unit you need.
Some storage facilities also offer climate-controlled units, which can be beneficial for storing sensitive items like electronics or artwork.
These units typically cost around $100-$150 per month, but can be worth the extra cost for the added protection.
It's also worth considering the cost of moving your items to the storage facility, which can add up quickly.
For example, hiring a professional moving company can cost anywhere from $200 to $1,000 or more, depending on the distance and weight of your items.
However, if you have a lot of heavy or bulky items, it may be worth the extra cost to hire professionals to avoid straining your back.
In contrast, renting a portable storage container can be a more affordable option, with prices starting at around $100-$200 per month.
These containers can be delivered to your home and then picked up by the storage company, making it a convenient option for long-term storage.
Adding Cloud Storage with Backblaze
You can create an application key from the command line to use with Backblaze B2 (S3 API). Run the create-key command with the name of the bucket and key you created.
To add cloud storage as a destination, Retrospect has a new set type called "Cloud". Create a new backup set/media set and select "Cloud" as the type.
You'll need to enter your cloud storage credentials. Retrospect will walk you through creating a new bucket if you leave the "Bucket" field blank.
The maximum storage usage is up to 100TB.
Large File Uploads and Storage
Large file uploads and storage are a breeze with Backblaze B2. You can upload files up to 10GB in size.
Retrospect makes it easy to add cloud storage as a destination, allowing you to set a maximum storage usage of up to 100TB. This is useful for large file storage needs.
If you have an existing bucket, you can type it into the "Bucket" field, otherwise, leave it blank and Retrospect will walk you through creating a new one. This makes it easy to get started with cloud storage.
Integration and Compatibility
To use the S3 Compatible API with public objects, you need to set the Host header to include your B2 Bucket name and region. For example, if your B2 Bucket is named "testing" and your region is "us-west-000", the Host header should be set to "testing.s3.us-west-000.backblazeb2.com".
You can achieve this by creating a VCL Snippet in your Fastly service. To do this, you'll need to select within subroutine and choose miss as the subroutine type. Then, populate the VCL field with the code, making sure to change the bucket and region values to match your own B2 Bucket.
To use the S3 Compatible API with private objects, you'll need to implement version 4 of Amazon's header-based authentication using custom VCL. This involves obtaining your B2 Bucket name, region, access key, and secret key from Backblaze.
Here's a summary of the required information for private bucket authentication:
Via the Web
To create an application key, click on App Keys in the B2 web interface.
You'll then see an option to Add a New Application Key, which you should click on.
The Add Application Key controls will appear, and you'll need to fill out the required fields.
Click Create New Key to generate the key.
The success message will display the keyID and applicationKey, which you should immediately note down.
S3 Compatible API with Private Objects
To use the S3 Compatible API with private objects, you'll need to implement version 4 of Amazon's header-based authentication. This requires creating a custom VCL snippet in Fastly.
First, obtain the necessary information from Backblaze, including the bucket name, region, access key, and secret key. The access key is the Backblaze keyID for the App Key that has at least read permission on the bucket. The secret key is the Backblaze applicationKey paired with the access key.
You can then configure your Fastly service to authenticate against your B2 bucket using header authentication by calculating the appropriate header value in VCL. This involves creating a regular VCL snippet and populating the VCL field with specific code, changing the values as noted to match your own AWS bucket.
The code will look something like this:
```
declare local var.b2Bucket STRING;
declare local var.b2Region STRING;
set var.b2Bucket = "YOUR_B2_BUCKET_NAME";
set var.b2Region = "YOUR_B2_BUCKET_REGION";
if (req.method == "GET" && !req.backend.is_shield) {
set req.http.host = var.b2Bucket ".s3." var.b2Region ".backblazeb2.com";
}
```
Make sure to replace `YOUR_B2_BUCKET_NAME` and `YOUR_B2_BUCKET_REGION` with your actual bucket information.
If you're using Retrospect to back up your data, you'll need to use the Application Key ID (keyID) and the Application Key (applicationKey) for authentication. The path to your bucket will be in the format `s3.us-west-001.backblazeb2.com/your_bucket_name`.
Frequently Asked Questions
How much does Backblaze B2 upload cost?
There is no charge to upload data to Backblaze B2, but storage charges apply after the first 10GB.
Is Backblaze B2 good?
Backblaze B2 is a cost-effective option for cloud storage, but its limited features and slower speeds may not meet the needs of all users. Consider its simplicity and affordability when deciding if Backblaze B2 is right for your cloud storage needs.
Sources
- https://docs.cyberduck.io/protocols/b2/
- https://docs.fastly.com/en/guides/backblaze-b2-cloud-storage
- https://pawitp.medium.com/good-bye-backblaze-backup-hello-b2-bc0e361ee576
- https://docs.retrospect.com/docs/cloud-backup-how-to-set-up-backblaze-b2-s3-api-for-cloud-backup
- https://www.podfeet.com/blog/2017/08/b2-backblaze/
Featured Images: pexels.com