NCache 4.3 - Online Documentation

Deployment of NCache in Windows Azure

Windows Azure is an open and flexible cloud platform that enables quick development, deployment and management of applications across global network of Microsoft data centers. NCache provides support to use NCache distributed caching system for applications deployed in Windows Azure.
Here are main deployment scenarios for NCache.
Deployment scenarios:
Following are NCache deployment scenarios:
Single-Site Deployment of NCache in Azure: NCache's servers and clients (Web roles/VMs) everything is on same virtual network: (Most recommended)
      Figure 1: Typical Single-Site Deployment of NCache in Azure
This is the most recommended scenario where NCache cache servers on Azure VMs forming a cache cluster and NCache clients (Applications deployed directly on Azure VMs or deployed as Web Roles) everything is on same virtual network and preferably on same Subnet as well. This will ensure that there are no extra hops between NCache clients and servers for NCache communications and greatly improves performance.
Multi-Site Deployment of NCache in Azure: NCache servers and clients (Web roles/VMs) are on different Virtual network:
NCache cache cluster is created on Azure VMs which are part of one virtual network whereas NCache clients (Applications deployed directly on Azure VMs or deployed as Web Roles) belong to another virtual network. This would require an extra NCache client side configuration to connect to cache via Azure public End points configured on cache servers.
        Figure 2: Multiple Apps Sharing Common Cache (Single-Site/Multi-Site)
Configuring Azure environment for NCache:
Step1: Create a Virtual Network for NCache: NCache uses TCP/IP based communication protocol for cache server-server and client-server communications. You need to create azure virtual network that NCache will use and we will create NCache VMs later on using this virtual network.
It is also recommended to create an affinity group for all NCache deployments in Azure. Azure affinity Group ensures that all deployments within same affinity group will be closely located in the same data center. 
Here are links on how to Create and deploy a virtual network in Windows Azure with affinity Groups.
Azure Virtual Network:
Affinity Group:
Step2: Create Virtual Machines for NCache: You then need to create Azure virtual machines that will be used for NCache cache servers and Remote clients.
We need to make sure that we provide virtual network on creation of NCache VMs to be the one that we created in step1. Similarly, if you want to add more cache servers to be part of cache cluster later on you need to attach them to the existing cache server virtual network.
Moreover, it is highly recommended to opt for Single-Site Deployment of NCache in Azure where NCache cluster is formulated on cache servers that are in the same Virtual Network and also on the same subnet and later on you add your web roles in same virtual network.
Here is how you can create a virtual machine in Windows Azure.
Step3: Add Endpoints on NCache Virtual Machines: If you opt for Multi-Site Deployment of NCache in Azure where you are using different virtual networks for cache servers and remote clients then you need to create NCache End points for communication to cache severs from outside virtual network.
You need to set public and private end points on cache server VMs so that clients are able to use these public ports for client-server communication from outside your virtual network as well. Here is how you should set these endpoints on cache servers.
NCache Public Ports: you should specify a public port on each cache server starting from 9800 and increment it by one for each cache server. For example, you should set 9800 for NCache server 1 and then use 9801 for NCache server 2 and so on.
NCache Private Ports: All NCache server VMs should have 9800 set as private port since actual NCache client-server communication is carried on port 9800 on each server.
Here is a link on adding end points on a virtual machine in Windows Azure.
Step4: Install NCache 4.3 on Cache servers: You need to install NCache on Azure VMs by logging onto the servers directly.  Prerequisite of installing NCache is .Net Framework 4.0. You can refer NCache installation guide for complete details on NCache installation process.
Step5: Configure a Clustered cache to be used in Azure: Once NCache is installed and NCache environment is ready, you need to configure a clustered cache. For example, you can create a two node partitioned-Replica cache and add NCache clients (if any) to this cache.
See Also

© Copyright  2014 Alachisoft. All rights reserved.