Basic concepts of OSS
This topic describes the basic concepts of Object Storage Service (OSS). Understanding these concepts will help you use the product more effectively.
Bucket
A bucket is a container used to store objects. All objects must belong to a bucket. A bucket has various configuration properties, including its region, access permissions, and storage class. You can create different types of buckets to store different data based on your needs.
A bucket has a flat structure and does not have the concept of file system directories. All objects belong directly to their corresponding bucket.
Each user can own multiple buckets.
Bucket names must be globally unique within OSS. After a bucket is created, its name cannot be changed.
NoteGlobally unique means that bucket names created by all Alibaba Cloud users must be unique. For example, if a user creates a bucket named `example`, no other user can create a bucket with the same name.
There is no limit to the number of objects in a bucket.
Bucket names must follow these naming rules:
Contain only lowercase letters, numbers, and hyphens (-).
Start and end with a lowercase letter or a number.
Be between 3 and 63 characters in length.
Object
An object, also known as a file, is the basic data unit in OSS. Unlike traditional file systems, objects do not have a hierarchical folder structure. An object consists of metadata (Object Meta), user data (Data), and a key (filename). An object is uniquely identified by its key within a bucket. Object metadata is a set of key-value pairs that describe object properties, such as file type and encoding. You can also store custom information in the metadata.
The lifecycle of an object starts when it is uploaded and ends when it is deleted. During its lifecycle, the content of an object uploaded by methods other than append upload cannot be edited. You can append data to an object that was created by an append upload. To modify an object, you must overwrite it by uploading a new object with the same name.
Object names must follow these naming rules:
Use UTF-8 encoding.
Be between 1 and 1,023 characters in length.
Cannot start with a forward slash (/) or a backslash (\).
NoteObject names are case-sensitive. Unless otherwise specified, the terms "object" and "file" are used interchangeably in this topic.
ObjectKey
In SDKs for various languages, ObjectKey, Key, and ObjectName are synonymous. They all refer to the name of an object that you specify for an operation. For example, when you upload an object to a bucket, the ObjectKey is the full name of the object, which includes the full path and file extension, such as abc/efg/123.jpg.
Object types
Objects are classified into the following three types:
Normal
A Normal object is created by a simple upload. After the upload is complete, the object's content is fixed and can only be read. To change the content, you must upload a new object with the same name to overwrite the existing one. Simple upload is suitable for uploading a single file smaller than 5 GB in a single HTTP request. For more information, see Simple upload.
Multipart
A Multipart object is created by a multipart upload. After the upload is complete, the object's content is fixed and can only be read. To change the content, you must upload a new object with the same name to overwrite the existing one. Multipart upload is suitable for scenarios such as accelerating large file uploads, poor network conditions, or when the file size is uncertain. For more information, see Multipart upload.
Appendable
An Appendable object is created by an append upload. An append upload lets you append data to the same object as soon as the video data is generated. Append upload is suitable for real-time video stream scenarios, such as video monitoring and ApsaraVideo Live. For more information, see Append upload.
Objects cannot be converted between types. For example, a Normal object cannot be converted to a Multipart or Appendable object.
Region
A region is the physical location of an OSS data center. You can choose a region to create a bucket based on factors such as cost and the source of your requests. A region that is geographically closer to your users generally provides faster access. For more information, see Regions supported by OSS.
The region is specified when a bucket is created and cannot be changed later. All objects in a bucket are stored in the data center of the specified region. You cannot set regions at the object level.
Endpoint
An endpoint is the domain name used to access OSS. OSS provides services through HTTP RESTful APIs. You must use different endpoints to access OSS in different regions. The endpoints for accessing the same region over the internet and an internal network are also different. For example, the internet endpoint for the China (Hangzhou) region is oss-cn-hangzhou.aliyuncs.com, and the internal network endpoint is oss-cn-hangzhou-internal.aliyuncs.com. For more information, see Endpoints for each region.
AccessKey pair
An AccessKey pair, also known as an AK, consists of an AccessKey ID and an AccessKey secret used for identity verification. OSS uses the AccessKey ID and AccessKey secret for symmetric encryption to verify the identity of a request sender. The AccessKey ID identifies the user. The AccessKey secret is a key that you use to encrypt signature strings, which OSS then uses to verify the signature. You must keep your AccessKey secret confidential. For OSS, an AccessKey pair can be obtained from one of the following sources:
An AccessKey pair that belongs to the bucket owner.
An AccessKey pair granted to a third party by the bucket owner through RAM authorization.
An AccessKey pair granted to a third party by the bucket owner through Security Token Service (STS).
For more information about AccessKey pairs, see Create an AccessKey pair.
Atomicity and strong consistency
Atomicity
Object operations in OSS are atomic. An operation either succeeds or fails. An object does not have an intermediate state. When an object is uploaded, OSS ensures that the object you read is complete. OSS does not return a partially uploaded object.
Strong consistency
Object operations in OSS provide strong consistency. When you receive a successful response for an upload (PUT) operation, the uploaded object is immediately available for read operations, and its redundant data has been successfully written. An upload does not have an intermediate state. This means you can immediately read data after a write operation. For a delete operation, after you successfully delete a specified object, it immediately ceases to exist.
Data redundancy mechanism
OSS uses an erasure coding-based data redundancy mechanism to ensure data durability and availability in the event of hardware failure.
OSS object operations provide strong consistency. When you receive a successful response for an upload or copy operation, the object is immediately available for read operations, and its data has been redundantly written to multiple devices.
OSS calculates the checksum of network traffic packets to verify whether errors occurred during transmission between the client and the server. This process ensures complete data transfer.
The OSS data redundancy mechanism can prevent data loss even if two storage facilities are damaged at the same time.
After data is stored in OSS, OSS detects and repairs lost redundancy to ensure data durability and availability.
OSS periodically verifies data integrity using methods such as checksums to promptly detect data corruption caused by hardware failures or other reasons. When partial data corruption or loss is detected, OSS uses redundant data to reconstruct and repair the damaged data.
OSS glossary
English | Chinese |
Bucket | Bucket |
Object | Object or file |
Endpoint | OSS domain name |
Region | Region or data center |
AccessKey | A collective term for AccessKey ID and AccessKey secret. An AccessKey pair. |
Put Object | Simple upload |
Post Object | Form upload |
Multipart Upload | Multipart upload |
Append Object | Append upload |
Get Object | Simple download |
Callback | Callback |
Object Meta | File metadata. Describes file information, such as file type and encoding. |
Data | File data |
Key | Filename |
ACL (Access Control List) | Permissions of a bucket or file |
Unless otherwise specified, the English and Chinese terms that appear in this topic and in the glossary have the same meaning. In some scenarios, they are used interchangeably for convenience.