Tomer Weller
Tomer Weller

Reputation: 2812

appengine datastore multiple "puts" transaction performance

I have a request performing several "put" operations on entities belonging to the same entity-group.

It is not crucial for them to be in a transaction but I was wondering what's the performance impact on doing so, Is there any chance performance will improve since upon committing only one change-set is written?

More than that, If I have several "put" operations on a single entity inside a transaction. Is it any different than just one "put" operation at the end?

Upvotes: 1

Views: 366

Answers (1)

dragonx
dragonx

Reputation: 15143

Some background info, the App Engine Datastore is based on Google's Megastore database, you can read up on it here when you're on vacation: http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en//pubs/archive/36971.pdf

The super quick summary is that the datastore gets performance benefits when entities are stored or read in parallel, on different servers. In order to get transactional semantics inside an entity group though, all those transactions run on the same server, serially. Therefore they'll run slower.

I'm not a google employee, so I'm not certain about the last part of the question. You're essentially asking if they have any optimization for transactions that will lump multiple puts into a single put. I haven't seen any mention of such an optimization, I don't think it exists. Each put operation essentially writes the entire entity, so I suspect multiple put operations on a single entity will be much worse than a single put at the end.

The new ndb API might have some optimization for this.

Upvotes: 1

Related Questions