Hello,

I've been struggling with the proper way to create a bunch of demo contents 
"on the fly"...

*This is the scenario*:

   1. I have an application in which users can create an account before 
   purchasing it.
   2. When a user creates an account, he may choose to generate demo 
   contents (to see the application in action and filled with data)
   3. When a new demo account is created a lot of new entities needs to be 
   created in the recently created namespace for that user.
   


*The first approach* was to use the application logic to generate all the 
demo contents in the new namespace when the user request the demo, in a 
task queue. Shortly after implementing this approach I realized that it was 
very time/resource consuming. If i use the application logic, a single 
action may produce more task and datastore updates (one user makes a +1 in 
a publication, and that +1 generate notifications, user activity, 
statistics, global counters, etc...).


*The second approach* was to use mapreduce/pipelines to, basically, copy a 
pre-generated demo's namespace into the new one. This approach sounds much 
better, and takes significant less time and resources to accomplish the 
task. The problem with this approach is that I start seeing this error "
java.lang.IllegalArgumentException: the id allocated for a new entity was 
already in use, please try again". I just need to re-allocate all IDs for 
all entities I'm copying, but most of them relies on automatic-ids 
generation (scattered IDs). As per this issue I can't reallocate scattered 
IDs 
(https://code.google.com/p/googleappengine/issues/detail?id=11541)(http://stackoverflow.com/questions/32652316/exceeded-maximum-allocated-ids-exception-when-allocating-keyrange-appengine-o).
 
There are entities in which may have sense to manually generate the ids 
(legacy IDs) but there are other entities that this has no sense at all.


My questions are:
- Am I doing something wrong with the second approach? Should I reconsider 
all my application ID generation just to be able to copy entities between 
namespaces and allocate it's scattered IDs?
- Should I focus on generate a demo with legacy IDs to use as a base demo 
to copy to another namespace?
- Am I missing a third approach? 


Thanks in advance






-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/08aa5d98-1ccc-4a0d-b096-431877053e03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to