Re: How to use the Database Router?

2010-07-24 Thread Russell Keith-Magee
On Sun, Jul 25, 2010 at 7:16 AM, Andy wrote: > >> The db_for_read() and db_for_write() methods accept a model, and >> usually a hint. If provided, the hint will be the instance the >> database operation is acting on (or an instance related to the >> operation). These methods return the alias of th

Re: How to use the Database Router?

2010-07-24 Thread Andy
> The db_for_read() and db_for_write() methods accept a model, and > usually a hint. If provided, the hint will be the instance the > database operation is acting on (or an instance related to the > operation). These methods return the alias of the database that should > be used to perform the rea

Re: How to use the Database Router?

2010-07-24 Thread Russell Keith-Magee
On Sat, Jul 24, 2010 at 1:40 PM, Andy wrote: > >> Ah - this is possibly the source of confusion. Django's Routers can >> shard to different databases, but not to different tables in the same >> database. >> >> Why do you want to shard into different *tables*? The usual >> interpretation of shardin

Re: How to use the Database Router?

2010-07-23 Thread Andy
> Ah - this is possibly the source of confusion. Django's Routers can > shard to different databases, but not to different tables in the same > database. > > Why do you want to shard into different *tables*? The usual > interpretation of sharding (at least, the usual interpretation that > *I'm* fa

Re: How to use the Database Router?

2010-07-23 Thread Russell Keith-Magee
the > Database Router to implement horizontal sharding. > > But I can't figure out how to use the Database Router to do what i > want. The documentation doesn't contain a lot of info either. > > I have a model "Tweet". > > What I'd like to do is to sh

How to use the Database Router?

2010-07-23 Thread Andy
gure out how to use the Database Router to do what i want. The documentation doesn't contain a lot of info either. I have a model "Tweet". What I'd like to do is to shard Tweet into N different databases/ tables. When I need to read/write a Tweet object, I want to look at the T