Re: [google-appengine] Using Namespaces

2014-04-23 Thread Aswath Satrasala
Hello,


On Tue, Apr 22, 2014 at 6:36 PM, SMF sarfaraz.faroo...@gmail.com wrote:

 Hi there

 I have a few basic questions

 1. If I have 1000+  Namespaces, how will they get displayed in the App
 Engine Admin Console (Datastore Viewer),
 Right now I have few and they are displayed in a dropdown box.

We have lots of namespaces 2000+.  Currently, in the appengine admin
console, the namespace is selected by a suggestbox style (auto complete).
If there are fewer namespaces, it is displayed in a dropdown.



 2. I have a Multi-Tenant app where each tenant has its own namespace. the
 model and entities related to the tenant is within their respective
 namespace except for the User entities each tenant can have multiple users.
 thats why all users are stored without any namespace.

 The user's  UserId ,name and TenantId (also used as namespace) is stored
 in the Users Model

 After user log's in through Google , We Query this Model to Find the
 Namespace of the logged in User, Once found we set it and use it for
 reading / storing entities in their respective  namespace.

 My Question is What could go wrong with this approach ?, and do we have
 any better solution for handling Multiple Tenants with Multiple User
 Accounts.
 We need to do this without using Sub Domain Names and URL Paths
 (Containing the namespace id or key)

We do similar things.  For every user/company, we create a namespace name
and store in a separate model in the empty namespace.  Every time, the
request comes, we check the logged in user, and then get the namespace from
the model and set the namespace.
We use GWT and Objectify.  Every rpc, we check who logged in and set the
namespace using the NamespaceManger. We have issues dealing with the
Objectify keys while doing the rpc's using this namespace approach.  We got
workaround those, and going on.  We modified the objectify jar and moving
on.
You can star the issue, if you are using GWT.
https://code.google.com/p/objectify-appengine/issues/detail?id=116can=1q=namespace




 3. We also need to have (CRON) Jobs which will run at a minimum of 3 times
 a day to Query Some Entities and Update Some and Send the Report to the
 Tenants users. In this case we would have to Query the meta data to get
 list of namespaces, and then for each namespace query the desired entities.
 This would increase the cpu and memory consumption, is there any better
 way to run CRON on multiple namespaces.

We do this way also sometimes and works for small tasks.  If you are doing
large processing within each namespace, then the 10 min task time out can
happen.  We have faced this while processing large data with in the
namespace, so we did workarounds like use backends to run the task.



 Any help will be highly appreciated.

 Thanks
 Sarfaraz




 .














  --
 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 google-appengine+unsubscr...@googlegroups.com.
 To post to this group, send email to google-appengine@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-appengine.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Using Namespaces

2014-04-22 Thread SMF
Hi there

I have a few basic questions 

1. If I have 1000+  Namespaces, how will they get displayed in the App 
Engine Admin Console (Datastore Viewer), 
Right now I have few and they are displayed in a dropdown box.


2. I have a Multi-Tenant app where each tenant has its own namespace. the 
model and entities related to the tenant is within their respective 
namespace except for the User entities each tenant can have multiple users. 
thats why all users are stored without any namespace.

The user's  UserId ,name and TenantId (also used as namespace) is stored in 
the Users Model 

After user log's in through Google , We Query this Model to Find the 
Namespace of the logged in User, Once found we set it and use it for 
reading / storing entities in their respective  namespace.

My Question is What could go wrong with this approach ?, and do we have any 
better solution for handling Multiple Tenants with Multiple User Accounts. 
We need to do this without using Sub Domain Names and URL Paths (Containing 
the namespace id or key)


3. We also need to have (CRON) Jobs which will run at a minimum of 3 times 
a day to Query Some Entities and Update Some and Send the Report to the 
Tenants users. In this case we would have to Query the meta data to get 
list of namespaces, and then for each namespace query the desired entities.
This would increase the cpu and memory consumption, is there any better way 
to run CRON on multiple namespaces.


Any help will be highly appreciated.

Thanks
Sarfaraz




.














-- 
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 google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.