NCache Features

 

Features Summary

This is a summary of all NCache features. Please visit the product pages or docs for more details on each feature.

Feature
 
.NET & Java Support
- Cache Clients: .NET, Java, Node.js, Python
- .NET Edition: Server-side Code (.NET)
- Java Edition: Server-side Code (Java)
- Java Maven Packages
- .NET NuGet Packages
- Node.js and Python Packages
 
Windows & Linux Support
- Windows (Cache Server, Cache Client)
- Linux (Cache Server, Cache Client)
 
Docker & Kubernetes Support
- Docker (Linux, Windows)
- Kubernetes (On-Premises)
- Azure Kubernetes Service (AKS)
- AWS Elastic Kubernetes Service (EKS)
- Red Hat OpenShift Kubernetes
- Google Kubernetes Engine (GKE)
 
Performance and Scalability
- Cache Performance Super Fast
- Cache Scalability Extremely Scalable ( 2 million ops/sec, 5-Node Cluster )
- Bulk Operations API
- Async Operations API
- Compression
- Fast Compact Serialization
- Indexes
- Multiple NIC Binding
- Pipelining
 
Cache Elasticity (High Availability)
- Dynamic Cache Cluster
- Peer-to-peer architecture
- Connection Failover
- Split Brain Detection & Auto-Recovery
- Dynamic Configuration
- Multiple Clusters
- Named Caches
- Communication Protocol ( TCP )
- Cluster Specific Events
- Stop Repartitioning in Maintenance Mode
 
Cache Topologies
- Local Cache
- Client Cache (Near Cache)
- Mirrored Cache
- Replicated Cache
- Partitioned Cache
- Partition-Replica Cache
- Partitioned Data Balancing
- Auto Load Balancing
- Partitioned Data Affinity
- Live Persistence
- Single Hop Data Access
 
WAN Replication (Multi-Datacenter)
- Active – Passive
- Active – Active (2 datacenters)
- Active – Active (3+ datacenters)
- Multiple Active – Multiple Passive
- Conflict Resolution
- De-duplication
- Data Security
 
Security & Encryption
- Authentication (Active Directory/LDAP)
- Authorization
- Data Encryption
- Secure Communication (TLS)
 
Cache Administration & Monitoring
- Admin Tool (Web GUI)
- Monitoring Tool (Web GUI)
- PerfMon Counters
- JMX Counters
- SNMP Counters
- Admin Tools (Command Line)
- Admin and Monitoring API (.NET & Java)
- Playground (Live + with Installation)
 
Web Apps (Java + Others)
- Spring Boot Sessions
- Spring Boot Sessions (Multi-site)
- Java Web Sessions
- Java Web Sessions (Multi-site)
- Node.js Web Sessions
- Node.js Web Sessions (Multi-site)
Feature
 
Web Apps (.NET)
- ASP.NET Core Sessions
- ASP.NET Core Sessions (Multi-site)
- ASP.NET Core SignalR Backplane
- ASP.NET Core Response Cache
- ASP.NET Core IDistributedCache
- ASP.NET Core Identity Server
- ASP.NET & ASP.NET Core Session Sharing
- ASP.NET Sessions
- ASP.NET Sessions (Multi-site)
- ASP.NET View State
- ASP.NET Output Cache
- ASP.NET SignalR Backplane
 
Java Integrations
- Hibernate 2nd Level Cache
- Spring Caching
- JCache API
- Java Persistence API (JPA) Caching
 
.NET Integrations
- EF Core Cache
- Entity Framework 6 Cache
- NHibernate 2nd Level Cache
 
Object Caching Features
- Get, Add, Insert, Remove, Exists, Clear Cache
- Expirations
- Lock and Unlock
- Large Object Streaming API
- Item Versioning
- Multiple Object Versions
- Transactions ( Partial Support )
- Distributed Data Structures
 
Data Grouping
- Groups
- Tags
- Named Tags
 
Queries (SQL-Like)
- SQL Search
- SQL Update and Delete
- SQL on Tags, Named Tags & Groups
- LINQ Queries (.NET)
 
Read-through, Write-through, Cache Loader/Refresher
- Read-through
- Write-through, Write behind
- Auto Reload at Expiration & DB Sync (Read-thru)
- Loader
- Refresher
 
Synchronization with Data Sources
- SQL Dependency (SQL Server)
- Oracle Dependency (Oracle)
- Db Dependency (Any DB)
- File Dependency
- Custom Dependency (Any Source)
 
Managing Data Relationships
- Key Based Cache Dependency
- Key Based Multi-Cache Dependency
 
Events and Continuous Query
- Item Level Events (onInsert/onRemove)
- Cache Level Events (Add/Insert/Remove)
- Continuous Query
 
Pub/Sub Messaging (Kafka-style)
- Topic
- Queue
- Durable Subscriptions
- Message Persistence
- Topic Partitioning
- Message Sequencing
- Message Delivery Guarantee
- Schema Management
- Real-time Streams (Kafka-style)
 
