3

We have multiple lookup tables in a SQL Server database. Tables are used in application dropdown menus.

AddressType:

  • Home
  • Business

ProductType:

  • Books
  • Food
  • Electronics

Instead of continually reading database lookup tables, team wants to apply MemoryCache or Redis Cache (to reduce database load, and increase in-memory performance). However, we learned that Entity Framework Core DbContext already has caching.

So in this case, would there be any value in caching looking tables, if after a certain amount of reads, the DbContext does this already? Would adding more caching code for MemoryCache/Redis over DbContext help? Or would it be an unnecessary layer?

  • Hi, It depends on your requirement. You can use memory cache provided by EF Core. But if you have multiple servers you will need distributed caching and for that you will need NCache, Redis etc. – saif iqbal Sep 30 '19 at 07:08

0 Answers0