What do you'll think the best option is for local caching of online db incase no inet

trend

Well-known member
Joined
Oct 12, 2004
Messages
171
I am wondering what youll think the best option for this scenaro:

I have some software that needs access to the internet to send error reports and some other random stuff.

This software accesses a db (right now an access db) to get pricing info and availability (availability is updated upon item purchased) and the db does some other random stuff.

I really want this software to be able to use the internet connection to access an xml file on a websierver.. or an mysql server or ms sql server.. but my only problem is I am scared the internet might go down.. and if this happens, and no one can pull up pricing info and availability and there will be some pisses off people.

So I was just wondering what youll do for something like this.. Do youll cache the db once a day or something just incase something like this happens? or what.

I would just do something as simple as this:
If internet_connection = true then
use db at database.server.com
elseif internet_connection = false then
use db at C:\
end if

But, then all things would get out of sync if the internet connection goes down.. this is because I need to read and write to a db... so I would then need to be able to resync the db.. which this sounds way over my head (not sure if it is or not :/)

any ideas?

thanks! Lee
 
Do the users have a local server? If so, you could put a copy of the database there and use date/time stamps. Have a timer setup that wouldfire every so often to check if the Internet is available. If it available, use the date time stamps to update the newest information to the web database and update the pricelist. This would keep you from having multiple databases one on every users computer.

Chester
 
well each client computer wouldnt have a lan to connect them. (they are going to be 50miles or more appart).

I was thinking about having a client side and server side sql server.. but I really dont want to have 2 db servers.. I was hoping there was some way of caching whole tables ina db server in vb.net so that if the client computer doesnt have access to the internet at the moment.. it still can query and get the info.. And the client computer could also update the cached db.. Also if the internet is ever discovered down.. there would be a timer that would fire every 5 minutes or whenever to try to connect to the db.. and if internet=true, update db with cached db info

thanks for the idea though :)
 
Interesting.. do you think this is better than using ado.net in disconnect mode?
 
If you have a disconnected dataset in stored in memory, you can syncronize with the main db ever so often. However, what happens if you have a computer crash or power interruption? Whatever was in the dataset on that PC is now gone. So where will that leave your user if they have not syncronized in say 15-30 minutes and they for example had a huge order they took care of. That order is now gone. Dues to the fact that .net uses XML primarily when dealing with dbs, michael_hks suggesting is actually a very good idea for when you can not sync up with the main db pver the internet. It is fast and efficient and if the pc crashes or anything, the file is right there on the pc so they can pick up right where they left off. :)

Chester
 
cpopham said:
If you have a disconnected dataset in stored in memory, you can syncronize with the main db ever so often. However, what happens if you have a computer crash or power interruption? Whatever was in the dataset on that PC is now gone. So where will that leave your user if they have not syncronized in say 15-30 minutes and they for example had a huge order they took care of. That order is now gone. Dues to the fact that .net uses XML primarily when dealing with dbs, michael_hks suggesting is actually a very good idea for when you can not sync up with the main db pver the internet. It is fast and efficient and if the pc crashes or anything, the file is right there on the pc so they can pick up right where they left off. :)

Chester
Ahh I see now.. How hard it is syncronizing a xml file with a db?
 
Back
Top