HUAWEI CLOUD Agent: OBS Novice Guide to HUAWEI CLOUD Object Storage Service
Many novices who have just come into contact with cloud computing feel inscrutable when they hear the words "object storage" when looking for places to "store pictures, videos and static files" for websites, App or applets.
In fact, it is not as mysterious as the marketing concept. Today, the old bird will use the most down-to-earth vernacular to take you through Huawei cloud.
Object Storage Service (Object Storage Service)
. After reading this article, you can not only understand its underlying logic, but also learn how to match the most economical and how to prevent sky-high bills.
Part I: What is OBS in the vernacular of life?
Usually we use computers, files are put in "folders", this is called
File storage
. Folder layer by layer, once the file reaches millions, tens of millions, the computer can find a file stuck.
However, HUAWEI CLOUD OBS uses
Object Storage
Architecture, you can think of it as a "super infinite, flat network disk".
In the world of OBS, there are only two core concepts:
Bucket: The root directory of your network disk. You can create many buckets, such as one for website images (my-web-img) and one for backup data (my-db-backup).
Object: Each file (picture, video, document, etc.) in the bucket is called an object. It doesn't have a deep folder like a doll, all files are tiled in a bucket, and each file has a globally unique URL access link.
Old Bird's vernacular: Whether you plug 10 pictures or 10 billion pictures into OBS, its speed of finding files is millisecond, and it will not be stuck because of more files. Moreover, it has no limit on capacity. You can hold as much data as you like.
The second part: novice must know: four storage categories, wrong choice is a waste of money!
When creating a bucket or uploading a file in HUAWEI CLOUD OBS, the system allows you to select
Storage Category
. Many novices choose the default with their eyes closed. As a result, the meat hurts when the bill comes at the end of the month.
HUAWEI CLOUD OBS provides four main storage levels, and their costs and applicable scenarios are highly unpredictable:
Storage Category
What is suitable for saving?
Billing Features
Old Bird Popular Translation
Standard Storage (Standard)
Website hot pictures, short videos, app avatars and other data that are frequently accessed every day.
The unit price of storage is the highest, but read and write requests and traffic are cheap, and there is no minimum storage time limit.
"Convenience store on the main road" can be taken at any time, which is the most convenient.
Low frequency access storage (IA)
Enterprise network disk files, monthly reports, although not often read but need to get the data immediately.
The storage unit price is lower than the standard, but there is a 30-day minimum storage period. If it is saved for less than 30 days, it will be deleted, and the money will be calculated for 30 days. Small files smaller than 64KB
Also calculated by 64KB.
"The storeroom at home", once in a while to go through.
Archive Storage (Archive)
Medical imaging, surveillance video from one year ago, quarterly/annual financial audit files.
Storage unit price is very low, with a minimum storage period of 90 days. The data cannot be read directly. You need to click "Restore" (wait a few minutes to a few hours to unfreeze) before downloading.
"The outer suburban warehouse in the suburbs" has to make an appointment in advance and charge "handling fee (data recovery fee)".
Deep Archive Storage (Deep Archive)
Legal compliance requires that bone-level data be retained for 5-10 years, but almost never read.
The storage unit price is the lowest, but there is a minimum storage period of 180 days, and it takes several hours to unfreeze.
"Air raid shelter underground safe", not extremely special circumstances absolutely do not move it.
The third part: actual combat: OBS anti-bankruptcy, anti-theft brush "life-saving" configuration.
Object storage is
Charge by volume
Of it. In addition to the storage space itself, the "public network outflow traffic" generated by users downloading files through the public network"
, and read and write operations
The "number of requests" is charged.
There are a large number of malicious crawlers and chain theft scripts on the Internet. If your OBS bucket is completely "streaking" and someone brushes the picture tens of thousands of times in one night, you may receive a large bill. The following two settings are the novice's "life-saving symbol":
Line 1: Never blindly set the bucket permissions to "public reading and writing"
Private (Private): The default is the most secure. Everyone who wants to see the document must have a signature.
Public Read: If you want to make a website map bed, you can choose this. Everyone is allowed to see it, but not to change it.
Public Read/Write: Unless you are out of your mind, you should never choose! Once turned on, it means that anyone in the world can not only read your documents, but also stuff garbage into your bucket, even delete all your data, and make you bear sky-high bills.
Line two: open the "anti-theft chain (Referer access control)"
Many malicious websites like to directly copy the image links in your OBS and post them on their own web pages. In this way, when their users access, they consume the public network traffic of your HUAWEI CLOUD OBS.
Life-saving configuration: go to the OBS bucket console $\rightarrow $advanced settings $\rightarrow $anti-theft chain.
In the whitelist, only fill in your own website domain name (such as * .yourdomain.com).
Check "No Empty Referer" (so that others cannot open the URL of the picture directly entered in the browser and it can only be displayed on your website). In a word, completely eliminate the thief website rub your traffic.
The fourth part: make good use of the "life cycle" and let the file learn to "grow old"
Many teams built the most
The headache is that the old data are accumulating and the hard disk is full every day, so it has to be deleted manually.
OBS comes with an advanced automated butler--
Lifecycle Management (Lifecycle Management)
. You only need to match the bucket with a rule in the background, and the data can "grow old" and save money:
[just uploaded picture] ─ ─ ─ (automatic transfer after 30 days) ─ ─▶[Low frequency access storage]-(automatic rotation after 90 days)-▶[Archive Storage]-(180 Days Later)-▶[Complete automatic destruction]
For example you can set:
After the surveillance video is uploaded, it is stored as standard storage for the first 30 days (because the probability of being retrieved during this period is the highest).
More than 30 days, automatically switch to low-frequency access storage (reduce storage unit price).
After 90 days, automatically switch to archival storage (costs plunge further).
For more than 365 days, it will be deleted automatically and completely without taking up any unnecessary space.
Fully automated operation, do not need you to write a line of code, the monthly storage bill is naturally pushed to the lowest.
Summary
For novices, HUAWEI CLOUD OBS is not an unattainable black technology. Think of it as a
Cloud-connected, unlimited capacity, automatic money-saving, ultra-large hard drives with protective shields
That’ll do.
Store static resources and high-frequency avatars of websites: create a "standard storage" bucket and set up an anti-theft chain for ease of use.
Store large-capacity backups, logs, and monitoring: Create a "low-frequency access" or "archive" bucket, match the "life cycle" rules, and let it lie quietly.
After clarifying its billing logic and doing a good job of anti-theft brush, Huawei Cloud OBS is definitely the most solid and reassuring money-saving weapon when you do full stack development and website operation and maintenance.
