google-app-engine
Realtime datastore in google datastore
I want to store some information about shops and sellers including catalogs in google cloud datastore. One initial architecture i can think of is (shop_info is a kind) /shop_owner_info /shop_info /shop_info/catalog/item(x) But the problem here is as the catalog is in same group the write is limited to 1 per sec. But there might me more than one update to catalog per second. So my question is how can the above be structured so that i can get realtime updates to catalog.
Use Namespaces, not Ancestor paths What you need is a Multitenant structure. In Datastore, you do that by using Namespaces, not ancestor paths. See Multitenancy in Datastore docs. Instead of /shop_info/catalog/item(x), you would have: Entities: owner owner/shop (I suggest shop as a child of owner) catalog_item (top-level, not child of shop) Namespaces: [shop name or ID] Example: Let's say John subscribes to your app and creates a 'SuperElectro' store. You would have two entities: owner: 'John' shop: 'SuperElectro' (could be a child of owner: 'John') And one namespace: SuperElectro (or its unique ID) When you add a new item to SuperElecto's catalog, don't provide any ancestor/parent. Instead, provide a namespace which is a combination of the owner and shop: In Python: from google.appengine.api import namespace_manager from google.appengine.ext import ndb class CatalogItem(ndb.Model): name = ndb.StringProperty() category = ndb.StringProperty() namespace_manager.set_namespace('SuperElectro') item = CatalogItem(name='iPhone', category='Smartphone') item.put() In real world, you'd want to use something unique for the namespace: instead of 'SuperElectro', I'd suggest using the shop ID. Hope it helps. Read more at Implementing Multitenancy Using Namespaces.
Related Links
Pagination and Multiple relational entity indexes with AppEngine
time taken to upload a picture of 1M ~ 5M from iPhone to either Google AE or Amazon S3
Sending email from dev server with --smtp_host=smtp.gmail.com
Google App Engine logout url
django-nonrel google app engine order_by('?')
Trouble while sending Email using Google App Engine to Verizon (vtext.com)
Keeping track of time with 1 second accuracy in Google App Engine
Developing for Google App Engine and using the datastore
GAE Datastore: “total” property vs. adding up line items?
Business intelligence on Google App Engine
Why GAE ChannelAPI Socket.open() fails?
Modifying GAE Django to Expand the API Scope on User Login
GWT: Where (how) to define POJOs to make em available for client and server? (and to use datastore on serverside)
Google App Engine Always On feature
Google App Engine: How to create sub domain/ sub directory
Securing Google App Engine Authsub callback url ('next_url')