durusmail: durus-users: Re: Backup, redundancy etc.
Re: Backup, redundancy etc.
2007-04-11
2007-04-11
2007-04-11
2007-04-11
2007-04-12
2007-04-12
2007-04-11
2007-04-17
2007-04-17
2007-05-02
Re: Backup, redundancy etc.
Andrew Bettison
2007-04-11
Peter Wilkinson  wrote:
> I've been thinking about how best to get backup and redundancy
> working with Durus and was wondered how other people deal with these
> issues.

I have recently implemented a variant of FileStorage, which I call
SharedFileStorage, which allows more than one process to have a single
storage file open for reading and writing at once.  It uses flock(2)
advisory locks to prevent racing and to maintain integrity.  It also
supports "live" packing while other processes are still using the file,
which was no mean feat.  It only runs on Posix systems, and I haven't
checked if it is thread-safe.  Its file format is almost identical to
the FileStorage format, but with a few extra fields to support the
concurrency.  When you have several processes running on the same
machine, sharing the same storage, SharedFileStorage is more efficient
than using a Durus server, but I haven't made any formal measurements to
support this assertion.

I have contemplated using SharedFileStorage to implement support for
live "mirror" file storages, which would receive incremental changes in
batches from a central, "master" storage, and update themselves
accordingly.  "Mirror" storges would only permit read-only access in
order to not violate transactional integrity.

The problem I would hope to solve with this master/mirror scheme is a
small business who keep their stock database on a local, in-house
server, and occasionally connect to the Internet, whereupon all changes
would be transmitted to a live mirror of their database which lives on
their web presence provider's server, and is used in read-only mode by
the web server to provide online shopping services.

I suppose some kind of mechanism could be worked out to handle switching
a "mirror" into "master" mode in the event that the master file were
irretrievably lost and a mirror needed to be used as a backup.

--
Andrew Bettison 
reply