List Info

Thread: Re: Accessing Multiple Databases




Re: Accessing Multiple Databases
user name
2007-12-29 14:19:21

On Dec 13, 10:54 am, birkin <birkin.di...gmail.com> wrote:
> For one of my projects I import data from a
non-django-controlled
> database using the MySQLdb python library, populate
adjangomodel
> object and save it (to my app's django-controlled
database table).
> Works smoothly.

I did something similar to import product data from an
osCommerce
database into Django-space.

Although this solved our immediate problem, it created new
ones of its
own.

1. If the table is read-only (which it was in our case),
then how do
you know when to refresh it from the master? Since changes
to the
master were relatively infrequent, our solution was to have
a cron job
do this each night + a manual push-the-button page in Django
where the
store admin can force it. Inelegant, but functional.

2. If the table is read-write, now you've got problems. You
have the
refresh-from-the-other-DB problem in #1 plus you need to
intercept all
save() operations to your Django table and duplicate it on
the other
system. And don't even think about any kind of ACID
promises. Yuck!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )