There is no significant difference in performance between the two - just use what works best for your data. BlobProperty should be used to store binary data (e.g. str objects), while TextProperty should be used to store any text data (e.g. unicode or str objects). Note that if you store str in TextProperty , it should only contain ASCII bytes (less than 128 hexadecimal or decimal) (unlike BlobProperty ).
Both of these properties are derived from UnindexedProperty , as you can see in source .
Here is an example application that shows that for these ASCII or UTF-8 strings there is no difference in storage costs:
import struct from google.appengine.ext import db, webapp from google.appengine.ext.webapp.util import run_wsgi_app class TestB(db.Model): v = db.BlobProperty(required=False) class TestT(db.Model): v = db.TextProperty(required=False) class MainPage(webapp.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain'
And here is the conclusion:
text: 1=>172B 2=>128047B 3=>128047B blob: 1=>172B 2=>128047B 3=>128047B
David underhill
source share