C# – Moving from local storage to a remote database: how should I cache the data locally

cdatabase

I have a .NET (C#) application that I am releasing soon, which also has some support files. Right now I am storing those files as .txt files, and I update them as necessary whenever the application version changes. I am wondering if a better solution might be to store the information in those files in a central database instead, and have all clients access that database when then launch. This would prevent the need to update the software each time those reference files change.

My question for the gurus here is this: Is this a wise decision, and if so…what would be the best method of storing the downloaded data? A temp file? in memory? something else? Any help would be appreciated.

Best Answer

Keep things simple:

Your application already works with text files, no need to change any of that. Once, on startup, pull a file from your central server that just has a simple version number in it. If the version has increased, pull down the updated files.

All of your currently existing code doesn't change. The logic on startup is dead simple, and shouldn't take more than a few hours to implement. And best of all, if your server is down for some reason, the app can still function.