Nirvana Caching Server

Introduction

The Nirvana Caching Server is an example of an embedded server and is designed to provide a lightweight instance of a Nirvana Realm Server that caches channel data locally from a master server.

This concept is very useful for a number of reasons. Consider the following situation:

Problem

'Company A provides channel data that needs to be consumed by Company B . Company A's realm is an externally hosted realm server that consumers connect to using the internet and the nhp protocol. Company B has around 100 people within their enterprise who need to consume the data from Company A, but they have limited bandwwidth available for internet traffic.'

Solution

Company B runs a caching server within their organization that will cache the events from the required channels. The 100 people from Company B will all consume the data from the caching server running at Company B.

Benefits

The benefits for this approach to the delivery of data to external clients is twofold:

  • Company A reduces it's connection count by a factor of 99, since the caching server at Company B will only make 1 connection to the master realm server at Company A.
  • Company B reduces it's external bandwidth consumption by a factor of 99, since the caching server at Comapny B will only make one connection to the master realm server at company A. All consumer connections at Company B will be local network connections to the caching server.
Running the Caching Server Example

In order to run a caching server, there are a few steps that need to be taken prior to enabling the caching server to be correctly configured.

Firstly, a caching server is configured locally by using an xml (this can be generated by using the export option from the master realm in the enterprise manager) file that corresponds to local settings like interface details, realm configuration parameters, realm name, realm acl as well as optional channel information. When a cache realm starts, it will read the configuration from the xml file and create the necessary data for the local cache server to start. Any channel information contained within the xml file will result in the cache server creating those desired channels locally.

For example, if i have a master realm which is accessible using the RNAME:

nhp://myremotehost:80/

and i wish to run a local cache server on another host, i would first of all need to export the realm configuration from the remote realm, and then run the following command:

ncachingserver nsp://localhost:9004 file:///C:/xml/realm.xml

which specifies the remote master realm for the cache server and the xml file from which to obtain configuration data from. When this cache server is started, it will attempt to join all channels created locally from the xml file to the remote channels of the same name.

Alternatively, if i wish to simply create a cache copy of all channels from the remote realm, i would be able to do that by simply ensuring the xml file contained no channel data and running the following command:

ncachingserver nsp://localhost:9004 file:///C:/xml/realm.xml /

where the '/' parameter denotes that all channels under / (i.e. the namespace root) will be cached locally.

You can also specify particular channel names to cache, for example:

ncachingserver nsp://localhost:9004 file:///C:/xml/realm.xml /customer/sales

It is important that the cache server xml configuration file contains the correct realm ACL permissions for the cache realm prior to startup. However the cache realm can also be connected to using the enterprise manager and configured as you would do a normal realm server