Full Text Search
- Full Text Search (Lucene API)
- Schema Enforcement
- Index Migration
- Data Ingestion
 
Big Data Processing & Analytics
- Map-Reduce Query
- Aggregators
- Entry Processor
 
Cache Size Management (Evictions Policies)
- Max Cache Size (in MBs)
- LRU Evictions (Least Recently Used)
- LFU Evictions (Least Frequently Used)
- Priority Evictions
- Do Not Evict Option
 

Features Explained

 

.NET & Java Support

NCache provides a strong support for both Java and .NET.

Feature Area NCache
Cache Clients: .NET, Java, Node.js, Python

.NET, Java, Node.js, and Python clients are officially supported.

.NET Edition
Server-side code (.NET)

Run .NET server-side code natively.

Java Edition
Server-side code (Java)

Run Java server-side code natively.

Java Maven Packages

Full set of Maven packages provided.

.NET NuGet Packages

Full set of NuGet packages provided.

Node.js and Python Packages

Full set of Node.js and Python packages provided.

 

Windows & Linux Support

NCache provides strong support for both Linux and Windows.

Feature Area NCache
Windows (Cache Server, Cache Client)

Windows officially supported for Cache Server & Cache Client

Linux (Cache Server, Cache Client)

Linux officially supported for Cache Server & Cache Client

 

Docker & Kubernetes Support

NCache provides strong support for both Docker and Kubernetes.

Feature Area NCache
Docker (Linux, Windows)

Linux and Windows Docker Images officially supported for NCache Server

Kubernetes
(On-Premises)

NCache can be deployed inside any Kubernetes cluster seamlessly. NCache servers can be either Linux or Windows based Pods.

Run NCache Management Center from both inside and outside of Kubernetes to access and manage NCache cluster.

Azure Kubernetes Service (AKS)

NCache can be deployed inside any Azure Kubernetes (AKS) cluster seamlessly. NCache servers can be either Linux or Windows based Pods.

Run NCache Management Center from both inside and outside of AKS Kubernetes to access and manage the NCache cluster.

AWS Elastic Kubernetes Service (EKS)

NCache can be deployed inside any AWS Elastic Kubernetes (EKS) cluster seamlessly. NCache servers can be either Linux or Windows based Pods.

Run NCache Management Center from both inside and outside of EKS Kubernetes to access and manage the NCache cluster.

Google Kubernetes Engine (GKE)

NCache can be deployed inside any Google Kubernetes Engine (GKE) cluster seamlessly. NCache servers can be either Linux or Windows based Pods.

Run NCache Management Center from both inside and outside of GKE Kubernetes to access and manage the NCache cluster.

Red Hat OpenShift Kubernetes

NCache can be deployed inside any Red Hat OpenShift Kubernetes cluster seamlessly. NCache servers can be either Linux or Windows based Pods.

Run NCache Management Center from both inside and outside of OpenShift Kubernetes to access and manage the NCache cluster.

 

Performance and Scalability

NCache is extremely fast and scalable. See how NCache achieves this.

Feature Area NCache
Cache Performance

Super Fast

2 million ops/sec, 5-Node Cluster

NCache is extremely fast. Please see its performance benchmarks that can scale further.

You can do benchmarking of NCache in your own environment by using stress-testing tools provided with NCache.

Cache Scalability

Extremely Scalable

2 million ops/sec, 5-Node Cluster

NCache provides linear scalability, means as you add more nodes to the cluster your performance increases in a linear fashion. Please see its performance benchmarks.

You can do benchmarking of NCache in your own environment by using stress-testing tools provided with NCache.

Bulk Operations API

Bulk Get, Add, Insert, and Remove. This covers most of the major cache operations and provides a great performance boost.

Async Operations API

Async add, insert, and remove provided.

Async operation returns control to the application and performs the cache operation in the background. Improves application response time greatly.

Compression

Specify this along with the item size threshold and only items larger than the threshold are compressed. Rest is cached uncompressed.

This size threshold is provided because compressing smaller items often slows things down.

And, you can configure "Compression" at runtime through "Hot Apply".

Fast Compact Serialization

Compact Serialization is extremely fast because it uses precompiled code to serialize and also because it stores type-ids instead of long type names in the serialized objects. This is almost 10 times faster.

Once you register classes for Compact Serialization, NCache generates serialization code and compiles it in-memory all at runtime and uses this precompiled code for serialization.

You can mix Compact Serialization with regular Serialization on objects of your choice.

Indexes

NCache allows you to define indexes on object attributes.

NCache then generates data extraction code for these indexes at connection time, compiles it in memory, and uses it at client-side for all data extraction. This is much faster than using Reflection.

NCache also creates indexes automatically on Tags, Named Tags, and Groups. Expiration and Eviction Policies.

Multiple NIC Binding

You can assign two NICs to a cache server. One can be used for clients to talk to the cache server and the second for multiple cache servers in the cluster to talk to each other.

This improves your bandwidth scalability greatly.

You can also assign a specific NIC for a cache client to use for talking to the cache server.

