I have to reload a huge database by a program regularily. There are two datasources for this database, but there are some user inputed information in the database too, like comments. here are some experiences I gain from doing this:
(1) selected the user inputed information into a hashtable or arraylist with database primary key, a simple struct or class will serve the purpose
(2) in database table, have backup indicator column, when insert, only insert as backup data
(3) keep count the error rate when inserting
(4) at the end, if everything is fine, error rate is low, delete the no-backup data and flipover backup data to live
(5) make sure all queries to the database only get live data, not backup data. Or to create a view for this
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment