Click here to Skip to main content
15,886,069 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
QuestionCreating v2.0 of a legacy client/server application Pin
sephus617-Oct-12 10:00
sephus617-Oct-12 10:00 
AnswerRe: Creating v2.0 of a legacy client/server application Pin
Eddy Vluggen18-Oct-12 5:15
professionalEddy Vluggen18-Oct-12 5:15 
AnswerRe: Creating v2.0 of a legacy client/server application Pin
jschell18-Oct-12 10:02
jschell18-Oct-12 10:02 
QuestionSuggestions on implementing a search engine Pin
Sau00210-Oct-12 22:24
Sau00210-Oct-12 22:24 
AnswerRe: Suggestions on implementing a search engine Pin
Eddy Vluggen10-Oct-12 23:53
professionalEddy Vluggen10-Oct-12 23:53 
AnswerRe: Suggestions on implementing a search engine Pin
jschell11-Oct-12 9:02
jschell11-Oct-12 9:02 
QuestionDataCache Design Pin
nitin_ion9-Oct-12 20:20
nitin_ion9-Oct-12 20:20 
AnswerRe: DataCache Design Pin
dojohansen10-Oct-12 4:53
dojohansen10-Oct-12 4:53 
It depends.

If it's ADO.NET and SQL2005 or higher, you can define a "cache dependency" that automatically refreshes cached stuff when it changes in the database. I suspect it relies on the fact that SQL2005 can host the CLR to have a way to swap the ordinary roles (ordinarily we use database servers as... SERVERS, but here the *server* needs to notify a *client*, which simply isn't possible given the definitions of what a client and a server is).

If it's ADO.NET and an older SQL server version I believe there's a cache dependency that *might* help. It depends. This thing uses a polling model, which means there's a delay involved. Dirty cache reads are still possible. If dirty reads causes serious problems, you can't use this. If seeing the old data is OK for a short time after it has really changed, you probably can use it.

Otherwise, you probably have to write the code yourself to keep the cache in sync. If the data is only modified by a single instance of your own application this isn't really difficult to accomplish. If there are multiple instances it gets more complicated, unless the instances are operating on isolated subsets of the data, since you will now need to establish some mechanism to ensure caches are kept in sync. It will also mean a performance hit and will require distributed transactions.

Cache invalidation is one of the hardest problems in all of common practical programming. In many cases, there are better practical approaches. Rather than trying to solve the cache invalidation problem, it may be easier and good enough to combine imperfect caching with optimistic concurrency. Concurrency is an often-ignored aspect of multi-user systems that you should probably address anyway (most apps should, but few do). Depending on how you handle concurrency violations (e.g. you could let the user resolve conflicts) having this in place often makes it acceptable to live with some dirty cache data.

You can use a timeout policy to prevent old data from sticking around for too long. Volatile data should perhaps not be cached at all. The ideal cache item is one that is expensive to get but changes infrequently. And never cache stuff that is inexpensive to get for a very long time. Saving a millisecond makes sense in something that happens often, but whether you save a millisecond every minute or every hour is not going to make any difference to the performance of your system. So in such cases, use a short timeout.

Also don't forget that there are frequently opportunities to influence how expensive stuff actually is to get. Look for opportunities to fetch (or compute) more than one thing at a time. Think about what information the application needs to get to show a much-accessed screen. Or better yet, run some profiling sessions and find out exactly what information the application gets, how often it gets *the same* information, and so on.
QuestionAlgorithm help, Splitting up multiple readings Pin
glennPattonWork39-Oct-12 0:54
professionalglennPattonWork39-Oct-12 0:54 
AnswerRe: Algorithm help, Splitting up multiple readings Pin
Eddy Vluggen9-Oct-12 1:29
professionalEddy Vluggen9-Oct-12 1:29 
GeneralRe: Algorithm help, Splitting up multiple readings Pin
glennPattonWork39-Oct-12 2:07
professionalglennPattonWork39-Oct-12 2:07 
Questionhelp on MATLAB Pin
李不凡 Dec20127-Oct-12 22:35
李不凡 Dec20127-Oct-12 22:35 
AnswerRe: help on MATLAB Pin
Richard MacCutchan8-Oct-12 2:45
mveRichard MacCutchan8-Oct-12 2:45 
GeneralRe: help on MATLAB Pin
李不凡 Dec20128-Oct-12 2:55
李不凡 Dec20128-Oct-12 2:55 
GeneralRe: help on MATLAB Pin
Thomas Daniels8-Oct-12 3:18
mentorThomas Daniels8-Oct-12 3:18 
GeneralRe: help on MATLAB Pin
李不凡 Dec20128-Oct-12 3:36
李不凡 Dec20128-Oct-12 3:36 
QuestionC++ GUI Framework Pin
Kosta Cherry25-Sep-12 11:05
Kosta Cherry25-Sep-12 11:05 
AnswerRe: C++ GUI Framework Pin
Richard MacCutchan25-Sep-12 22:09
mveRichard MacCutchan25-Sep-12 22:09 
GeneralRe: C++ GUI Framework Pin
Kosta Cherry26-Sep-12 5:40
Kosta Cherry26-Sep-12 5:40 
GeneralRe: C++ GUI Framework Pin
Richard MacCutchan26-Sep-12 5:57
mveRichard MacCutchan26-Sep-12 5:57 
GeneralRe: C++ GUI Framework Pin
Kosta Cherry26-Sep-12 6:15
Kosta Cherry26-Sep-12 6:15 
GeneralRe: C++ GUI Framework Pin
Richard MacCutchan26-Sep-12 6:34
mveRichard MacCutchan26-Sep-12 6:34 
AnswerRe: C++ GUI Framework Pin
Bernhard Hiller25-Sep-12 23:06
Bernhard Hiller25-Sep-12 23:06 
GeneralRe: C++ GUI Framework Pin
Kosta Cherry26-Sep-12 5:48
Kosta Cherry26-Sep-12 5:48 
GeneralRe: C++ GUI Framework Pin
.Shoaib30-Sep-12 23:26
.Shoaib30-Sep-12 23:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.