Pipelining

NCache uses Pipelines for high performance IO operations between clients and servers. With pipelining, you can dramatically increase scalability.

Pipelining is enabled by default on all caches but can be disabled through config.

 

Cache Elasticity (High Availability)

Cache elasticity means how flexible the cache is at runtime. Are you able to perform the following operations at runtime without stopping the cache or your application?

  1. Add or remove cache servers at runtime without stopping the cache.
  2. Make cache config changes without stopping the cache.
  3. Add or remove web/application servers without stopping the cache.
  4. Have failover support in case any server goes down and cache clients are able to continue working seamlessly.

NCache provides a self-healing dynamic cache clustering that makes NCache highly elastic. Read more about it at Self-Healing Dynamic Clustering.

Feature Area NCache
Dynamic Cache Cluster

NCache is highly dynamic and lets you add or remove cache servers at runtime without any interruption to the cache or your application.

When you do that, data is automatically rebalanced at runtime (called state transfer) and without any interruption to the cache or its clients. There is also no performance degradation.

Peer-to-peer architecture

NCache cache cluster has a peer-to-peer architecture. This means there is no "master/slave" and no "majority rule" in the cluster.

All nodes are equal. There is a "coordinator" node that is the senior-most node. If it goes down, the next senior-most node takes over this role automatically.

This means if any server goes down, the cluster always remains functional and correct.

Connection Failover
(Cluster, Client/Server)

NCache provides full connection failover support between cache clients and servers and also within the cache cluster.

In case of cache server failure, NCache clients continue working with other servers in the cluster without any interruption.

Cluster auto-manages itself by rebalancing its data and recreating replicas where needed.

Split Brain Detection & Auto-Recovery

Split brain detection is provided and you’re notified through NCache events when that happens and auto recovery is provided.

Dynamic Configuration

NCache cluster configuration is not hard coded and when you add or drop servers at runtime, all other servers in the cluster are made aware of it.

NCache clients also learn about all the servers and a variety of other configuration at runtime from the cache cluster.

Also, the 'Hot Apply' feature allows you to change a lot of the configuration at runtime without stopping anything.

Multiple Clusters

NCache allows you to create multiple cache clusters of either the same or different topologies on the same set of cache servers.

Named Caches

NCache allows you to create multiple named caches on the same set of cache servers.

Communication Protocol

TCP

Cluster Specific Events

NCache provides events about changes in the cluster like: MemberJoined, MemberLeft, CacheStopped, etc.

These events can be delivered to both Java and .NET applications natively.

Stop Repartitioning in Maintenance Mode

NCache lets you stop a cache server for "Maintenance Mode" in which case even though this server has left the cluster, NCache does not do automatic repartitioning. Instead, NCache keeps working without this node until it is brought back up.

This behavior is different from the standard behavior where a node leaving the cluster automatically triggers repartitioning.

 

Cache Topologies

Cache Topologies determine data storage, replication, and client connection strategy. There are different topologies for different types of uses. Read more details on NCache caching topologies at Cache Topologies.

Feature Area NCache
Local Cache

Both InProc and OutProc.

InProc is much faster and gives you "InProc Speed" but your memory consumption is higher if you have multiple instances on the same machine.

OutProc is slightly slower due to IPC and serialization cost but saves you memory consumption because there is only one copy per machine.

Client Cache
(Near Cache)

Client Cache is simply a Local Cache (InProc/OutProc) on the NCache remote client machine that keeps a copy of all data you fetch from the cache cluster.

This Client Cache is also kept synchronized with the cache cluster so if any data changes in the cache cluster, it is immediately updated in the Client Cache as well.

With it, NCache clients get the benefits of a super-fast Local Cache without compromising on data integrity and without limiting the cache size to just one client’s memory.

Mirrored Cache

Mirrored Cache is a 2-node Active-Passive cache. All clients connect to the Active node and data mirroring is done asynchronously.

In case Active node goes down, Passive node automatically becomes Active and all clients connect to it automatically.

Replicated Cache

In Replicated Cache, the entire cache is replicated on all nodes in the cluster.

You can have more than 2 nodes and all nodes are active meaning clients connect to them directly for read-write operations.

Updates are done synchronously within the cluster and are therefore slower than other topologies but still quite fast. Reads are super-fast.

Each client connects to only one node. You can enable load-balancing or specify an ordered server list for the clients to use for connection.

Partitioned Cache

Full failover support if any server goes down (although there is data loss in that case).

Partitioned Cache is a very powerful topology. You can partition without replication to speed up the cache and also use less memory because you can always reload some data if it is lost from the cache.

In Partitioned Cache, the entire cache is partitioned and each cache server gets one partition. All partitions are created or deleted and their buckets are reassigned automatically at runtime when you add/remove nodes.

Data re-balancing feature is provided even if no partition is added or removed but when any partition gets overwhelmed with too much data.

Partition-Replica Cache

Same as Partitioned Cache (read above).

Also provides a replica for each partition kept on another cache server. This provides reliability against data loss if a node goes down.

Just like partitions, replicas are also created dynamically.

Data balancing also updates replicas.

Partitioned Data Balancing

Data is automatically rebalanced when you add/remove cache servers from the cluster.

Data is also rebalanced automatically when one cache server has a lot more data than other servers. You can configure the threshold of difference for this. You can turn off auto rebalancing in this case and manually do it if you wish.

This applies to both Partitioned Cache and Partition-Replica Cache.

Auto Load Balancing

Clients are balanced among server nodes in the case of Replicated Cache topology.

For Partitioned Cache topologies, all clients are connected to all nodes for single hop operation and therefore balanced as well.

Partitioned Data Affinity

NCache provides data affinity. To use it, you specify the other item's key inside {} of an item and then this item stays on the same partition as the other items with the same affinity.

Live Persistence

NCache lets you turn on Live Persistence for any cache in which case, all its data is persisted on a LiteDB persistence store. This is a binary persistent store that reflects all the buckets in a cache cluster. The persistence is done LIVE at runtime.

You can restore a cache from its persisted copy if you want.

Single Hop Data Access

In all Cache Topologies, NCache clients are able to access cached data in a single hop.

 

WAN Replication (Multi-Datacenter)

WAN replication is an important feature for many customers whose applications are deployed in multiple data centers (multiple regions or availability zones in the cloud) either for disaster recovery purposes or for load balancing of regional traffic.

The idea behind WAN replication is that it must not slow down the cache in each geographical location due to the high latency of WAN. NCache provides Bridge Topology to handle all of this.

Read more about it at WAN Replication of NCache.

Feature Area NCache
Active – Passive

Bridge Topology Active-Passive

You can create a Bridge between the Active and Passive sites. The Active site submits all updates to the Bridge which then replicates them to the Passive site.

Active – Active
(2 datacenters)

Bridge Topology Active-Active

You can create a Bridge between two active sites. Both submit their updates to the Bridge which handles conflicts on the "last update wins" rule or through a custom conflict resolution handler provided by you. Then, the Bridge ensures that both sites have the same update.

Active – Active
(3+ datacenters)

Bridge Topology Active-Active

You can create a Bridge between three or more active sites. All submit their updates to the Bridge which handles conflicts on the "last update wins" rule or through a custom conflict resolution handler provided by you. Then, the Bridge ensures that all sites have the same update.

Multiple Active – Multiple Passive

NCache lets you create a Bridge between multiple Active and multiple Passive sites.

Conflict Resolution

By default, the "last update wins" algorithm is used to resolve conflicts. But you can specify a "custom conflict resolution handler" that is called to resolve conflict by comparing the content of both objects and deciding which one wins.

De-duplication

NCache Bridge optimizes the replication queue by de-duplicating items. If the same key is updated multiple times, it only replicates the last one.

Data Security

You can encrypt data with 3DES and AES algorithms so it is cached as encrypted data before transportation through the Bridge to the other site across the WAN.

Otherwise, you can use a VPN between multiple data centers across the WAN for security.

 

Security & Encryption

Many applications deal with sensitive data or are mission-critical and therefore security is a very important concern for them.

NCache provides restricted access to the cache and its servers based on authentication and authorization to classify people into different groups of users. And, it also allows data to be encrypted inside the client application process before it travels to the Cache.

NCache provides strong support for security.

Feature Area NCache
Authentication
(Active Directory / LDAP)

You can authenticate users against Active Directory or LDAP. If security is enabled, nobody can access the cache without authentication and authorization.

Authorization

You can authorize users to be either "users" or "admins". Users can only access the cache for read-write operations while "admins" can administer the cache servers and clusters.

Data Encryption

You can enable encryption and NCache automatically encrypts all items on the client before sending them to the cache.

And, this data is kept encrypted while in the cache. And decryption also happens automatically and transparently inside the client process.

Currently, 3DES and AES128 / AES196 / AES256 encryptions are provided and more are being added.

Secure Communication (TLS)

NCache provides TLS for secured transportation for client/server communication.

Additionally, strong encryptions are provided by NCache so you can encrypt data over an unsecured connection.

 

Cache Administration & Monitoring

Cache administration is a very important aspect of an In-Memory Distributed Store. A good cache should provide the following:

  1. Web GUI and command line tools for cache administration.
  2. Web GUI tools for monitoring the cache activities at runtime.
  3. Cache statistics through "counters" on both Linux and Windows

NCache provides powerful support in all these areas. Read more about it at Administration and Monitoring Tools.

Feature Area NCache
Admin Tool (Web GUI)

NCache Management Center is a powerful Web GUI tool for NCache. It gives you an explorer style view and lets you quickly administer the cache cluster from a single place. This includes cache creation/editing and many other functions.

Authorization

Monitoring Tool (Web GUI)

NCache Monitor is part of the Management Center and is a powerful Web GUI tool that lets you monitor NCache cluster wide activity from a single location. It also lets you monitor all of NCache clients from a single location.

And, you can incorporate non-NCache PerfMon counters in it for comparison with NCache stats. This real-time comparison is often very important.

PerfMon Counters

NCache provides a rich set of PerfMon counters that can be seen from NCache Manager, NCache Monitor, or any third-party tool that supports PerfMon monitoring.

JMX Counter

NCache provides a rich set of JMX counters for its Java clients that can be seen from any third-party tool that supports JMX monitoring.

SNMP Counter

NCache provides a rich set of SNMP counters for its Java clients that can be seen from any third-party tool that supports SNMP counters.

Admin Tools
(Command Line)

NCache provides powerful command line tools. You can create a cache, add remote clients to it, add server nodes to it, start/stop the cache, and much more.

Use these tools from your scripts (Linux or Windows) and automate various cache admin tasks.

Admin and Monitoring API (.NET & Java)

NCache provides Java and .NET API to manage and monitor the caches and clients. Using this API, you can stop/start the cache, get the statistics of the connected clients or get the health info of the cache cluster.

Playground (Live + with Installation)

NCache Playground provides a quick and interactive way to familiarize yourself with NCache. With Playground, you can easily explore NCache samples, run them, make changes, and execute them without the need for a development environment.

 

Web Apps (Java + Others)

The most important thing Web apps need is web session storage. NCache provides strong support for Java and Node.js Web Apps as seen below.

Feature Area NCache
Spring Boot Sessions

NCache has implemented integration with Spring Boot to store its Session.

NCache provides intelligent session replication and is much faster than any database storage for sessions.

Spring Boot Sessions (Multi-site)

NCache allows you to share Spring Boot sessions across multiple data centers.

This serves situations where you don’t want to replicate all sessions to each data center but want the ability to overflow traffic from one data center to another without losing your Java Web sessions.

The session moves from one data center to the next as the user moves.

Java Web Sessions

NCache has implemented a JSP Servlet Session Provider (Java Servlet 4.0+). You can use it without any code changes. Just change web.xml

NCache provides intelligent session replication and is much faster than any database storage for sessions.

Java Web Sessions
(Multi-site)

NCache allows you to share Java Web sessions across multiple data centers.

This serves situations where you don’t want to replicate all sessions to each data center but want the ability to overflow traffic from one data center to another without losing your Java Web sessions.

The session moves from one data center to the next as the user moves.

Node.js Web Sessions

NCache has implemented a provider to store Node.js Web Session.

NCache provides intelligent session replication and is much faster than any database storage for sessions.

Node.js Web Sessions
(Multi-site)

NCache allows you to share Node.js Web sessions across multiple data centers.

This serves situations where you don’t want to replicate all sessions to each data center but want the ability to overflow traffic from one data center to another without losing your Java Web sessions.

The session moves from one data center to the next as the user moves.

 

Web Apps (.NET)

The most important thing Web apps need is web session storage. NCache provides strong support for ASP.NET Core and ASP.NET Web Apps as seen below.

Feature Area NCache
ASP.NET Core Sessions

NCache has implemented an ASP.NET Core Sessions Provider. In this, NCache has also implemented special locking to handle concurrency control.

NCache provides intelligent session replication and is much faster than any database storage for sessions.

ASP.NET Core Sessions (Multi-site)

NCache allows you to share ASP.NET Core sessions across multiple data centers.

This serves situations where you don’t want to replicate all sessions to each data center but want the ability to overflow traffic from one data center to another without losing your ASP.NET Core sessions.

The session moves from one data center to the next as the user moves.

ASP.NET Core
SignalR Backplane

NCache has implemented ASP.NET Core SignalR Backplane for high traffic real-time web applications running in load-balanced multi-server web farms.

SignalR uses Pub/Sub Messaging of NCache to send messages from one web server to another.

ASP.NET Core
Response Cache

NCache has implemented ASP.NET Core Response Cache Middleware for applications running in load-balanced multi-server web farms.

Response Cache determines when Web responses are cacheable, stores responses in NCache, and serves responses from the cache.

ASP.NET Core IDistributedCache

NCache has implemented an IDistributedCache provider that allows you to use NCache without any code change if your ASP.NET Core application is already using IDistributedCache interface.

ASP.NET Core
Identity Server

You can use NCache as ASP.NET Core IdentityServer4 Cache and Data Store.

ASP.NET & ASP.NET Core Session Sharing

NCache lets you share sessions between ASP.NET and ASP.NET Core applications.

ASP.NET Sessions

NCache has implemented an ASP.NET Session State Provider (SSP) for .NET 4.8. You can use it without any code changes. Just change web.config.

NCache also provides flexible session locking options to handle robots flooding an ASP.NET website.

NCache provides intelligent session replication and is much faster than any database storage for sessions.

ASP.NET Sessions
(Multi-Site)

NCache allows you to share ASP.NET sessions across multiple data centers.

This serves situations where you don’t want to replicate all sessions to each data center but want the ability to overflow traffic from one data center to another without losing your ASP.NET sessions.

The session moves from one data center to the next as the user moves.

ASP.NET View State

