dbTalk Databases Forums  

implementing a database log

comp.databases.theory comp.databases.theory


Discuss implementing a database log in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Christoph Rupp
 
Posts: n/a

Default implementing a database log - 04-21-2008 , 02:44 PM






Hi,

i'm the author of a simple open-source database engine. i'm currently
adding recovery/logging, and i have some practical questions about the
implementation.

I have 3 options.

1. a physical log based on modified pages - whenever a page is
modified, a before/after image is stored in the log.
pro: easy to implement and to test
con: logfile will become huge!

2. a physical log based on modified bytes - whenever a database key or
record is modified, only the modified bytes in the file are logged.
pro: logfile is slim, very fine-grained control
con: tedious to implement, error prone, difficult to test

3. a logical logging - information about the high-level operation is
stored in the logfile. honestly, i don't know how i could implement
this, since one high-level operation is often splitted into several
physical operations, and if one of them fails i am not sure about the
consequences...

currently, i'm going with 2), but as i wrote above, it's hard to
implement and i'm not happy with the way i'm going.

what would you recommend?

thanks for your opinions,
chris

Reply With Quote
  #2  
Old   
Brian Selzer
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:00 PM







"Christoph Rupp" <cruppstahl (AT) gmail (DOT) com> wrote

Quote:
Hi,

i'm the author of a simple open-source database engine. i'm currently
adding recovery/logging, and i have some practical questions about the
implementation.

I have 3 options.

1. a physical log based on modified pages - whenever a page is
modified, a before/after image is stored in the log.
pro: easy to implement and to test
con: logfile will become huge!

2. a physical log based on modified bytes - whenever a database key or
record is modified, only the modified bytes in the file are logged.
pro: logfile is slim, very fine-grained control
con: tedious to implement, error prone, difficult to test

3. a logical logging - information about the high-level operation is
stored in the logfile. honestly, i don't know how i could implement
this, since one high-level operation is often splitted into several
physical operations, and if one of them fails i am not sure about the
consequences...

currently, i'm going with 2), but as i wrote above, it's hard to
implement and i'm not happy with the way i'm going.

what would you recommend?

Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.

Quote:
thanks for your opinions,
chris



Reply With Quote
  #3  
Old   
Brian Selzer
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:00 PM




"Christoph Rupp" <cruppstahl (AT) gmail (DOT) com> wrote

Quote:
Hi,

i'm the author of a simple open-source database engine. i'm currently
adding recovery/logging, and i have some practical questions about the
implementation.

I have 3 options.

1. a physical log based on modified pages - whenever a page is
modified, a before/after image is stored in the log.
pro: easy to implement and to test
con: logfile will become huge!

2. a physical log based on modified bytes - whenever a database key or
record is modified, only the modified bytes in the file are logged.
pro: logfile is slim, very fine-grained control
con: tedious to implement, error prone, difficult to test

3. a logical logging - information about the high-level operation is
stored in the logfile. honestly, i don't know how i could implement
this, since one high-level operation is often splitted into several
physical operations, and if one of them fails i am not sure about the
consequences...

currently, i'm going with 2), but as i wrote above, it's hard to
implement and i'm not happy with the way i'm going.

what would you recommend?

Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.

Quote:
thanks for your opinions,
chris



Reply With Quote
  #4  
Old   
Brian Selzer
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:00 PM




"Christoph Rupp" <cruppstahl (AT) gmail (DOT) com> wrote

Quote:
Hi,

i'm the author of a simple open-source database engine. i'm currently
adding recovery/logging, and i have some practical questions about the
implementation.

I have 3 options.

1. a physical log based on modified pages - whenever a page is
modified, a before/after image is stored in the log.
pro: easy to implement and to test
con: logfile will become huge!

2. a physical log based on modified bytes - whenever a database key or
record is modified, only the modified bytes in the file are logged.
pro: logfile is slim, very fine-grained control
con: tedious to implement, error prone, difficult to test

3. a logical logging - information about the high-level operation is
stored in the logfile. honestly, i don't know how i could implement
this, since one high-level operation is often splitted into several
physical operations, and if one of them fails i am not sure about the
consequences...

currently, i'm going with 2), but as i wrote above, it's hard to
implement and i'm not happy with the way i'm going.

what would you recommend?

Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.

Quote:
thanks for your opinions,
chris



Reply With Quote
  #5  
Old   
Brian Selzer
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:00 PM




"Christoph Rupp" <cruppstahl (AT) gmail (DOT) com> wrote

Quote:
Hi,

i'm the author of a simple open-source database engine. i'm currently
adding recovery/logging, and i have some practical questions about the
implementation.

I have 3 options.

1. a physical log based on modified pages - whenever a page is
modified, a before/after image is stored in the log.
pro: easy to implement and to test
con: logfile will become huge!

2. a physical log based on modified bytes - whenever a database key or
record is modified, only the modified bytes in the file are logged.
pro: logfile is slim, very fine-grained control
con: tedious to implement, error prone, difficult to test

3. a logical logging - information about the high-level operation is
stored in the logfile. honestly, i don't know how i could implement
this, since one high-level operation is often splitted into several
physical operations, and if one of them fails i am not sure about the
consequences...

currently, i'm going with 2), but as i wrote above, it's hard to
implement and i'm not happy with the way i'm going.

what would you recommend?

Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.

Quote:
thanks for your opinions,
chris



