[asterisk-dev] Multiple MySQL Database ‘Syncing’ Within an Asterisk Cluster
Joseph Benden
joe at thrallingpenguin.com
Wed Jul 12 19:55:11 MST 2006
Wouldn't it make sense to abstract the MySQL calls into ast_X functions?
Then one ast_mysql_query() could test the beginning of the query and if
it contains "SELECT" automatically use the read connections, else use
the write connection. Additionally, logic for auto sensing DB connection
failures and recovering becomes easier.
Also, by doing this you give the ability to implement multiple load-
balancing algorithms, collect stats, use a connection pools with mutexes
on the connection handles - instead of global ones thus increasing
concurrency. (Does not have to initially, but design it for the
future...)
It could be done using the regular MySQL API, but the code will quickly
become spaghetti and really hard to track problems.
-Joe
Thralling Penguin LLC
On Tue, 2006-07-11 at 17:19 +1200, Matt Riddell (IT) wrote:
> JR Richardson wrote:
> > Just need to bounce this off of you guys, help get my mind right………….
>
> http://bugs.digium.com/view.php?id=5881
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20060712/1be94170/attachment.htm
More information about the asterisk-dev
mailing list