Yes. NCache has an ASP.NET View State caching module. Use it without any code changes. Just modify the config file.

Here are some advanced features supported by NCache:

  • - Group-level policy
  • - Associate pages to groups
  • - Link View State to sessions
  • - Max View State count per user
  • - More
ASP.NET Output Cache

NCache has an ASP.NET Output Cache provider implemented. It allows you to cache ASP.NET page output in an In-Memory Distributed Store and share it in a web farm.

ASP.NET
SignalR Backplane

NCache has implemented ASP.NET SignalR Backplane for high traffic real-time web applications running in load-balanced multi-server web farms.

SignalR uses Pub/Sub Messaging of NCache to send messages from one web server to another.

 

Java Integrations

Hibernate is a very powerful and popular object-relational mapping engine. And, fortunately, it also has a Second Level Cache provider architecture that allows you to plug in a third-party cache without making any code changes to the Hibernate application. NCache has implemented this Hibernate Second Level Cache provider.
See Hibernate Second Level Cache for details.

Similarly, Spring Framework is an Open Source application framework for Java comprising of several modules that provide a range of services. See Spring Data Integration for details.

Feature Area NCache
Hibernate 2nd Level Cache

NCache provides a Hibernate 2nd Level Cache provider that you can plug into your Java app without any code changes.

NCache has also implemented a database synchronization feature in this so you can specify which classes should be synchronized with the database. NCache lets you specify OracleDependency, SqlDependency, or DbDependency for this.

Spring Caching

NCache fully supports cache integration with Spring Framework version 5.1 and later.

JCache API

NCache provides an implementation of the JCache API. NCache has also extended JCache API for features that NCache provides but that are not supported by JCache.

So, you can plug in or plug out NCache to any application using JCache without any code changes.

Java Persistence API (JPA) Caching

NCache provides an integration with JPA as its caching provider.

 

.NET Integrations

Feature Area NCache
EF Core Cache

Extension Methods

NCache has implemented EF Core Extension Methods for caching to make it really simple for EF applications to use caching. It also gives full control to the application about how to cache data.

Entity Framework 6 Cache

Custom ADO.NET Provider

NCache has implemented a behind-the-scene second level cache for Entity Framework 6. You can plug in NCache to your EF application, run it in analysis mode, and quickly see all the queries being used by it. Then, you can decide which queries should be cached and which ones skipped.

NHibernate 2nd Level Cache

NCache provides NHibernate L2 Cache provider that you can plug in through web.config or app.config changes.

NCache has also implemented database synchronization feature in this so you can specify which classes should be synchronized with the database. NCache lets you specify SqlDependency, OracleDependency, or DbDependency for this.

 

Object Caching Features

Feature Area NCache
Get, Add, Insert, Remove, Exists, Clear Cache

NCache provides more variations of these operations and therefore more control to the user.

Expirations

Absolute and Sliding expirations provided.

Absolute expiration is good for data that is coming from the database and must expire after a known time because it might become stale.

Sliding expiration means expire after a period of inactivity and is good for session and other temporary data that must be removed once it is no longer needed.

Lock and Unlock

NCache provides both Lock and Unlock. Lock API is used to exclusively lock a cached item so nobody else can read or write it. This item stays locked until either the lock expires or it is unlocked.

NCache also provides "GetAndLock()", that locks the item before fetching it, and "InsertAndUnlock()" that updates the item and then unlocks it, all in one call.

Large Object Streaming API

For large objects, NCache allows the cache clients to fetch them in "GetChunk()" manner and update them in "AppendChunk()" manner. With this, NCache clients can stream in or out large objects from the cache.

Item Versioning

This ensures that only one client can update an item and all future updates will fail unless cache clients first fetch the latest version and then update it.

Multiple Object Versions

NCache allows two different versions of the same class to be stored in the cache by different apps. Each app retrieves its own version and the cache keeps a superset.

Transactions

Partial Support

Explicit locking
Implicit locking (item versioning)
Entry Processor (are atomic)

Distributed Data Structures

NCache provides distributed data structures like List, Queue, Set, Dictionary, and Counter.

 

Data Grouping

Feature Area NCache
Groups

NCache provides the ability for you to group cached items in a group.

You can later fetch or remove all items belonging to a group. You can also fetch just the keys and then only fetch subset of them.

Tags

NCache provides a concept called Tags. A Tag is a string that you can assign to one or more cached items. And one cached item can be assigned multiple Tags.

And, later, you can fetch items belonging to one or more Tags in order to manipulate them.

You can also include Tags in SQL or LINQ search as part of the criteria.

Named Tags

NCache provides a Named Tags feature where you can assign a "key" and "tag" to one or more cached items. And, a single cached item can get multiple Named Tags.

Later, you can fetch items belonging to one or more Named Tags. You can also use Named Tags in SQL and LINQ queries as part of the criteria.

 

Queries (SQL-Like)

Feature Area NCache
SQL Search

NCache provides a rich SQL based searching capability. You can search the cache based on object attributes instead of just keys.

