#33496: mirror database in django
-------------------------------------+-------------------------------------
     Reporter:  M Hadi Azarabad      |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  4.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  multi-database /     |             Triage Stage:
  mirror database                    |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Tim Graham:

Old description:

> Hi. I'm looking for a solution to save data on mirror database. using
> database routers allow us to save a record and let's us decide which
> database must be used and i think manual database selection is not
> optimal because it uses ORM to create raw SQL twice or more (based on
> number of mirror database).
> ```
> model_obj.save(using='db_1')
> model_obj.save(using='db_2')
> ```
>  i think django can handle this problem and optimize it by adding setting
> list variable called MIRROR_DATABASES so all mirror databases place in
> there and django save all of records by creating one raw SQL if mirror
> databases using the same backend

New description:

 Hi. I'm looking for a solution to save data on mirror database. Using
 database routers allow us to save a record and lets us decide which
 database must be used and I think manual database selection is not optimal
 because it uses ORM to create raw SQL twice or more (based on the number
 of mirror database).
 {{{
 model_obj.save(using='db_1')
 model_obj.save(using='db_2')
 }}}
 I think django can handle this problem and optimize it by adding setting
 list variable called `MIRROR_DATABASES` so all mirror databases place in
 there and Django save all of records by creating one raw SQL if mirror
 databases using the same backend.

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33496#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.e5f877065415393372f5bde675628184%40djangoproject.com.

Reply via email to