Re: [sqlalchemy] database "design" question

2014-04-08 Thread Richard Gerd Kuesters
thanks again mike. well, most of our software is already message driven, 
but we still need to "group" information if we want to; ex: search from 
all our clients databases for some value in a model that's shared 
between them.


thanks a lot,
richard.

On 04/08/2014 12:07 PM, Michael Bayer wrote:


On Apr 8, 2014, at 11:01 AM, Richard Gerd Kuesters 
mailto:rich...@humantech.com.br>> wrote:


thanks mike. i know it's a vague question, but that just the point: i 
don't know the answer because it can be both :)


let me clarify: assuming the application can be self hosted (in our 
ift), hence also multi-tenancy can be used for multiple clients. if 
not, the same codebase would run in the client's server space, in 
which some rules will does not comply - as a "core client database" 
will not be available, as an example.


assuming that i have a lot of clients in our self hosted platform, i 
could enable multi-tenancy, but can i query or join between different 
databases?


there might be some way that PG can refer to different databases like 
schemas, but if you need to join between different databases, that 
means the app isn't multi-tenancy, its one big app with shared data.


I suspect that this "join between different databases" use case is 
more like, customers can access system A that has a set of common 
tables for everyone, or system B that is "their database".A and B 
alone might be organized as separate databases to start with, so you 
don't need to join between different databases.   I'd prefer to 
approach this in as much of a service oriented way as possible.   
System A and B would share data strictly at the level of two services 
sending messages to each other.





fyi, the server is postgres 9.x


thanks a lot,
richard.


On 04/08/2014 10:57 AM, Michael Bayer wrote:
this is a vague and open ended question, is this a multi-tenancy 
application?   does each client have their own database?  or is that 
the question?if its multi tenancy, Id probably give each client 
a different database, why not?




On Apr 4, 2014, at 12:58 PM, Richard Gerd Kuesters 
mailto:rich...@humantech.com.br>> wrote:



hi all!

i have a question about sqlalchemy and database design.

i'm developing an app, where each client may receive an alert about 
the total space usage of their data (files and database), so, using 
postgresql, i can get them (data usage size) using a different 
tablespace, database or schema, if i'm not wrong. given these 
premises, which is the best way to design my database using 
sqlalchemy, having in mind that I need also to integrate the client 
databases to the "core" database?


my best regards,
richard.

--
You received this message because you are subscribed to the Google 
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, 
send an email to sqlalchemy+unsubscr...@googlegroups.com 
.
To post to this group, send email to sqlalchemy@googlegroups.com 
.

Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google 
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, 
send an email to sqlalchemy+unsubscr...@googlegroups.com 
.
To post to this group, send email to sqlalchemy@googlegroups.com 
.

Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google 
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, 
send an email to sqlalchemy+unsubscr...@googlegroups.com 
.
To post to this group, send email to sqlalchemy@googlegroups.com 
.

Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google 
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to sqlalchemy+unsubscr...@googlegroups.com 
.
To post to this group, send email to sqlalchemy@googlegroups.com 
.

Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group a

Re: [sqlalchemy] database "design" question

2014-04-08 Thread Michael Bayer

On Apr 8, 2014, at 11:01 AM, Richard Gerd Kuesters  
wrote:

> thanks mike. i know it's a vague question, but that just the point: i don't 
> know the answer because it can be both :)
> 
> let me clarify: assuming the application can be self hosted (in our ift), 
> hence also multi-tenancy can be used for multiple clients. if not, the same 
> codebase would run in the client's server space, in which some rules will 
> does not comply - as a "core client database" will not be available, as an 
> example.
> 
> assuming that i have a lot of clients in our self hosted platform, i could 
> enable multi-tenancy, but can i query or join between different databases?

there might be some way that PG can refer to different databases like schemas, 
but if you need to join between different databases, that means the app isn't 
multi-tenancy, its one big app with shared data.

I suspect that this "join between different databases" use case is more like, 
customers can access system A that has a set of common tables for everyone, or 
system B that is "their database".A and B alone might be organized as 
separate databases to start with, so you don't need to join between different 
databases.   I'd prefer to approach this in as much of a service oriented 
way as possible.   System A and B would share data strictly at the level of two 
services sending messages to each other.


