i've created first app engine project. i'm using cloud endpoints , datastore provide backend mobile app. users use existing content, won't have way alterate datastore content.
so content of datastore managed me exclusively. have less 10 kinds of entity, , around 5000 objects. these objects need partial update approximately twice month.
to generate these objects on side, use few local sqlite databases , aggregate information web.
my question best way datastore updates? first thought use endpoints insert/update operations, , secure them accessible me. then, twice month use "admin client", generate new stuff, , use secure web services update datastore content.
but wonder if there more appropriate way this. in terms of efficiency , data consistency. happens if user asking content during update process, have partially date.
maybe use api i'm not aware of? or use sort of script on app engine side?
edit
one of entity has few embeddedentities. not mandatory me, figured less expensive way retrieve them, , don't need access them elsewhere.
but model, can't find how use bulkloader upload data, nor remoteapi. in both cases, embeddedentities not filled: have <missing> every fields of embedded entities in dataviewer, , nothing returned in endpoints. if use insert endpoint works. also, clear, despite embedded entities, works.
my model
@entity public class myentity { @id private long id; private string name; private myembeddedentity embeddedentity; ... @embedded public myembeddedentity getembeddedentity() { return embeddedentity; } } remoteapi
embeddedentity embeddedentity = new embeddedentity(); embeddedentity.setproperty("name", "testembedded"); entity entity = new entity("myentity", 1l); entity.setproperty("name", "test"); entity.setproperty("embeddedentity", embeddedentity); ... datastore.put(entity); bulkloader
i have generated yaml config create_bulkloader_config. set simplexml connector, xpath_to_nodes=/list/myentities corresponding structure of xml.
i've tried different approaches @embedded annotations. tried different entity keys. if insert entity endpoint, , import data bulkloader , same yaml config, generated xml doesn't contain embedded entities (whereas visible in dataviewer).
you can use bulkuploader, or write own version of uploader (use "login: admin" in app.yaml protect handlers).
you can use transactions (if data model allows it) avoid problems during update process, or can use temporary property "ready: true|false" during upload process.
Comments
Post a Comment