2
votes

We are running our application in Windows Azure. We are experiencing performance problems with SQL Azure so we are looking into implementing a second level cache. With the ORM that we are currently using this is quite difficult to accomplish.

What about Entity Framework second level cache? Specifically when using Windows Azure cache(*). I know that it is currently not supported out-of-the-box and that are are some wrappers available. But are there any future plans on supporting this out-of-the-box?

(*) The idea is to use a certain percentage of the Web roles memory for caching. For example using 5 medium Web roles and 20% memory for cache will mean a consistent cache of 3.5 GB.

2
Do you understand the performance problems you have? For instance with Sql Azure it makes sense to use eager loading (i.e. .Include) instead of lazy loading since it usually takes less time to execute one query that returns 500 entities instead of 500 queries returning 1 entity each. There is also a caching provider sample out there. I blogged about using it with CodeFirst some time ago: blog.3d-logic.com/2012/03/31/… Hope this helps a bit. - Pawel

2 Answers

1
votes

This recent article from Julie Lerman http://msdn.microsoft.com/en-us/magazine/hh394143.aspx covers how to setup second level caching for EF and with Azure cahe. We are looking at doing same thing but haven't had time to actually implement it yet.

As for future native support I haven't seen mention on EF6 roadmap I don't think.

However now it's open sourced seems to be a lot happening. Maybe worth checking and voting on for it on EF user voice.

Entity Framework extended also allows you to control caching of queries.