horizantal sharding exampl

117 views
Skip to first unread message

kampy

unread,
Nov 7, 2012, 1:46:03 AM11/7/12
to sqlal...@googlegroups.com
Hi all,

I have requirement where i need to get data from 3 databases and integrate all the data. while searching i found there is support in SQLAlchemy by using horizantal sharding, but i didnt get any correct procedural way to do it. if anyone had done these kind of requirement please help me out in getting these things.

Thanks in Advance

Michael Bayer

unread,
Nov 7, 2012, 9:52:09 AM11/7/12
to sqlal...@googlegroups.com

when you say "get data from 3 databases" it sounds like each of these databases has a different set of tables within them.  this is called vertical partitioning.   horizontal partitioning is when each of the three databases contain identical schemas, each storing a subset of the data for those tables.

if you're vertically partitioning, the Session will switch among different databases based on the tables you ask for.   A brief description of that is here: http://docs.sqlalchemy.org/en/latest/orm/session.html#simple-vertical-partitioning.   Later on in that section is a description of horizontal partitioning, which is a more involved technique.




--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/BPIp2h2Ryz8J.
To post to this group, send email to sqlal...@googlegroups.com.
To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.

narasimha swamy

unread,
Nov 7, 2012, 2:49:33 PM11/7/12
to sqlal...@googlegroups.com
hi mike ,
all the 3 databases have same tables but may have different data. i need to get all the data from 3 databases.
--
Thanks & Regards,
 Narasimha
 +( 91 )-9704008535

Michael Bayer

unread,
Nov 7, 2012, 3:01:58 PM11/7/12
to sqlal...@googlegroups.com
great, so try digging into the horizontal sharding example, then, or alternatively just use three different Session objects (the latter is easier, if your sharding scheme is simple).
Reply all
Reply to author
Forward
0 new messages