svrx
svrx

Reputation: 634

What is the best way to cache a dataset with memory like performance, and having it tied to database changes?

Have anyone came across a opensource project or library in .Net to act as a caching layer between database and the aplication that automaticaly or on request sincronizes the data, so that performance could be improved.

The .Net stack as some festures that can be used, like SqlDependencies and the Cache, but both have problems.

Tested alternatives:

Any sugestions on system specialized in this task? Any good ORM that can do that?

Upvotes: 3

Views: 1781

Answers (2)

Jonathan Dickinson
Jonathan Dickinson

Reputation: 9218

You might want to have a look at AppFabric. One of its components is Velocity (which was a research in-memory distributed cache). It's only supported on server editions of Windows.

Upvotes: 2

TheCodeKing
TheCodeKing

Reputation: 19220

OuputCaching is a very good way to optimize an application. Even just caching a page for 30sec makes a massive difference to an application under heavily load. VaryByCustom allows a great deal of control over how data is cached, as does the .NET output caching engine.

If seeing real-time changes isn't critical, I'd suggest this as a possible alternative to keeping your data in memory, and even then I'd consider optimising specific pieces of data or objects. Keeping DataSets in memory doesn't scale - but of course it depends on your requirements. If you only have a small DataSet and can cache it in the Application cache then that's not such as bad idea.

Upvotes: 1

Related Questions