Reply With Quote
  #6  
Old   
Brian Selzer
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:00 PM




"Christoph Rupp" <cruppstahl (AT) gmail (DOT) com> wrote

Quote:
Hi,

i'm the author of a simple open-source database engine. i'm currently
adding recovery/logging, and i have some practical questions about the
implementation.

I have 3 options.

1. a physical log based on modified pages - whenever a page is
modified, a before/after image is stored in the log.
pro: easy to implement and to test
con: logfile will become huge!

2. a physical log based on modified bytes - whenever a database key or
record is modified, only the modified bytes in the file are logged.
pro: logfile is slim, very fine-grained control
con: tedious to implement, error prone, difficult to test

3. a logical logging - information about the high-level operation is
stored in the logfile. honestly, i don't know how i could implement
this, since one high-level operation is often splitted into several
physical operations, and if one of them fails i am not sure about the
consequences...

currently, i'm going with 2), but as i wrote above, it's hard to
implement and i'm not happy with the way i'm going.

what would you recommend?

Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.

Quote:
thanks for your opinions,
chris



Reply With Quote
  #7  
Old   
Brian Selzer
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:00 PM




"Christoph Rupp" <cruppstahl (AT) gmail (DOT) com> wrote

Quote:
Hi,

i'm the author of a simple open-source database engine. i'm currently
adding recovery/logging, and i have some practical questions about the
implementation.

I have 3 options.

1. a physical log based on modified pages - whenever a page is
modified, a before/after image is stored in the log.
pro: easy to implement and to test
con: logfile will become huge!

2. a physical log based on modified bytes - whenever a database key or
record is modified, only the modified bytes in the file are logged.
pro: logfile is slim, very fine-grained control
con: tedious to implement, error prone, difficult to test

3. a logical logging - information about the high-level operation is
stored in the logfile. honestly, i don't know how i could implement
this, since one high-level operation is often splitted into several
physical operations, and if one of them fails i am not sure about the
consequences...

currently, i'm going with 2), but as i wrote above, it's hard to
implement and i'm not happy with the way i'm going.

what would you recommend?

Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.

Quote:
thanks for your opinions,
chris



Reply With Quote
  #8  
Old   
Brian Selzer
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:00 PM




"Christoph Rupp" <cruppstahl (AT) gmail (DOT) com> wrote

Quote:
Hi,

i'm the author of a simple open-source database engine. i'm currently
adding recovery/logging, and i have some practical questions about the
implementation.

I have 3 options.

1. a physical log based on modified pages - whenever a page is
modified, a before/after image is stored in the log.
pro: easy to implement and to test
con: logfile will become huge!

2. a physical log based on modified bytes - whenever a database key or
record is modified, only the modified bytes in the file are logged.
pro: logfile is slim, very fine-grained control
con: tedious to implement, error prone, difficult to test

3. a logical logging - information about the high-level operation is
stored in the logfile. honestly, i don't know how i could implement
this, since one high-level operation is often splitted into several
physical operations, and if one of them fails i am not sure about the
consequences...

currently, i'm going with 2), but as i wrote above, it's hard to
implement and i'm not happy with the way i'm going.

what would you recommend?

Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.

Quote:
thanks for your opinions,
chris



Reply With Quote
  #9  
Old   
Brian Selzer
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:00 PM




"Christoph Rupp" <cruppstahl (AT) gmail (DOT) com> wrote

Quote:
Hi,

i'm the author of a simple open-source database engine. i'm currently
adding recovery/logging, and i have some practical questions about the
implementation.

I have 3 options.

1. a physical log based on modified pages - whenever a page is
modified, a before/after image is stored in the log.
pro: easy to implement and to test
con: logfile will become huge!

2. a physical log based on modified bytes - whenever a database key or
record is modified, only the modified bytes in the file are logged.
pro: logfile is slim, very fine-grained control
con: tedious to implement, error prone, difficult to test

3. a logical logging - information about the high-level operation is
stored in the logfile. honestly, i don't know how i could implement
this, since one high-level operation is often splitted into several
physical operations, and if one of them fails i am not sure about the
consequences...

currently, i'm going with 2), but as i wrote above, it's hard to
implement and i'm not happy with the way i'm going.

what would you recommend?

Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.

Quote:
thanks for your opinions,
chris



Reply With Quote
  #10  
Old   
Brian Selzer
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:00 PM




"Christoph Rupp" <cruppstahl (AT) gmail (DOT) com> wrote

Quote:
Hi,

i'm the author of a simple open-source database engine. i'm currently
adding recovery/logging, and i have some practical questions about the
implementation.

I have 3 options.

1. a physical log based on modified pages - whenever a page is
modified, a before/after image is stored in the log.
pro: easy to implement and to test
con: logfile will become huge!

2. a physical log based on modified bytes - whenever a database key or
record is modified, only the modified bytes in the file are logged.
pro: logfile is slim, very fine-grained control
con: tedious to implement, error prone, difficult to test

3. a logical logging - information about the high-level operation is
stored in the logfile. honestly, i don't know how i could implement
this, since one high-level operation is often splitted into several
physical operations, and if one of them fails i am not sure about the
consequences...

currently, i'm going with 2), but as i wrote above, it's hard to
implement and i'm not happy with the way i'm going.

what would you recommend?

Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.

Quote:
thanks for your opinions,
chris



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.