Click here to Skip to main content
Click here to Skip to main content

Common serialization mistakes to avoid

By , 17 May 2011
Rate this:
Please Sign up or sign in to vote.
Caching frequently used objects, that are expensive to fetch from the source, makes application perform faster under high load. It helps scale an application under concurrent requests. But some hard to notice mistakes can lead the application to suffer under high load, let alone making it perform better, especially when you are using distributed caching where there’s separate cache server or cache application that stores the items. Moreover, code that works fine using in-memory cache can fail when the cache is made out-of-process. Here I will show you some common distributed caching mistakes that will help you make better decision when to cache and when not to cache.
Here are common mistakes we make that makes performance worse:
* Relying on .NET’s default serializer.
* Storing large objects in a single cache item.
* Using cache to share objects between threads.
* Assuming items will be in cache immediately after storing it.
* Storing entire collection with nested objects.
* Storing parent-child objects together and also separately.
* Caching Configuration settings.
* Caching Live Objects that has open handle to stream, file, registry, or network.
* Storing same item using multiple keys.
* Not updating or deleting items in cache after updating or deleting them on persistent storage.

For detail explanations of these, you can read these article:
Ten Caching Mistakes that Break your App[^]


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Comments and Discussions

GeneralDistributed caching. Pinmemberwesnur31-May-11 19:10 
GeneralRe: Distributed caching. PinmvpOmar Al Zabir1-Jun-11 22:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140421.2 | Last Updated 17 May 2011
Article Copyright 2011 by Omar Al Zabir
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid