Skip to content

Saving body of an interrupted PATCH request #89

@janko

Description

@janko

First of all, thank you for an awesome specification, I really enjoyed implementing it!

I wanted to propose extending/altering the specification concerning the following part:

The Server SHOULD always attempt to store as much of the received data as possible.

In Ruby most of the web frameworks don't support this. There is one web framework, Goliath, which is based on EventMachine, a Ruby alternative to Node's event-driven reactor pattern. The currently registered Ruby tus server, Rubytus, uses Goliath. However, I find some other web frameworks much easier to use than Goliath, with a much clearer line of handling the request. And I also prefer to have a Ruby tus implementation use a web framework which isn't bound to EventMachine, but can use any web server that the main application uses.

I don't know if web frameworks in other languages have this already solved, but this ability definitely affects how the client should send the request. If the server supports this, the client can send just one PATCH request with the whole file. Otherwise the client should send multiple PATCH requests, which can be retried in case of failure. Therefore I think the specification should be updated in one of the following ways:

  1. Have the server signal whether they're capable of storing an interrupted PATCH request (via an extension)
  2. Change the sentence to "The Server MUST always attempt to store as much of the received data as possible."

I obviously prefer the option 1, because it allows more flexibility. The downside of this option is that synchronously sending multiple smaller PATCH requests is probably slower than sending one big one. So if the client was updated to check this extension, any existing server which currently supports it but doesn't notify that via Tus-Extension will start receiving multiple PATCH requests.

However, server not supporting saving interrupted PATCH requests doesn't actually have to mean less performance. The client can use the Concatenation extension to upload multiple chunks in parallel, which as I understood can be faster than a single PATCH request. Therefore I think that this server requirement should definitely be optional, because IMO the client doesn't need this to achieve maximum performance in an upload.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions