Subject Re: [firebird-support] Re: FB database in RAM
Author Kjell Rilbe
Den 2011-08-08 08:47 skrev karolbieniaszewski såhär:
> i have one installation with "the same" database size - 48 GB on
> RAM-DISC but i do somethink like this.
>
> I put database on RAM-DISC but for may purposes only nightly backup was
> not acceptable solution - becaouse of that i use shadow file also
> on RAID volume :)

Interesting. Shadow files are supposed to be an ancient and deprecated
technology. Maybe it's time for a revival? :-) I'll have to do some
reading...

So, what about writes? Are writes slower than with a harddisk-only
solution? I'd assume both shadow files have to be written always...? So
a write will force the client to wait until *BOTH* RAM *AND* disk have
been written.

> Benefits - very very fast read operations and no loos of data.
> I make script for activating (shadows) and restoring database in
> ram-disc if some totally power failture occure - UPS also can fail and
> do problems

So, does this mean that you can go online immediately after a reboot
using the disk copy, while FB is at work copying data to a new RAM disk
copy?

Is this how it works:

1. Go online with the disk copy as primary and RAM copy as
secondary/shadow. FB starts copying data to the RAM shadow...
Performance will be as with a regular disk based database (or worse, due
to the shadow copying being in progress).

2. When FB is done copying data the RAM shadow, you switch and make the
RAM copy primary and the disk copy secondary/shadow. Performace is now
lightning fast for selects, but inserts and updates still have to go to
disk and are as slow as with a regular disk based database (or worse
because it also has to work with the RAm copy).

Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64