> 
> fyi, the server is postgres 9.x
> 
> 
> thanks a lot,
> richard.
> 
> 
> On 04/08/2014 10:57 AM, Michael Bayer wrote:
>> this is a vague and open ended question, is this a multi-tenancy 
>> application?   does each client have their own database?  or is that the 
>> question?if its multi tenancy, Id probably give each client a different 
>> database, why not?
>> 
>> 
>> 
>> On Apr 4, 2014, at 12:58 PM, Richard Gerd Kuesters 
>>  wrote:
>> 
>>> hi all!
>>> 
>>> i have a question about sqlalchemy and database design.
>>> 
>>> i'm developing an app, where each client may receive an alert about the 
>>> total space usage of their data (files and database), so, using postgresql, 
>>> i can get them (data usage size) using a different tablespace, database or 
>>> schema, if i'm not wrong. given these premises, which is the best way to 
>>> design my database using sqlalchemy, having in mind that I need also to 
>>> integrate the client databases to the "core" database?
>>> 
>>> my best regards,
>>> richard.
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "sqlalchemy" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to sqlalchemy+unsubscr...@googlegroups.com.
>>> To post to this group, send email to sqlalchemy@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/sqlalchemy.
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sqlalchemy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sqlalchemy+unsubscr...@googlegroups.com.
>> To post to this group, send email to sqlalchemy@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sqlalchemy.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] database "design" question

2014-04-08 Thread Richard Gerd Kuesters
thanks mike. i know it's a vague question, but that just the point: i 
don't know the answer because it can be both :)


let me clarify: assuming the application can be self hosted (in our 
ift), hence also multi-tenancy can be used for multiple clients. if not, 
the same codebase would run in the client's server space, in which some 
rules will does not comply - as a "core client database" will not be 
available, as an example.


assuming that i have a lot of clients in our self hosted platform, i 
could enable multi-tenancy, but can i query or join between different 
databases?


fyi, the server is postgres 9.x


thanks a lot,
richard.


On 04/08/2014 10:57 AM, Michael Bayer wrote:
this is a vague and open ended question, is this a multi-tenancy 
application?   does each client have their own database?  or is that 
the question?if its multi tenancy, Id probably give each client a 
different database, why not?




On Apr 4, 2014, at 12:58 PM, Richard Gerd Kuesters 
mailto:rich...@humantech.com.br>> wrote:



hi all!

i have a question about sqlalchemy and database design.

i'm developing an app, where each client may receive an alert about 
the total space usage of their data (files and database), so, using 
postgresql, i can get them (data usage size) using a different 
tablespace, database or schema, if i'm not wrong. given these 
premises, which is the best way to design my database using 
sqlalchemy, having in mind that I need also to integrate the client 
databases to the "core" database?


my best regards,
richard.

--
You received this message because you are subscribed to the Google 
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, 
send an email to sqlalchemy+unsubscr...@googlegroups.com 
.
To post to this group, send email to sqlalchemy@googlegroups.com 
.

Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google 
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to sqlalchemy+unsubscr...@googlegroups.com 
.
To post to this group, send email to sqlalchemy@googlegroups.com 
.

Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] database "design" question

2014-04-08 Thread Michael Bayer
this is a vague and open ended question, is this a multi-tenancy application?   
does each client have their own database?  or is that the question?if its 
multi tenancy, Id probably give each client a different database, why not?



On Apr 4, 2014, at 12:58 PM, Richard Gerd Kuesters  
wrote:

> hi all!
> 
> i have a question about sqlalchemy and database design.
> 
> i'm developing an app, where each client may receive an alert about the total 
> space usage of their data (files and database), so, using postgresql, i can 
> get them (data usage size) using a different tablespace, database or schema, 
> if i'm not wrong. given these premises, which is the best way to design my 
> database using sqlalchemy, having in mind that I need also to integrate the 
> client databases to the "core" database?
> 
> my best regards,
> richard.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] database "design" question

2014-04-08 Thread Richard Gerd Kuesters

perhaps this would help?

http://techspot.zzzeek.org/2012/01/11/django-style-database-routers-in-sqlalchemy/

i'm willing to use different schemas to my question. if anyone have a 
better idea, let me know :)


best regards,
richard.


On 04/04/2014 01:58 PM, Richard Gerd Kuesters wrote:

hi all!

i have a question about sqlalchemy and database design.

i'm developing an app, where each client may receive an alert about 
the total space usage of their data (files and database), so, using 
postgresql, i can get them (data usage size) using a different 
tablespace, database or schema, if i'm not wrong. given these 
premises, which is the best way to design my database using 
sqlalchemy, having in mind that I need also to integrate the client 
databases to the "core" database?


my best regards,
richard.
--
You received this message because you are subscribed to the Google 
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to sqlalchemy+unsubscr...@googlegroups.com 
.
To post to this group, send email to sqlalchemy@googlegroups.com 
.

Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.