01.01.2020

Appfabric Cache Serialization

67

If the performance of a.NET application is effected during the peak load times, it is the end users who will be effected ultimately. This is the reason why distributed caching has become a hot cake for the.NET developers. It not only boost the performance of the application during peak load times, but it also provides scalability and reliability. There are numbers of third party distributed cache providers which are doing very good job, NCache and App Fabric being the two most famous ones.Below is a list of features which make NCache the premier distributed cache provider.

1- Rich set of object caching features:a: Cache Dependency for data relationship mgmt:i) Key basedii) File basediii)Customb: Database synchronizedi).NET events based with sqlCacheDependency for SQL 2005/2008 or Oracle on Windows.ii) Polling based for any OLEDB compliant databasec: Absolute expirationsd: Group/sub-group itemse: Searchingi) Object Query Languagesii) LINQ based searchingf: Streaming API for audio/video content:g: Event Notificationi) AppFabric Key based notifications are not flexible you cannot register for specific event. If you enable notification on a key you will be notified whenever one of the followings happens (AddItem, ReplaceItem, RemoveItem, CreateRegion, RemoveRegion, ClearRegion). NCache on the other hand lets you specify an exact event on which to be notified so your app is not overwhelmed with unnecessary notificationsii) Custom notifications that are initiated by client apps and used for using NCache as a runtime data sharing platform among different apps.h: Read-thru/Write-thru/Write-behindi: Compact serializationprovides a dynamic compact serialization which does not require any programming but is faster and more compact than regular.NET serialization. It also allows you to cache third-party objects that are otherwise not serializable.j: Cache Loaderto pre-populate the cache upon startup 2: Dynamic Clustering & quick Failover with consistent data:i) AppFabric has a single point of failure if the server that contains your cluster information goes down the whole cluster shuts down failing your application completely. On the other hand, NCache has a peer to peer dynamic clustering without single point of failure. You can add/drop any servers at runtime without stopping your application.

Partition-Replica is totally dynamic with high availability in NCache.ii) AppFabric failover results in data loss whereas with NCache 100% consistent data is seamlessly available before and after the failover.iii) AppFabric requires a minimum of 3 nodes to satisfy the “majority lead hosts” rule even for this partial failover with some data loss whereas NCache requires just 2 servers for loss-less quick failover. 3- Change cluster configurations on the fly:i) Unlike AppFabric, where you have to stop the entire cluster and your application to do any change on cluster configurations, the dynamic clustering in NCache allows you to change cluster configurations on the fly with “Hot Apply Configuration” option.ii) You can increase the size of your cluster if your user base increases without stopping your cluster or your application. 4- Caching Topologies for Scalability:a: Mirrored CacheA is almost as fast as a stand-alone Local Cache which has no clustering cost. But, at the same time, a Mirrored Cache provides reliability through replication in case the active cache server goes down.b: Partition-Replicais totally dynamic in NCache where you don’t have to do anything to set it up. Unlike AppFabric, you can choose to have synchronous or asynchronous replication to improve your application performance.c: Client Cachethat is local to your app sever but actually synchronizes with clustered cache. App Fabric only has local stand-alone cache which doesn’t address the issue of data integrity.d: Bridge Topologythat allows you to replicate cache across WAN asynchronously and without slowing down your main caches in each location.

I think you guys needed this feature if I am not mistaken 5- Self-Healing Dynamic Clustering for 100% Uptime:NCache provides a totally where you can add/remove cache servers at runtime without stopping the cache or your application. NCache cluster recovers automatically recovers from network shortages. 6- GUI based Administration/Monitoring:a: NCache ManagerGUI based let you configure and administer all cache clusters and clients from one place. The GUI has gone through a lot of improvements.b: NCache MonitorA totally new dashboard-style monitoring tool that lets you monitor all the caches and also your application together with them.c: Command Line ToolsA number of command line tools to let you script and automate cache deployment. Power Shell support provided.d: AlertsVarious alerts provided through Windows Events and also Emails. You can specify alerts on the following:i) Cache startii) Cache stopiii) Cache size above a certain thresholdiv) State transfer start when a node is added/removed in Partitioned/Partition-Replica Cachev) State transfer endvi) Node joined clustervii) Node left clustere: Cache Configuration Optionsi) Automatic GZip Compression based on an item size thresholdii) Eviction policy options (Least Recently Used, Least Frequently Used, Priority, Do not Evict) 7- View State Caching:reduces your ASP.NET payload sent to the browser by the web server and improves your response times.

8- Output Caching:This speeds up rendering somewhat static pages since their output is cached at the web server. 9- Active Directory based Security:Unlike AppFabric, NCache gives you multi-level security on the cache cluster servers. So you can aurthorize your specific clients to talk to it and prevent any intruders to read/write to the cache or change cluster configurations.

10- JavaScript/CSS optimizationMinify & merge multiple Javascript files into one to reduce multiple HTTP calls that a browser makes to load multiple Javascript files. 11- Java & JSP Support:i)ii) Support for storing Java/JSP sessions in NCacheiii) Unix clients for Java API.

ProblemApplication using Windows Azure Cache has encountered 'DataCacheException:ErrorCode:SubStatus'Symptoms. Application is using Windows Azure Cache. Intermittently or while storing larger objects, One of the below errors are encounteredDataCacheException: ErrorCode:SubStatus:The connection was terminated, possibly due to server or network problems or serialized Object size is greater than MaxBufferSize on server.

Appfabric Cache Serialization Tool

Microsoft

Result of the request is unknown.DataCacheException: ErrorCode:SubStatus:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions.

Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.)CauseSize of the object application is trying to store in Windows Azure Cache is more than 8 MB. As of now, Windows Azure Cache supports objects only up to 8 MB and size is measured post the serialization.ResolutionBefore storing the objects in Windows Azure Cache, serialize the object and find out the size of it and if the size is above 8 MB, split the object into smaller chunks, may be byte arrays, etc and then store the byte arrays in Cache.ReferencesAPI Reference for Windows Azure CachingCapacity Planning for caching in Windows AzureMaximizing Scalability,Availability, and Performance.

utlogoboss – 2020