elasticinbox / elasticinbox-java

ElasticInbox - scalable, distributed email store
BSD 3-Clause "New" or "Revised" License
108 stars 26 forks source link

Are batch operations on ONE element equally efficient as their single counterparts? #43

Open Danita opened 11 years ago

Danita commented 11 years ago

I mean, can I just replace...

and

...and send a JSON array consisting of a single :uuid ?

Are there any side effects?

rstml commented 11 years ago

Batch API (http://elasticinbox.github.io/api/v2/batch/) is more efficient than single requests because EI, in turn, performs batch request to Cassandra. Therefore, if you are deleting 100 messages through batch API, there will be only one request sent to Cassandra node.

Perhaps we need to elaborate this in API docs.

Danita commented 11 years ago

Sorry, I was not clear enough :smile:

Obviously, for batch operations operating on many messages the batch command is more efficient. I meant, for a single message, is it the same to call the single DELETE method than calling a batch DELETE with a single id?