Evaluating App Fabric as a Data Store (Part-II)

As discussed previously in Part-I of the AppFabric series, we understood the basics of the AppFabric, what it is and which all different features it provides.

This article will cover:

  1. Caching and Database synchronization
  2. Alternatives to AppFabric

Caching and Database synchronization

AppFabric does not provide out of the box support for the Synchronization with Data Sources. But, by writing an external component and handling the necessary events it is still achievable.

 To implement this external wrapper, we have to take following approach:
AppFabric + Entity Framework + EF cache providers + MS Sql Server


As AppFabric does not support Third Party Integrations to Entity Framework, this implementation will require huge development effort. 

That pops up an important question, if not AppFabric, then what else?

To suit your needs, there are 2 alternatives, which you can consider:

  1. nCache
  2. Redis
Lets talk about them briefly.

nCache

nCache is a market leader in distributed, open-source caching for Java and .Net applications. Its linearly scalable, fast and performance oriented cache which caches application data and reduces database hits.

The standout features are:
  • Low cost servers
  • Easy data replication
  • Cluster updates
  • Reduces close to 75% of traffic from your web applications, microservices
  • Supports caching of app data, sessions, states, response and message based response caching

Redis

Redis is open source, distributed, in-memory data structure store which can be either used as database, cache or message broker. It supports strings, sets, streams, maps, bitmaps etc.

The standout features are:

    • Has dedicated cluster manager for tackling failures and auto-failover
    • Master and Slave structure using in-memory replication
    • Easily scalable
    • Performance is extremely good for small files, data
    Out of the above, nCache seems feature rich and much more powerful than the rest of the caching solutions.

    AppFabric vs nCache

    nCache is way ahead of AppFabric with respect to the features and performance of the application during peak load times, scalability, and reliability. 

    Lets look at key differences measured across features on offer.

    Feature Area

    AppFabric

    nCache

    Performance & Scalability

    Have performance and scalability issues that are due to WCF as the transport layer and lack of advanced performance optimizations features.

    Extremely fast and scalable due to a light-weight socket-level protocol for transport layer. And many advanced performance optimization features provided to further speed things up.

    Cache Elasticity 
    (High Availability)

    No peer-to-peer architecture. Something resembling master/slave architecture employed. If some of the “lead nodes” or the configuration file server goes down, the entire cache could potentially go down.

    Highly elastic with 100% uptime. Peer to peer cluster architecture. Connection failover support, dynamic configuration, and “Hot Apply” feature.

    Cache Topologies

    Local cache, partitioned cache, and limited partitioned-replicated cache. Async replication not supported and due to these operations slow down.

    Rich options. Local, Mirrored, Replicated, Partitioned, Partition-Replica, and Client Caches. Highly dynamic and intelligent replication provided without compromising performance or scalability.

    Cache Administration

    Very basic cache admin GUI tool. No dedicated cache monitoring tool. PowerShell based Cmdlets provided.

    Very powerful GUI tools. nCache Manager for cache admin, and nCache Monitor for cache monitoring. PerfMon counters and command line tools provided.

    Security & Encryption

    No encryption provided for data in the cache. Authentication/authorization provided.

    Powerful 3DES/256AES data encryption in the cache provided as a config option.
    Active Directory/LDAP authentication and authorization provided.

    Synchronization with 
    Data Sources

    No support for it.

    SqlDependency, OracleDependency, DbDependency, & CLR Stored Procedures for database synchronization. File based and Custom dependency for non-relational data sources.

    Runtime Data Sharing

    Very limited support. Publish/subscribe events not supported. Continuous Query not provided. Only item level and cache.

    Powerful publish/subscribe event supported. Continuous Query, .NET/Java portable binary data, and more. Use nCache for publisher/consumer data sharing between .NET/.NET or .NET/Java apps.

    Search Cache (SQL-Like)

    No support for it.

    Object Query Language (OQL) and LINQ. Search cache on object attributes, Tags, and Named Tags with SQL-like query.

    ASP.NET Support

    Basic ASP.NET Session State support. Session replication has performance and scalability issues. ASP.NET ViewState support is very basic. ASP.NET Output Cache supported.

    Powerful ASP.NET Session State, ASP.NET View State, ASP.NET Output Cache. Replication for sessions, view state, and page output. Link view state with sessions for auto expiry and much more.

    Third Party Integrations

    No official support for NHibernate, Entity Framework, and EntLib Caching Application Block.

    NHibernate Second Level Cache,
    Entity Framework Cache,
    EntLib Caching Block.
    Extra features provided for all of these. Use all of these without any programming.


    Evaluating App Fabric as a data store (Part-I)

    Happy Learning!


    Comments

    Popular Posts