Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cost to get missing Entity

My app can calculate a small number Keys for which Entities often do not exist in the datastore. For example, I may send a bulk get for 15 keys, of which only 4 return entities.

Docs simply state that a get is charged as one Read operation. Is this still true when the Entity does not exist?

like image 260
Doug Avatar asked Oct 09 '22 00:10

Doug


1 Answers

You will pay for key allocation (per key), and will be changed the small fees (currently it cost $0.01 per 100k operations).

If I understand the billing page getting 10 entities using keys will cost you 10 small units + read units * entities found.


I decided to check that myself, tl;dr you are not going to like the results.

I created a simple model, and a handler that request the model 10,000 times.

class DevNull(db.Model):
    pass

class EmptyHandler(webapp2.RequestHandler):    
    def get(self):
        for i in xrange(10):
            keys = [db.Key.from_path('DevNull', i*j+1) for j in xrange(1000)]
            res = DevNull.get(keys)

            print len(res)

The read quota spike each time by 10,000 read operation, 5 of those would kill the free quota.

like image 199
Shay Erlichmen Avatar answered Oct 13 '22 12:10

Shay Erlichmen