[google-appengine] Re: Is there a possible way to have two datastores for the same application?

2016-04-11 Thread Anastasios Hatzis
Youssef, if I remember correctly, you can only have one datastore and one 
app-engine in a Google cloud project. However, you should be able to access 
entities of a different datastore (i.e. in a different project) by defining 
the app parameter in the NDB Key constructor 
. 
Certainly, you would need to manually add permissions for your app in the 
other (test) datastore.

Alternatively, you could use just the same datastore, but a different 
namespace, e.g. "test". Or if you already use namespaces for multi-tenancy, 
you could have multiple namespaces test-1, test-2 etc. to run tests 
regarding multi-tenancy features.

Ani

On Monday, April 11, 2016 at 3:20:34 PM UTC+2, youssef dehbi alaoui wrote:
>
> hi everyone i need in my application two types of data (but same 
> entities), one for testing and the other for production... so i'm wondering 
> if there is a solution to make a difference between these two types like 
> having two datastores 
> Thanks.
>

-- 
HATZIS Edelstahlbearbeitung GmbH
Hojen 2
87490 Haldenwang (Allgäu)
Germany

Handelsregister Kempten (Allgäu): HRB 4204
Geschäftsführer: Paulos Hatzis, Charalampos Hatzis
Umsatzsteuer-Identifikationsnummer: DE 128791802
GLN: 42 504331  6

http://www.hatzis.de/

-- 
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 https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/d70632e9-1fd9-4fe3-a514-114902394810%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Is there a possible way to have two datastores for the same application?

2016-04-11 Thread youssef dehbi alaoui
thank you Anastasios Hatzis for your help :)

-- 
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 https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/9ac6040d-4bc0-4ef3-9024-59e0b9d25995%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Is there a possible way to have two datastores for the same application?

2016-04-11 Thread Nick
While you could use namespaces 
 to 
achieve this, you need to consider what it means to have two 'environments' 
running together, and what are the consequences of mistakes.

Generally we've found the simplest option is to have extra cloud projects 
for extra environments, which is usually very cheap/free assuming you 
aren't simulating real loads constantly. Obviously there are some drawbacks 
to this, such as ease of code promotion, but if you're using other services 
in google cloud, they aren't intrinsically namespace aware, so you need to 
be careful.

On Monday, April 11, 2016 at 11:20:34 PM UTC+10, youssef dehbi alaoui wrote:
>
> hi everyone i need in my application two types of data (but same 
> entities), one for testing and the other for production... so i'm wondering 
> if there is a solution to make a difference between these two types like 
> having two datastores 
> Thanks.
>

-- 
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 https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/b51ace6a-b8c5-4404-97eb-6793408f4027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Is there a possible way to have two datastores for the same application?

2016-04-12 Thread youssef dehbi alaoui
Thanks Nick and Karl for the help.. we choose to have two application and 
manage it separately...

-- 
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 https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/a2da862b-5fc6-46b1-bb27-0036d481ecf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Re: Is there a possible way to have two datastores for the same application?

2016-04-11 Thread Karl MacMillan


> On Apr 11, 2016, at 6:31 PM, Nick  wrote:
> 
> While you could use namespaces to achieve this, you need to consider what it 
> means to have two 'environments' running together, and what are the 
> consequences of mistakes.
> 
> Generally we've found the simplest option is to have extra cloud projects for 
> extra environments, which is usually very cheap/free assuming you aren't 
> simulating real loads constantly. Obviously there are some drawbacks to this, 
> such as ease of code promotion, but if you're using other services in google 
> cloud, they aren't intrinsically namespace aware, so you need to be careful.
> 

We use separate projects as well and it works reasonably well. It makes it much 
less stressful to push builds to the test environment. 

Unfortunately you are likely to need some sort of mechanism to change 
configuration between environments. For example, if you use google cloud 
storage, bucket names must be globally unique so you have to store or derive 
the root bucket names for each environment. 

Karl

>> On Monday, April 11, 2016 at 11:20:34 PM UTC+10, youssef dehbi alaoui wrote:
>> hi everyone i need in my application two types of data (but same entities), 
>> one for testing and the other for production... so i'm wondering if there is 
>> a solution to make a difference between these two types like having two 
>> datastores 
>> Thanks.
> 
> -- 
> 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 https://groups.google.com/group/google-appengine.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-appengine/b51ace6a-b8c5-4404-97eb-6793408f4027%40googlegroups.com.
> 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 https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/3676F8DE-8885-44F3-B467-8997FCFE5979%40strajillion.com.
For more options, visit https://groups.google.com/d/optout.