Xuanwo commented on code in PR #2602:
URL: 
https://github.com/apache/incubator-opendal/pull/2602#discussion_r1254431614


##########
core/src/docs/rfcs/2602_object_versioning.md:
##########
@@ -0,0 +1,78 @@
+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. 
+
+With object versioning, users can:
+
+- Track the history of an object.
+- Implement optimistic concurrency control.
+- Implement a simple backup system.
+
+# Guide-level explanation
+
+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.
+- `list`: List all versions of an object.
+
+Those operations with object version are different from the normal operations:
+
+- `write`: when writing an object, it will always create a new version of the 
object than overwrite the old version. But here it is imperceptible to the 
user. Because the version id is generated by the service itself, it cannot be 
specified by the user and user cannot override the historical version. 
+- `stat`: when getting the metadata of an object, it will always get the 
metadata of the latest version of the object if no version ID is specified.
+- `read`: when reading an object, it will always read the latest version of 
the object if no version ID is specified.
+- `delete`: when deleting an object, it will always delete the latest version 
of the object if no version ID is specified. And users will not be able to read 
this object unless they specify the version ID not to be deleted.
+- `list_versions`: this `list_versions` means list all versions of an object. 
It's an operation on a single object, and it is different from the normal 
`list` which means list all objects.
+
+```rust
+// read with version ID
+let content = op.read_with("path/to/file").with_version("version_id").await?;

Review Comment:
   `with_version()` -> `version()`.



##########
core/src/docs/rfcs/2602_object_versioning.md:
##########
@@ -0,0 +1,78 @@
+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. 
+
+With object versioning, users can:
+
+- Track the history of an object.
+- Implement optimistic concurrency control.
+- Implement a simple backup system.
+
+# Guide-level explanation
+
+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.
+- `list`: List all versions of an object.
+
+Those operations with object version are different from the normal operations:
+
+- `write`: when writing an object, it will always create a new version of the 
object than overwrite the old version. But here it is imperceptible to the 
user. Because the version id is generated by the service itself, it cannot be 
specified by the user and user cannot override the historical version. 
+- `stat`: when getting the metadata of an object, it will always get the 
metadata of the latest version of the object if no version ID is specified.
+- `read`: when reading an object, it will always read the latest version of 
the object if no version ID is specified.
+- `delete`: when deleting an object, it will always delete the latest version 
of the object if no version ID is specified. And users will not be able to read 
this object unless they specify the version ID not to be deleted.

Review Comment:
   Leave the detailed explain to `Reference-level explanation`



##########
core/src/docs/rfcs/2602_object_versioning.md:
##########
@@ -0,0 +1,78 @@
+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. 
+
+With object versioning, users can:
+
+- Track the history of an object.
+- Implement optimistic concurrency control.
+- Implement a simple backup system.
+
+# Guide-level explanation
+
+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.
+- `list`: List all versions of an object.
+
+Those operations with object version are different from the normal operations:
+
+- `write`: when writing an object, it will always create a new version of the 
object than overwrite the old version. But here it is imperceptible to the 
user. Because the version id is generated by the service itself, it cannot be 
specified by the user and user cannot override the historical version. 

Review Comment:
   There is no different. Please make it clear that no matter we support object 
version or not, they exists and they are controled by users bucket setting.



##########
core/src/docs/rfcs/2602_object_versioning.md:
##########
@@ -0,0 +1,78 @@
+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. 
+
+With object versioning, users can:
+
+- Track the history of an object.
+- Implement optimistic concurrency control.
+- Implement a simple backup system.
+
+# Guide-level explanation
+
+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.
+- `list`: List all versions of an object.
+
+Those operations with object version are different from the normal operations:
+
+- `write`: when writing an object, it will always create a new version of the 
object than overwrite the old version. But here it is imperceptible to the 
user. Because the version id is generated by the service itself, it cannot be 
specified by the user and user cannot override the historical version. 
+- `stat`: when getting the metadata of an object, it will always get the 
metadata of the latest version of the object if no version ID is specified.

Review Comment:
   Show me the code.



##########
core/src/docs/rfcs/2602_object_versioning.md:
##########
@@ -0,0 +1,78 @@
+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. 
+
+With object versioning, users can:
+
+- Track the history of an object.
+- Implement optimistic concurrency control.
+- Implement a simple backup system.
+
+# Guide-level explanation

Review Comment:
   This section needs to be more detailed and user-friendly. We should provide 
clear instructions on how our users can utilize object versioning and highlight 
the benefits they will gain from it.
   
   Maybe we can start with an example in AWS S3 with object version enabled.



##########
core/src/docs/rfcs/2602_object_versioning.md:
##########
@@ -0,0 +1,78 @@
+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. 
+
+With object versioning, users can:
+
+- Track the history of an object.
+- Implement optimistic concurrency control.
+- Implement a simple backup system.
+
+# Guide-level explanation
+
+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.
+- `list`: List all versions of an object.
+
+Those operations with object version are different from the normal operations:
+
+- `write`: when writing an object, it will always create a new version of the 
object than overwrite the old version. But here it is imperceptible to the 
user. Because the version id is generated by the service itself, it cannot be 
specified by the user and user cannot override the historical version. 
+- `stat`: when getting the metadata of an object, it will always get the 
metadata of the latest version of the object if no version ID is specified.
+- `read`: when reading an object, it will always read the latest version of 
the object if no version ID is specified.
+- `delete`: when deleting an object, it will always delete the latest version 
of the object if no version ID is specified. And users will not be able to read 
this object unless they specify the version ID not to be deleted.
+- `list_versions`: this `list_versions` means list all versions of an object. 
It's an operation on a single object, and it is different from the normal 
`list` which means list all objects.

Review Comment:
   I would rather delay the support of `list_versions` until later.



##########
core/src/docs/rfcs/2602_object_versioning.md:
##########
@@ -0,0 +1,78 @@
+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. 
+
+With object versioning, users can:
+
+- Track the history of an object.
+- Implement optimistic concurrency control.
+- Implement a simple backup system.
+
+# Guide-level explanation
+
+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.
+- `list`: List all versions of an object.
+
+Those operations with object version are different from the normal operations:
+
+- `write`: when writing an object, it will always create a new version of the 
object than overwrite the old version. But here it is imperceptible to the 
user. Because the version id is generated by the service itself, it cannot be 
specified by the user and user cannot override the historical version. 
+- `stat`: when getting the metadata of an object, it will always get the 
metadata of the latest version of the object if no version ID is specified.
+- `read`: when reading an object, it will always read the latest version of 
the object if no version ID is specified.
+- `delete`: when deleting an object, it will always delete the latest version 
of the object if no version ID is specified. And users will not be able to read 
this object unless they specify the version ID not to be deleted.
+- `list_versions`: this `list_versions` means list all versions of an object. 
It's an operation on a single object, and it is different from the normal 
`list` which means list all objects.
+
+```rust
+// read with version ID
+let content = op.read_with("path/to/file").with_version("version_id").await?;
+```
+
+# Reference-level explanation
+
+To implement object versioning, we need to add a new `with_version` field to 
the `stat`, `read` and `delete` method. And we need to add a new `version_id` 
field to the `ObjectMeta` struct. And we need to add a new `list_versions` 
method to the `Accessor` trait and `Operator` struct.
+
+```rust
+// read with version ID
+let content = op.read_with("path/to/file").with_version("version_id").await?;
+// list all versions of an object
+let versions = op.list_versions("path/to/file").await?;
+```
+
+# Drawbacks
+
+None.
+
+# Rationale and alternatives
+
+None.
+
+# Prior art

Review Comment:
   They are not `Prior art`. Maybe should list them in `Reference-level 
