Subject | Different ways of implementing briefcase-support |
---|---|
Author | Petter Holmström |
Post date | 2003-07-22T00:05:40Z |
Hello,
I need to implement some kind of briefcase-support in my application.
I've thought about different ways of achieving this, but I still have
not decided which one to use. I would very much appreciate if you
could share your experiences on this matter.
The replication-system must not be database-specific, that is it must
work on different databases with different tables. It must also be
able to handle foreign-keys.
These are the different methods I've come up with:
1. Compare the briefcase database with the master database, table by
table, record by record. Generate an SQL-script with INSERTS, UPDATES
and DELETES. Run the script.
2. Compare the briefcase database with the master database and make
the changes directly without generating a different SQL-script.
3. Create a changelog table in the database, where all changed fields
are logged (together with the table name, timestamp, etc.). Then
generate an SQL-script using the data in this table. Run the script.
4. Create a changelog table in the database. Store all INSERTS,
UPDATES and DELETES.
5. Keep copies of all tables, one "real" table and one table
containing only the changes made since a certain date and time.
Which one of these is the best one, or do you have an even better idea?
Thanks in advance,
-Petter-
I need to implement some kind of briefcase-support in my application.
I've thought about different ways of achieving this, but I still have
not decided which one to use. I would very much appreciate if you
could share your experiences on this matter.
The replication-system must not be database-specific, that is it must
work on different databases with different tables. It must also be
able to handle foreign-keys.
These are the different methods I've come up with:
1. Compare the briefcase database with the master database, table by
table, record by record. Generate an SQL-script with INSERTS, UPDATES
and DELETES. Run the script.
2. Compare the briefcase database with the master database and make
the changes directly without generating a different SQL-script.
3. Create a changelog table in the database, where all changed fields
are logged (together with the table name, timestamp, etc.). Then
generate an SQL-script using the data in this table. Run the script.
4. Create a changelog table in the database. Store all INSERTS,
UPDATES and DELETES.
5. Keep copies of all tables, one "real" table and one table
containing only the changes made since a certain date and time.
Which one of these is the best one, or do you have an even better idea?
Thanks in advance,
-Petter-