MySQL and Postgres both have "replication" facilities,
which probably do what you want to do, only they've been
written and tested already, and are supported in a
commercial capacity should you require it.
Further, if you're using BerkleyDB, you could very easily
switch to an RDBMS by tying your data to SQL instead of
a flat file. Your program will hardly notice the difference.
There are several examples of this sort of thing floating
around, one of which is in the
MySQL and mSQL
book from
O'Reilly.
You won't be able to use any of the fancy SQL features
without rewriting parts, of course, but at least this
is optional.