explanation`.



##########
core/src/docs/rfcs/2602_object_versioning.md:
##########
@@ -0,0 +1,78 @@
+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. 
+
+With object versioning, users can:
+
+- Track the history of an object.
+- Implement optimistic concurrency control.
+- Implement a simple backup system.
+
+# Guide-level explanation
+
+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.
+- `list`: List all versions of an object.
+
+Those operations with object version are different from the normal operations:
+
+- `write`: when writing an object, it will always create a new version of the 
object than overwrite the old version. But here it is imperceptible to the 
user. Because the version id is generated by the service itself, it cannot be 
specified by the user and user cannot override the historical version. 
+- `stat`: when getting the metadata of an object, it will always get the 
metadata of the latest version of the object if no version ID is specified.
+- `read`: when reading an object, it will always read the latest version of 
the object if no version ID is specified.
+- `delete`: when deleting an object, it will always delete the latest version 
of the object if no version ID is specified. And users will not be able to read 
this object unless they specify the version ID not to be deleted.
+- `list_versions`: this `list_versions` means list all versions of an object. 
It's an operation on a single object, and it is different from the normal 
`list` which means list all objects.
+
+```rust
+// read with version ID
+let content = op.read_with("path/to/file").with_version("version_id").await?;
+```
+
+# Reference-level explanation

Review Comment:
   In this section, we need to explanation what's the API semantice and how 
will we implement it. For example
   
   - What's field we will add in `OpRead`, `OpStat`.
   - What changes we will do for services.



-- 
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]

Reply via email to