You're taking about some kind of "batch" mode API. before getting into formats and protocol details, consider this...
1) Batch Integrity
You send ten items in a batch for processing. Nine process successfully, one fails. What is your response? Fail the entire request? Commit mine and report an error for one?
2) Long-running work
some batches might take processing time. Do you plan on keeping a single request/response line open for the duration? of maybe you want to use HTTP 202 (accepted) and now you need to figure how clients will be alerted when the long-running transaction is done. another HTTP request w/ timing headers? an out-of-band response via email? a registered pub/sub callback URL?
3) Security Issues
sending batch requests can open serious security holes. it's pretty easy to send a request that results in a DDOS experience for servers. and, since this is all in a single request, common prevention tooling is unable to help you. So you need to add some security-checks like payload size, transaction count, timer-checks, etc.
4) Dependency Issues
some batch lists might include multiple actions on the same resource (GET, PUT, DELETE, etc.). is this OK? you might run into an "order of events" issue where you want to create a record, then do something with it. you can't do this in the "wrong" order. you can't send a batch that already knows the ID from a POST since POST will create that ID, etc.
These are the issues I see repeatedly in attempts to execute batches over the network. there are possibly others that include domain, format, and protocol-specific details.
BTW - i try to NEVER to batch work over the network<g>.
hope this helps.
Hello everyone,--
I need to update multiple resources. What would a good API design do: permit a big call containing all the necessary information for the updates or force multiple small update operations on each resource?
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.
Visit this group at http://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.
Visit this group at https://groups.google.com/group/api-craft.