3

I have an application that is written in ASP.NET MVC 5. This generate lots of database transactions.

I don't have server slave to dedicate for reporting so I need to use a second level caching in Entity framework to cache all the queries that are generated by the reports.

The idea here is to reduce the amount of the queries that have to hit the database especially when multiple users are trying to view the same report. so if I have 5 people that want to view a dashboard, only one will hit the database and the rest will read the data set stored in the cache. This should improve the reports performance, reduce the database locks and improve my application performance.

Is it possible to use Memcached or Redis with Entity framework where the data set is cached after the query is executed for a set amount of time. And of course before the query is executed, the cache will be checked for existing dataset before a hard inquiry is executed at the server.

I came across NCache which seems to be exactly what I am trying to accomplish but unfortunately it is pricey.

Basit Anwer
  • 6,742
  • 7
  • 45
  • 88
Jaylen
  • 39,043
  • 40
  • 128
  • 221

1 Answers1

1

While you're right that NCache is "pricey" when compared with Redis or Memcache but its with good reason.

The entity framework provider model that you're after comes with the NCache Enterprise edition. It will save you a lot of DEV time. For more information let me just point you to the right article

Entity Framework Caching with NCache

And since you'll be paying for the product you can enhance your application response times with many many more ways and features.

To get more information try Memcache Comparison and the Redis Comparison

While if you're still persistent about Memcache then Julie Lerman has a good article about implementing a second level cache in an Entity Framework. Or you could use any other open source Entity Framework module from github and embrace the bugs as well e.g. EFRedis

Full Disclosure: I work for Alachisoft ©

Basit Anwer
  • 6,742
  • 7
  • 45
  • 88