Chunked upload / partial updates to object store #4689
-
Hi, I was just looking through the object store interfaces, evaluating it for my use cases. For my use case, which I am not sure if it's an appropriate use case for object store in general: Users are uploading large files (100 MBs to multiple GBs) using https://tus.io/ for increasing upload reliability, where users upload the file in chunks and in case of any failure can restart the upload where it was left off. So I think the basic requirement for using NATS as a store would be to add new chunks at the end of a file and to somehow mark a file as incomplete / complete (which could be done as metadata I guess) Does such functionality already exist? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
this actually doesn't work with ObjectStore - the reason being that each chunk is considered to be in-order in the stream. So it is not possible to just update chunk #123 and have it be at the right offset. With that said, there could be different strategies that could be used to implement this with a little more work from the client. You could think of the asset as being made of 100 logical entries on your side (regardless what the storage chunks are), and you could update each of these entries as you see fit. ObjectStore will ensure that the chunks are correct, but you could simply replace the entry that failed as a whole. - IE store |
Beta Was this translation helpful? Give feedback.
-
Does this example of client code help ? |
Beta Was this translation helpful? Give feedback.
this actually doesn't work with ObjectStore - the reason being that each chunk is considered to be in-order in the stream. So it is not possible to just update chunk #123 and have it be at the right offset. With that said, there could be different strategies that could be used to implement this with a little more work from the client. You could think of the asset as being made of 100 logical entries on your side (regardless what the storage chunks are), and you could update each of these entries as you see fit. ObjectStore will ensure that the chunks are correct, but you could simply replace the entry that failed as a whole. - IE store
large.1, large.2..., large.N
- your code can then sim…