You can also include Group, Tags, and Named Tags in your SQL query.

SQL Update and Delete

NCache lets you execute an UPDATE SQL query that goes and updates cached items without first loading them to the client.

NCache also lets you execute a DELETE SQL statement that deletes cached items.

SQL on Tags, Named Tags & Groups

NCache allows you to include Tags, Named Tags, and Group names as part of your SQL search criteria.

LINQ Queries (.NET)

NCache allows you to search the cache with LINQ queries from .NET applications. LINQ is a popular object querying language in .NET and NCache has implemented a LINQ provider.

So, if you’re comfortable using LINQ, you can search the cache the same way you would with NCache SQL.

 

Read-through, Write-through, Cache Loader / Refresher

Many people use In-Memory Distributed Store as a “cache on the side” where they fetch data directly from the database and put it in the cache. Another approach is “cache through” where your application just asks the cache for the data. And, if the data isn’t there, the In-Memory Distributed Store gets it from your data source.

The same thing goes for write-through. Write-behind is nothing more than a write-through where the cache is updated immediately and the control is returned to the client application. And, the database or data source is updated asynchronously so the application doesn’t have to wait for it.

NCache provides powerful capabilities in this area.

Feature Area NCache
Read-through

NCache allows you to implement multiple read-through handlers and register with the cache as "named providers". Then, the client can tell NCache to use a specific read-through upon a "cache miss".

NCache also allows you to add read-through handlers at runtime without stopping the cache.

Write-through, Write behind

NCache allows you to implement multiple write-through handlers and register with NCache as “named providers”. Then, whenever application updates a cached item and tells NCache to also call write-through, NCache server calls your write-through handler.

If you’ve enabled write-behind, then NCache updates the cache immediately and queues up the database update, and a background thread processes it and calls your write-through handler.

Auto Reload at Expiration & DB Sync (Read-thru)

If you’ve implemented a read-through handler, NCache allows you to use it to specify that whenever a cached item expires, instead of removing it from the cache, NCache should call your read-through handler to read a new copy of that object and update the cache with it.

You can specify the same when database synchronization is enabled, a row in the database is updated, and a corresponding cached item would have been removed from the cache but is now reloaded with the help of your read-through.

Loader

NCache lets you implement a Loader and register it with the cache cluster. NCache then calls it to prepopulate the cache upon startup.

Cache Loader is your code that reads data from your data source/database and populates the cache upon startup.

Refresher

NCache lets you implement a Refresher that allows you to synchronize your database with cache at regular intervals. This process runs in the background and does not affect application performance.

 

Synchronization with Data Sources

Database synchronization is a very important feature for any good In-Memory Distributed Store. Since most data being cached is coming from a relational database, there are always situations where other applications or users might change the data and cause the cached data to become stale.

To handle these situations, a good In-Memory Distributed Store should allow you to specify dependencies between cached items and data in the database. Then, whenever that data in the database changes, the cache becomes aware of it and either invalidates its data or reloads a new copy.

Additionally, a good Cache should allow you to synchronize the cache with non-relational data sources since real life is full of those situations as well.

NCache provides a very powerful database synchronization feature.

Feature Area NCache
SQL Dependency
(SQL Server)

NCache provides SqlDependency support for SQL Server. You can associate a cached item with a SQL statement-based dataset in the SQL Server database. Then whenever that dataset changes (addition, updates, or removal), MS SQL sends a data notification to NCache and NCache invalidates this cached item or reloads it if you have enabled it with ReadThrough.

This feature allows you to synchronize the cache with the SQL Server database. If you have a situation where some applications or users are directly updating data in the database, you can enable this feature to ensure that the cache stays fresh.

Oracle Dependency (Oracle)

NCache provides OracleDependency support for Oracle. You can associate a cached item with a SQL statement-based dataset in the Oracle database. Then whenever that dataset changes (addition, updates, or removal), Oracle sends a data notification to NCache and NCache invalidates this cached item or reloads it if you have enabled it with ReadThrough.

This feature allows you to synchronize the cache with the Oracle database. If you have a situation where some applications or users are directly updating data in the database, you can enable this feature to ensure that the cache stays fresh.

Db Dependency (Any DB)

NCache provides support for you to synchronize the cache with any OLEDB database. This synchronization is based on polling. And, although it is not as real-time as a database notification, it is more efficient.

It is more efficient because, in one poll, NCache can synchronize thousands of cached items instead of receiving thousands of individual database notifications from Oracle in the case of OracleDependency.

File Dependency

NCache allows you to specify a dependency on an external file. Then NCache monitors this file for any updates and when that happens, NCache invalidates the corresponding cached item.

This allows you to keep the cached item synchronized with a non-relational data source.

Custom Dependency
(Any Source)

NCache allows you to implement a custom dependency and register your code with the cache cluster. Then, NCache calls your code to monitor some custom data sources for any changes.

When changes happen, you fire a dependency update within NCache which causes the corresponding cached item to be removed from the cache.

