I build SaaS products and VS Code extensions. I write about GitHub, Copilot, and the workflows I use to ship software. Microsoft MVP (12x) · GitHub Star (4x).
Sometimes I code, always I write — A simple man making his way through the galaxy, writing as I go — 📚 Author of "Street-Smart Coding in the Age of AI": bit.ly/csarag-sscai
Location
Colombia 🇨🇴 (not Columbia)
Work
Content, Courses & Training for .NET teams — Helping teams to write maintainable & performant code
About caching: instead of memory or distributed, just go hybrid with FusionCache or HybridCache from Microsoft (or FusionCache via the HybridCache adapter).
Here's why:
memory cache is super fast but has problems with cold starts and horizontal scalability
distributed cache requires network trips + deserialization for every single call, you have to do serialization/deserialization manually and may not be always there
both memory and distributed cache don't have stampede protection
if you need to switch from memory to distributed you need to change all your code
With a hybrid cache like FusionCache the code always stays the same even if you add an L2 (distributed cache), it's fast as a memory cache, handles cold starts and horizontal scalability like a distributed cache, serialization is already taken care of and you always have full stampede protection.
Sometimes I code, always I write — A simple man making his way through the galaxy, writing as I go — 📚 Author of "Street-Smart Coding in the Age of AI": bit.ly/csarag-sscai
Location
Colombia 🇨🇴 (not Columbia)
Work
Content, Courses & Training for .NET teams — Helping teams to write maintainable & performant code
I thought pagination was a well-known strategy until I found multiple systems with performance issues by retrieving entire tables from the database and dumping them on the screen. Arrggg!
I build SaaS products and VS Code extensions. I write about GitHub, Copilot, and the workflows I use to ship software. Microsoft MVP (12x) · GitHub Star (4x).
Cool. I use Obsidian so can can keep m private wiki in source control and never have to worry about Notion not being available. I think the fear stems from clickup, a task/project management tools I used to use, going offline from time to time with my docs and tasks being unavailable.
I build SaaS products and VS Code extensions. I write about GitHub, Copilot, and the workflows I use to ship software. Microsoft MVP (12x) · GitHub Star (4x).
Cool tips. Just to note if you use projections, as long as you’re not projecting the entire entity, you don’t need to add AsNoTracking, it’s implicit.
Thanks for the tip!
I am not so expert in EF. :)
Didn't know about this. Thanks for sharing!
Hey Emanuele, good piece as always!
About caching: instead of memory or distributed, just go hybrid with FusionCache or HybridCache from Microsoft (or FusionCache via the HybridCache adapter).
Here's why:
With a hybrid cache like FusionCache the code always stays the same even if you add an L2 (distributed cache), it's fast as a memory cache, handles cold starts and horizontal scalability like a distributed cache, serialization is already taken care of and you always have full stampede protection.
My 2 cents.
I thought pagination was a well-known strategy until I found multiple systems with performance issues by retrieving entire tables from the database and dumping them on the screen. Arrggg!
nice tips Emanuele! thank you!
They come directly from my private knowledge base on my Notion 😊
Cool. I use Obsidian so can can keep m private wiki in source control and never have to worry about Notion not being available. I think the fear stems from clickup, a task/project management tools I used to use, going offline from time to time with my docs and tasks being unavailable.
Do you find Notion is sometimes unavailable?
You don't need
AsNoTrackingon Select queries, they are read-onlyProjection is automatically rendering AsNoTracking() pointless.
Anyways, lots of informative content. Thx
I read it in another comment, and yes. It works as you said.