The Simple Upload, Form Upload, and Multipart Upload methods create normal-type objects which have fixed content after the upload is finished. They can only be read, but cannot be modified. If the object content changes, the user must upload an object of the same name to overwrite the content. This is a major difference between OSS and file systems.
This feature makes many application scenarios inconvenient, such as video monitoring and live video broadcast, since video data is constantly produced in real time. Using other upload methods, users must slice the video stream into small pieces and then upload them as new objects. In actual use, these methods have obvious defects:
- The software architecture is quite complex and users must consider intricate issues such as file fragments.
- Storage space is required for metadata, e.g. the list of generated objects. Thus, each request must read the metadata to judge if any new object has been generated. This puts a high level of access pressure on the server. In addition, each client request must be transmitted twice, causing a certain amount of delay.
- If the object parts are small, the delay is quite short. However this complicates the management of most objects. If the object parts are large, the data suffers a substantial delay.
To development and reduce costs in such a scenario, OSS provides the append object method, which allows users to directly append content to the end of an object. This method is used to operate on Appendable objects. The objects uploaded by other methods are Normal objects. The data appended is instantly readable.
With append object, the previous scenario becomes simple. When video data is produced, they can be immediately added to the same object through the append object method. The client only needs to regularly retrieve the object length and compare it with the previous value. If new readable data is found, this triggers a read operation to retrieve the newly uploaded data segments. This method greatly simplifies the architecture and enhances the scalability of applications.
In addition to video scenarios, the append object method can also be used to append log data.
- Size limit: The maximum object size is 5 GB in this mode.
- Naming restrictions
- It uses UTF-8 encoding.
- The length must be 1-1,023 bytes.
- It cannot start with “/“ or “\”.
- File type: Only files created through append object can be appended with new data. Therefore, new data cannot be appended to files created through simple upload, form upload, or multipart upload.
To prevent unauthorized third parties from uploading objects to the developer’s bucket, OSS provides bucket- and object-level access permission control. For more information, see Access Control.
In addition to bucket-level and object-level access permissions, OSS also provides account-level authorization to authorize third-party uploads. For more information, see Authorized Third-party Upload for Upload Security.
NOTE: Append object method does not support upload callback.