Can I append or overwrite some bytes to an existin

2019-07-05 04:39发布

问题:

I need to append some bytes to an existing object stored in Openstack Swift, say like a log file object and constantly append new logs to it. Is this possible?

Moreover, can I change (overwrite) some bytes (specify with offset and length) to an existing object?

回答1:

I believe ZeroVM (zerovm.org) would be perfect for doing this.

Disclaimer: I work for Rackspace, who owns ZeroVM. Opinions are mine and mine alone.



回答2:

tl;dr: There's no append support currently in Swift.

There's a blueprint for Swift append support: https://blueprints.launchpad.net/swift/+spec/object-append. It doesn't look very active.

user2195538 is correct. Using ZeroVM + Swift (using the ZeroCloud middleware for Swift) you could get a performance boost on large-ish objects by sending deltas to a ZeroVM app and process them in place. Of course you still have to read/update/write the file, but you can do it in place. You don't need to pipe the entire file over the network, which could/would be costly for large files.

Disclaimer: I also work for Rackspace, and I work on ZeroVM for my day job.