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')

Categories

HOME
shell
eclipse
api
redux-form
mjml
solaris
shiro
error-handling
seo
google-apps
crystal-reports-2013
webix
lanczos
discrete-mathematics
qpython
resultset
datastage
frequency-distribution
enterprise-architect
magnetic-cards
bitnami
mvc-mini-profiler
asp.net-mvc-viewmodel
gmm
rubymotion
roslyn
displaytag
jquery-callback
surveymonkey
custom-post-type
syntax-highlighting
ms-access-2003
progress-bar
winexe
datastax-enterprise-graph
winpe
corenlp-server
custom-controls
openproject
spring-mvc-test
apache-stanbol
strftime
mesosphere
dynamic-linq
proget
sonarlint-eclipse
reportservice2010
fclose
netbeans6.8
vugen
stdmap
spring-data-couchbase
sundials
janus
flyout
cpu-cache
universal-analytics
shinobi
branch-prediction
reachability
atlas
latin
envi
nss
aurora
cortex-m
atan2
qt5.2
fail2ban
viewer
iso-prolog
entry-point
rmysql
gii
trdion2011
memset
extjs2
synapse
clickbank
koala
windows-embedded-standard
gwt-openlayers
spring-3
solace-mq
sphinxql
scrypt
ui-select2
diem
twisted.web
web-notifications
tree-balancing
objectquery
stress
virtualpathprovider
gobject-introspection
promotion-code
xcelsius
webdev.webserver
jqote
clrstoredprocedure
event-receiver
diagrams
squishit
load-time

Resources

Encrypt Message