I’m trying to get a handle on the data-overhead required to store a blob in AppEngine’s BlobStore.
Let’s say I save a 1KB blob, how many bytes will that cost me in BlobStore and in DataStore respectively?
In other words: How big does an entity need to be, before it’s worth it to move it to BlobStore?
The answer to this question is not documented, but you can do a bit of guess-work to get a minimum overhead per blob.
Each blob created requires a blob info and a blob key. The blob key, I believe, is 500 bytes. The blob-info has a content_type (string), creation time (datetime), filename (string), and size (integer). We can assume that each string uses 1 more byte than their length. Also, assuming you do not use the optional file-name or content type field. Then the blob-info items will be approximately, 1 bytes, 8 bytes, 1 bytes, and 8 bytes, respectively, totaling 18 bytes.
Therefore, the minimum likely overhead for a blob item will be at least 518 bytes per blob, stored in the datastore. But we’re not done, we still need to figure out the optimal pricing.
Pricing for the blob-store per month will be:
Whereas pricing for storage entirely in the datastore is:
The break-even point where the two cost the same amount is 1130.2 bytes. Any more and the blobstore will be cheaper, and less and the datastore will be cheaper. Of course, this is based on the minimum overhead of 518 bytes, and I would bet the overhead will often be higher, so maybe a rule of thumb would be 2kb.