AA> Am 03.10.2007 um 12:36 schrieb Andrey Khavryuchenko:

 AA> It's possible to use circular replication together with some free  
 AA> load balancing software. 

As I've told earlier, I know perfectly about circular replication.

 AA> Then there's MySQL Proxy that allows you to manipulate queries on
 AA> their way to the server to implement load balancing and, in the near
 AA> future, connection pooling. With the embedded lua engine, it should be
 AA> even possible to do query redirection/filtering but I haven't
 AA> investigated it yet. So I think that in the middle/long term there's
 AA> no need to put more logic in this regard into Django.

Reread what you've wrote:  MySQL Proxy manipulates *queries*, not
transactions.

Imagine something like:

sql: BEGIN TRANSACTION;

sql: SELECT * FROM something WHERE id=198273;

py: if queryset.count()==0:
py:    MyObject.objects.create(**data)

sql: END TRANSACTION;

MySQL proxy or any other query-level solution has no way to know that first
select should go to the master server, so it would be routed to a slave,
that, what a coinsidence, is a second behind the master and the master
*just* got that specific record.  Voila, duplicate records and you can't
reproduce it unless you already know the cause.

Transaction-level solution requires some effort from developer to tell
which transactions modify data and which don't - exactly the stuff I wrote
in the post [1].

Footnotes: 
[1]  http://a.khavr.com/2007/10/01/how-to-use-mysql-replication-in-django/

-- 
Andrey V Khavryuchenko - http://a.khavr.com/
Django NewGate -  http://www.kds.com.ua/djiggit/
Chytach - http://www.chytach.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to