Comments (7)
You're referencing this: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html ? I didn't know this feature existed. Awesome!
from s3rver.
I agree, it is pretty awesome and it would be quite nice to be able to use it!
from s3rver.
I've been thinking about this. I like the idea, but I think it would require a fair bit of work to implement. S3rver does not use a database, it only uses a metadata file to receive information about an object (as you're probably aware). If it were using a database then versioning would be rather simple to implement. Adding a database to s3rver would just add another overhead to to think about for a developer - which I really don't think is necessary
Of course there are other ways of do it....we could store the versions in the metadata file. Each version points to a different file.
Or perhaps if each bucket had a git repo we could use https://github.com/creationix/js-git to manage the object versioning.
To conclude, I like the idea, but I don't think it is necessary for a development server. I don't want to add too much bloat to it.
Let me know your thoughts and ideas! Cheers.
from s3rver.
I think your decision is understandable. Although, even for a development server I believe it should still support every feature. The point, as I understand it, is to allow developers to avoid using the online cloud for internal testing and to be able to quickly switch back for production. If it happens that S3's versioning system is an important part of their program, they wouldn't be able to use S3rver in development.
Fortunately, this is not a priority for me right now as I am using my own system for versioning and not S3's system. But perhaps for a future endeavor, I still think it would be good idea.
As for using git to version each file, I think that is way overkill and not really necessary. If anything, I would say keep the original .dummys3_content
and .dummys3_metadata
files as the current version of a file. Only when a user requests a specific version like 001
, it would instead find and pull .dummys3_content_001
and .dummys3_metadata_001
file data. Each time the user uploads a file that already exists in the cloud (assuming versioning mode is enabled for the bucket), the current .dummys3_content/metadata
files would be renamed to an incremented version, and the new file would take .dummys3_content/metadata
.
from s3rver.
would using sqlite do the tricks ? as you would not have yet an other service to configure while still being able to have the full power of sql ?
from s3rver.
Each time the user uploads a file that already exists in the cloud (assuming versioning mode is enabled for the bucket), the current .dummys3_content/metadata files would be renamed to an incremented version, and the new file would take .dummys3_content/metadata.
I agree with the general algorithm. However, I would suggest saving the file from the beginning from the path corresponding to the appropriate version. After saving the data and metadata, create or overwrite (UPSERT) a symlink indicating the current version. This slightly reduces the risk that in the event of a failure, the currently saved data will be damaged.
It's worth noting that - looking at the examples in the AWS documentation - that the version identifier is a random string of characters that is opaque for the client nor sequentially increasing counter. Using uuidv4 seems natural to me here as source of random value.
from s3rver.
Since this issue is still open, is this something that PRs would be welcome for? @jamhall seemed to push back on if this feature should be implemented, but it's still open which indicates that PRs would be welcome for it.
from s3rver.
Related Issues (20)
- vhostBuckets Documentation Confusing HOT 2
- Close Stale Issues/PRs HOT 5
- Error = A parameter you provided functionality that in not implemented HOT 6
- Error: fopen(httpseek://): failed to open stream ... HOT 4
- Storage Class not being respected HOT 5
- Question: Is s3rver a s3 "private" / "public" or both? HOT 1
- key should be Key, capitalized, following the AWS SDK documentation HOT 4
- Content Range header not returned when requested range is 'bytes=0-' HOT 1
- Dependency Dashboard
- Failed to upload large file (53Mb)
- Apparent race condition deleting objects results in ENOENT HOT 1
- Custom Store
- attention on files contains url ecoding putcopy function need decodeURIComponent
- Security Issue in Dependency - CVE-2022-24434 HOT 4
- Feature request - storing/retrieving checksum metadata (x-amz-checksum) inside object attributes
- Simulate slow fetch
- fast-xml-parser vulnerable to prototype pollution SNYK-JS-FASTXMLPARSER-3325616 sonatype-2023-0998
- if i use aws java v2 sdk putobject fail HOT 2
- ListObjectsV2 MaxKeys parameter is broken
- Internal Server Error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s3rver.