http://blogs.msdn.com/astoriateam/archive/2008/04/06/batching-data-service-requests.aspx
(Though they have a lot of complicated ChangeSetty- thingies added in to the mix, which I don't think OpenSocial needs.)
Hi John,
Between the one outlined in your proposal, and the one used in the one
below, the latter has some merits as it relies on application/http,
which in theory, has well-defined semantics. I say "in theory" because
I am not aware of any proxies or caches that can understand this
content-type.
Any reason to use X-Batch-Operation over application/http?
I do have some concerns about generic batching, and hence asked
earlier to see if there are strong use cases driving this desire. My
concerns include:
a. Batch does not necessarily speed up things for the client. The more
generic the batch protocol is, the less likely it is to parallelize
request processing.
b. Batch requests will miss caches, unless some extra work is done by
all caches and intermediaries. This is less likely to happen as this
specification is outside the realm of RFC 2616.
c. More importantly, programming batch requests is not necessarily
simpler. Here is why.
i. We will need special client libraries (say in Java, PHP,
JavaScript etc) to take an arbitrary number of requests and envelope
them into a batch
ii. Error handling would be more complex. Imagine 1 POST, 2 PUTs
and 3 DELETEs failing in a batch of 100 requests.
Please do not get me wrong. Batching may be important, but at this
stage, the additional complexity may outweigh the benefits.
An alternative approach worth considering is to identify specific
batch use cases (such as "update my address book", or "get my profile
and all my contacts's profiles"), and provide specific URIs and
representations to those.
The spec may have better luck with adoption if POST is used. Lot more
needs to defined for a new verb like BATCH, which should happen under
IETF and not here.
> a. Batch does not necessarily speed up things for the client. The more
> generic the batch protocol is, the less likely it is to parallelize
> request processing.
>
> Absolutely. So a protocol that makes it trivial to batch or not
> batch, and experiment to determine what works best, helps with
> optimization IMHO.
Sorry - I don't follow.
> b. Batch requests will miss caches, unless some extra work is done by
> all caches and intermediaries. This is less likely to happen as this
> specification is outside the realm of RFC 2616.
>
> Yep. Much of the legitimate uses are for things that would likely
> cause cache misses anyway. Note that caching can still happen at
> the client and at the origin server as they undestand the semantics
> and can use sub-request caching headers, but intermediaries would
> need to be modified to do so. I think this is a theoretical rather
> than a practical issue for the intended usage, though.
Clients like browsers can't cache the responses either. The request is
potentially unsafe, and the URI and response headers won't have enough
information to evaluate cacheability.
>
> In a callback-based environment, the library can take care of this
> (once) and shield the client from dealing with it. This would be
> the the case for the OpenSocial Javascript APIs for example.
True.
Subbu
On Apr 8, 2008, at 3:19 PM, John Panzer wrote:
>...
Sorry - I don't follow.
> a. Batch does not necessarily speed up things for the client. The more
> generic the batch protocol is, the less likely it is to parallelize
> request processing.
>
> Absolutely. So a protocol that makes it trivial to batch or not
> batch, and experiment to determine what works best, helps with
> optimization IMHO.
> b. Batch requests will miss caches, unless some extra work is done byClients like browsers can't cache the responses either. The request is
> all caches and intermediaries. This is less likely to happen as this
> specification is outside the realm of RFC 2616.
>
> Yep. Much of the legitimate uses are for things that would likely
> cause cache misses anyway. Note that caching can still happen at
> the client and at the origin server as they undestand the semantics
> and can use sub-request caching headers, but intermediaries would
> need to be modified to do so. I think this is a theoretical rather
> than a practical issue for the intended usage, though.
potentially unsafe, and the URI and response headers won't have enough
information to evaluate cacheability.
The spec may have better luck with adoption if POST is used. Lot more
On Apr 8, 2008, at 3:19 PM, John Panzer wrote:
> I plan to update the proposal to match the application/http
> semantics (it seems cleaner). My only real question is whether to
> use BATCH, POST, or allow either. Thoughts?
needs to defined for a new verb like BATCH, which should happen under
IETF and not here.
Sorry - I don't follow.
> a. Batch does not necessarily speed up things for the client. The more
> generic the batch protocol is, the less likely it is to parallelize
> request processing.
>
> Absolutely. So a protocol that makes it trivial to batch or not
> batch, and experiment to determine what works best, helps with
> optimization IMHO.
> b. Batch requests will miss caches, unless some extra work is done byClients like browsers can't cache the responses either. The request is
> all caches and intermediaries. This is less likely to happen as this
> specification is outside the realm of RFC 2616.
>
> Yep. Much of the legitimate uses are for things that would likely
> cause cache misses anyway. Note that caching can still happen at
> the client and at the origin server as they undestand the semantics
> and can use sub-request caching headers, but intermediaries would
> need to be modified to do so. I think this is a theoretical rather
> than a practical issue for the intended usage, though.
potentially unsafe, and the URI and response headers won't have enough
information to evaluate cacheability.
True.
>
> In a callback-based environment, the library can take care of this
> (once) and shield the client from dealing with it. This would be
> the the case for the OpenSocial Javascript APIs for example.
Subbu