In Object Storage Service (OSS), an object serves as the fundamental unit for data storage, functioning similarly to a file. Files, including documents, images, and videos, uploaded to OSS are stored as objects within OSS buckets for further management.
Components of an object
Key: the name of the object. An object key acts like a file path and is globally unique. It is used to query the object. We recommend that you specify proper names for objects for efficient management. For information about the naming conventions, see Object naming conventions.
Data: the content stored within an object. Similar to file content, object data can be any sequence of bytes and may vary in length.
Object metadata: the metadata of the object. It consists of key-value pairs that define attributes, such as the last modification time and size of the object. Object metadata also supports the storage of custom information.
Version ID: the unique identifier assigned to an object version. To store multiple versions of an object, you must enable versioning. When an object with the same name is uploaded, OSS generates a distinct version ID for the new version. This ID allows you to access and manage a specific version of the object.
Aliases for keys
In OSS SDKs for different programming languages, object keys may be referred to by different aliases, such as ObjectKey, ObjectName, or object name. When specifying an object key, you must include the full path, such as exampledir/example.jpg. To simplify understanding, the term "object name" is used to describe the last segment of the key path. In the given example, the object name is "example.jpg".
Display of OSS directories
In OSS, traditional file system concepts like files and folders do not exist. To enhance user experience, forward slashes (/) are used in object keys to mimic a folder structure, such as exampledir/example.jpg. The given example simulates exampledir as a folder and example.jpg as a file within exampledir. This folder-like structure is visible in the OSS console and graphical tools like ossbrowser. However, the object key remains exampledir/example.jpg. For more information, see Manage directories.
Object types
Objects can be categorized into four types based on their creation methods. The following table describes these four types.
You cannot change the type of an object. For example, you cannot convert a normal object into a multipart object or an appendable object.
Type | Creation method | Description |
Normal | Objects of this type are created by using simple upload. |
|
Multipart | Objects of this type are created by using multipart upload. |
|
Appendable | Objects of this type are created by using append upload. | When data is appended to an appendable object, OSS does not create a new version of the object, regardless of the versioning status. The data is directly appended to the original object. |
Symlink | Objects of this type are created by using symbolic links created by calling the PutSymlink operation. | You can use symbolic links to access objects that are frequently accessed. |
Delete markers
OSS uses a special type of object marker called delete marker. When you call the DeleteObject operation to delete an object in a versioning-enabled or versioning-suspended bucket, OSS generates a delete marker for the object. If no version ID is specified during deletion, OSS assigns the delete marker as the latest version of the object. This ensures the data in the object is preserved and can be restored even after deletion. However, if a version ID is specified, OSS deletes the specific version and does not generate a delete marker.
Features
Upload objects
Feature | Description |
Simple upload enables you to call the PutObject operation to upload a single object of up to 5 GB in size. This feature is ideal for scenarios where the object can be uploaded in a single HTTP request. | |
Multipart upload allows you to split an object into multiple parts and upload them separately. Once all parts are uploaded, call the CompleteMultipartUpload operation to merge them into a complete object. | |
When using resumable upload to transfer objects to OSS, you can designate a checkpoint file. This file tracks the progress of the upload task. If the upload is interrupted by a network issue or program error, the task can resume from the last recorded progress in the checkpoint file, allowing the remaining data to be uploaded. | |
After you upload an object, OSS can send a callback request to your application server. To enable upload callback, simply include the necessary callback parameters in the upload request sent to OSS. | |
A direct client upload enables data to be uploaded directly from clients to OSS. This feature enhances upload speed and decreases server resource consumption by eliminating the need to route objects through the application server. | |
You can use the PostObject operation to upload objects of up to 5 GB in size by using an HTML form. | |
You can use append upload to add content to an appendable object. | |
You can use the Real-Time Messaging Protocol (RTMP) to ingest H.264-encoded video streams and AAC-encoded audio streams into OSS. The uploaded audio and video data can be played on demand or utilized for livestreaming in scenarios where latency is not a critical factor. |
Download objects
Feature | Description |
Simple download enables you to use the GetObject operation to retrieve an object. This feature is ideal for scenarios where the object can be downloaded in a single HTTP request. | |
Resumable download allows you to download data from a specific position within an object. For large objects, you can divide the object into multiple parts and download them at different times. If a download task is interrupted, you can resume it from the point where it was paused. | |
You can grant third-party users the permissions to download an object by issuing temporary access credentials or a signed URL, ensuring the AccessKey pair of the object owner account remains secure and is not exposed. | |
After uploading objects to a bucket, you can share their URLs with third parties to allow downloads or previews. | |
Objects are downloaded only if their content has changed, determined by the last modified time or ETag. This feature ensures downloads are triggered solely when updates occur, avoiding unnecessary repeated downloads. |
Manage objects
Feature | Description |
By default, listing objects in a bucket returns them in alphabetical order. You can list all objects in a bucket, objects with a specific name prefix, or a limited number of objects. | |
You can copy an object from a source bucket to a destination bucket within the same region without modifying the object content. | |
You can rename an object in a bucket. | |
If a bucket contains a large number of objects, you can search for objects by using a prefix. | |
Before accessing an object in Cold Archive or Deep Cold Archive, you must initiate a restoration process for the object. | |
You can delete unwanted objects from your OSS buckets by using various methods. | |
You can use object tags to classify objects. These tags enable you to set up lifecycle rules and access control lists (ACLs) for objects sharing the same tag. | |
You can use symbolic links to access objects that are frequently used in buckets. You can use symbolic links to access frequently used objects in buckets. After setting up a symbolic link for an object, you can use the link to access the object quickly. A symbolic link operates like a Windows shortcut. | |
Object metadata defines the attributes of an object and consists of standard HTTP headers and user metadata. Standard HTTP headers can be configured to establish custom HTTP request policies, such as cache control or forced download policies. User metadata can be configured to specify the purpose or attributes of objects. | |
Accessing objects in OSS by using a client, particularly when traffic throttling is challenging to implement, can consume substantial bandwidth. This may negatively impact other applications accessing OSS. To prevent this, use the single-connection bandwidth throttling feature to limit bandwidth for operations like object uploads and downloads. This ensures sufficient bandwidth for other OSS applications. | |
You can use the SelectObject operation to execute SQL statements on an object and retrieve the results. | |
If you no longer require specific parts that are not uploaded during multipart upload, you can call the AbortMultipartUpload operation to delete the parts. | |
To enable multiple users to access resources in an OSS bucket from different locations and devices, you can use Cloud Storage Gateway (CSG) to map the OSS bucket to a shared file storage system. This allows users to perform operations on OSS resources as they would with local files and disks. |