Xuanwo commented on code in PR #2602: URL: https://github.com/apache/incubator-opendal/pull/2602#discussion_r1255652569
########## core/src/docs/rfcs/2602_object_versioning.md: ########## @@ -0,0 +1,102 @@ +Proposal Name: object versioning +Start Date: 2023-07-06 +RFC PR: https://github.com/apache/incubator-opendal/pull/2602 +Tracking Issue: (leave this empty) + +# Summary + +This proposal describes the object versioning (or object version control) feature of OpenDAL. + +# Motivation + +Object versioning is a common feature in many storage services. + +# Guide-level explanation + +What is object versioning? + +Object versioning is a feature that allows users to keep multiple versions of an object in the same bucket. + +It's a way to preserve, retrieve, and restore every version of every object stored in a bucket. + +With object versioning, users can easily recover from both unintended user actions and application failures. + +When object versioning is enabled, each object will have a history of versions. Each version will have a unique version ID, which is a string that is unique for each version of an object. + +The version ID is not a timestamp. It is not guaranteed to be sequential. + +When object versioning is enabled, the following operations will be supported: + +- `stat`: Get the metadata of an object with specific version ID. +- `read`: Read a specific version of an object. +- `delete`: Delete a specific version of an object. + +Code example: + +```rust +// stat with version ID +let meta = op.stat_with("path/to/file").version("version_id").await?; Review Comment: It's better to explain the code a bit, for example: --- To fetch the current version of file: ```rust let meta = op.stat("path/to/file").await?; let current_version = meta.version().expect("just for example"); ``` To get the metadata of specified version of file: xxx To read the data of specified version of file: xxx -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
