Re: Replication in databases
Date: Thu, 16 Oct 2008 14:18:28 -0700 (PDT)
I'm implementing my own database, and therefore i was thinking about
the same question. (i have not yet implemented recovery, because
there's so much other stuff to do).
Currently my idea is to send the log over the net, because in my
design i do not log physical pages, instead i just log the modified
Currently my idea is to send the log over the net, because in my design i do not log physical pages, instead i just log the modified key/record items.
Of course i could also send the queries, but that's way more complex to implement. Assume you want to insert a few items into your local database. The query is sent to the remote node, and in case of success it's also inserted locally. If you send the query to the remote node, but then don't receive an answer because your network switch exploded, you do not know which part of the query (if any) was already executed, and then recovery becomes difficult (and network problems happen very often).
If you send the log, recovery is easier because each log entry has a unique ID (lsn - log serial number) and can be applied atomically. Received on Thu Oct 16 2008 - 23:18:28 CEST