This feature is good when you need to synchronize the cached item with a non-relational data source that cannot be captured by a flat file. So, custom dependency handles this case.

 

Managing Data Relationships

Since most data being cached comes from relational databases, it has relationships among various data items. So, a good cache should allow you to specify these relationships in the cache and then keep the data integrity. It should allow you to handle one-to-one, one-to-many, and many-to-many data relationships in the cache automatically without burdening your application with this task.

Feature Area NCache
Key Based Cache Dependency

You can specify that cached item A depends on cached item B which then depends on cached item C.

Then, if C is ever updated or removed, B is automatically removed from the cache and that triggers the removal of A from the cache as well. And, all of this is done automatically by the cache.

With this feature, you can keep track of one-to-one, one-to-many, and many-to-many relationships in the cache and invalidate cached items if their related items are updated or removed.

Key Based Multi-Cache Dependency

This is an extension of Key Based Cache Dependency except it allows you to create this dependency across multiple caches.

 

Events and Continuous Query

Feature Area NCache
Item Level Events
( onInsert / onRemove )

NCache can send events to its clients, whenever specific cached items are updated or removed based on client interest.

You can register Java and .NET callbacks with NCache client and your callbacks are called in these cases.

NCache uses its own socket-level protocol for this event propagation so it is super-fast.

Cache Level Events
( Add / Insert / Remove )

If turned on, NCache sends event notifications to all clients whenever any item is added, updated, or removed from the cache.

You can register Java and .NET callbacks with NCache client and your callbacks are called in these cases.

Continuous Query

NCache provides a powerful Continuous Query (CQ) feature. CQ lets you specify a SQL query against which NCache monitors the cache for any additions, updates, or deletes. And, your application is notified whenever this happens.

Think of this feature as being equivalent to OracleDependency but against the cache and not the database.

 

Pub/Sub Messaging (Kafka-style)

Feature Area NCache
Topic

NCache allows your applications to do Kafka-style Pub/Sub style messaging through Topic.

Queue

NCache allows your applications to do Kafka-style Pub/Sub style messaging through Queue.

Durable Subscriptions

Durable subscription allows clients who disconnect from NCache for any reason to not lose their messages. When they reconnect, they see all the messages sent while they were disconnected.

Message Persistence

NCache lets you persist all messages in its Pub/Sub Messaging.

Topic Partitioning

NCache lets you map a Topic to one or more partitions (Kafka-style). Then, NCache ensures that within each partition, all messages posted against this topic are always ordered so they can be consumed in the same manner. This is very similar to Kafka behavior.

Message Sequencing

Once you have mapped a Topic to a Partition, then, NCache ensures that within each partition, all messages posted against this topic are always sequenced so they can be consumed in the same manner. This is very similar to Kafka behavior.

Message Delivery Guarantee

NCache lets you choose a message delivery option, where it can guarantee that the message will stay in the Pub/Sub Topic until it is delivered as desired.

Schema Management

NCache lets you do Schema Management in its Pub/Sub Messaging (Kafka-style).

Real-time Streams
(Kafka-style)

NCache has taken the Open-Source Kafka Streams and implemented an NCache Pub/Sub Messaging provider for it. This means you can use the popular Kafka Streams (.NET & Java) against NCache which is much faster than Kafka because of being an In-Memory Distributed Store.

Full Text Search

Feature Area NCache
Full Text Search
(Lucene API)

NCache provides Full Text Search through industry standard Lucene. NCache has implemented Lucene in its In-Memory Distributed Store so it is super-fast and linearly scalable.

Schema Enforcement

NCache provides Scheme Enforcement in its Full Text Search with industry standard Lucene. This way, you can make sure all documents being indexed are adhering to a schema.

Index Migration

NCache provides Index Migration in its Full Text Search with industry standard Lucene. This way, you can your existing Lucene Indexes to NCache Full Text Search.

Data Ingestion

NCache provides Data Ingestion in its Full Text Search with industry standard Lucene. This way, you can easily inject a lot of data from your existing data sources into NCache Full Text Search indexes.

 

Big Data Processing & Analytics

Feature Area NCache
Map-Reduce Query

NCache provides a MapReduce framework where your program can run on cache servers for parallel processing of Big Data.

Aggregators

NCache provides an Aggregator that works with MapReduce framework and provides you statistical data.

Entry Processor

NCache fully supports Entry Processor execution on cache nodes in parallel.

 

Cache Size Management (Evictions Policies)

Feature Area NCache
Max Cache Size (in MBs) Supported
LRU Evictions
(Least Recently Used)
Supported
LFU Evictions
(Least Frequently Used)
Supported
Priority Evictions

NCache also lets you specify a "do not evict" priority for some cached items and then they are not evicted.

Do Not Evict Option

NCache lets you specify the “do not evict” option for the entire cache. Then, nothing is evicted even when the cache is full. Instead, the client applications receive an error stating that the cache is full when they try to add data to the cache.

Please read more about NCache and also download a 30-Day free Install Key for NCache.

Signup for monthly email newsletter to get latest updates.

© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.