[asterisk-users] Write to multiple databases as redundancy scheme
David Gomillion
david.gomillion at gmail.com
Fri Jun 8 14:16:31 CDT 2007
On 6/8/07, Justin Moore <wantmoore at gmail.com> wrote:
>
> On 6/8/07, Chris Mason (Lists) <lists at masonc.com> wrote:
> > It would be better to let MySQL handle that - use the built-in
> > replication facilities. It's easy to setup.
>
> That's a great idea for backup purposes, but if the OP is wanting true
> redundancy, that won't help much. What happens then when the primary
> box fails? CDR not written to the primary can't be replicated...
If it's only for the unlikely event that a DB server is unavailable, why not
have it log the CDR in text and in MySQL? If the DB server is unavailable,
the records could be parsed from the text file and the database updated.
Of course, if you had to do this more than once or twice, it would get a bit
annoying, I'm sure. But then again, write the script to do it, and use it to
populate the other databases? Dunno, just thinking out loud here.
I've written a few parsers, and the format appears to be easy to parse. It
really wouldn't be too big of a deal. The hardest part will be kicking it
off (I'd use cron), parsing the file (my personal preference would be perl
or PHP), updating the database, and making sure you don't insert duplicates.
I think I would use the UniqueID as they key, and then just use INSERT
statements. You may need an IGNORE in it to allow it to keep going, even
when there are duplicates. It's been a while since I wrote something to
update a DB where I was unsure of the data hygiene.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070608/536df468/attachment.htm
More information about the asterisk-users
mailing list