Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#12541 closed (fixed)

Add support for describing master/slave arrangements in multi-db

Reported by: russellm Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2-alpha
Severity: Keywords:
Cc: jbalogh Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Django's multidb setup can be used to implement master/slave database arrangements - however, there is no allowance made for the fact that an object retrieved from a slave is actually compatible with an object retrieved from the master (or, for that matter, another slave).

It should be possible to define data relationships in DATABASES, and have instance._state.db reflect those relationships - i.e., the database state should describe the actual data *source*, not just the databse from which the data was retrieved.

Once this support is in place, the cross-database validation checks (that were commented out just before the merge of the soc branch) can be reintroduced. Those checks should be modified to check the source, not the raw db alias.

There has been some initial discussion on django-dev about this subject.

Change History (5)

comment:1 Changed 7 years ago by russellm

  • milestone set to 1.2
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Marking this for the 1.2 milestone because there is a reasonable solution on the table that shouldn't be too hard to implement.

comment:2 Changed 7 years ago by jbalogh

  • Cc jbalogh added

comment:3 Changed 7 years ago by russellm

See the patch t12540-r12262.1.diff attached to #12540 - it includes a draft fix for this ticket.

comment:4 Changed 7 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(In [12272]) Fixed #12540, #12541 -- Added database routers, allowing for configurable database use behavior in a multi-db setup, and improved error checking for cross-database joins.

comment:5 Changed 5 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top