Virtualization Replaces Client-Server With Virtual Machines

As mentioned in a previous article on virtualization, the advent of client-server topology thankfully put computing power into the hands of end users, but as these applications were rolled out over many years a number of financial and technical issues became readily apparent.

* Low Infrastructure Utilization – often times operating at less than 25% of total capacity

* Increased Infrastructure Cost – for servers, desktop computers, facilities and cooling

* Increased Maintenance Cost – more network administrators and server upgrades

* Insufficient Disaster Protection – complex networks became more difficult to backup

Coming to the rescue was the implementation of virtualization technology inside x86-based hardware. Pioneered by VMware, this new layer of software allowed multiple “virtual machines” to operate on a single server. Taking advantage of multi-core, multi-processor hardware, these virtual machines act like a single physical computer, complete with CPU, memory, hard drive storage, and network interface.

Operating systems, which are loaded onto each of the virtual machines, behave as though they were running on a dedicated server, even though this fully isolated environment is software based. These operating systems, which can include Microsoft Windows running alongside various flavors of Linux, are completely isolated from each other. If one virtual machine encounters a problem and crashes, the others are unaffected while the problem is resolved and the one machine is rebooted separately.

Beyond the level of a single server, users can now create what VMware calls a Virtual Infrastructure which lets the IT group manage a series of servers as though they were a single machine. In this case, the physical resources of multiple servers, along with associated storage and networks, are pooled in a way that offers greater utilization, availability, performance and flexibility.

Within such configurations, dynamic provisioning allows computing resources to be allocated where needed, and these workloads can even be moved across hardware systems in real time. Scheduled maintenance can also occur without critical applications being taken off line while at the same time reducing overall points of failure.

Virtual machines and virtual infrastructures are being widely deployed, from data centers to industrial automation, video processing and simulation. Trenton offers a broad range of computing platforms that support such applications, using single board computers and backplanes or fully integrated rackmount computers with segmented backplanes supporting multiple SBCs in a single rackmount enclosure.

Two Trenton white papers covering the topics of Cross-Domain Networks and Cluster Computing can provide additional information on how Trenton is serving the needs of high performance computing in a virtualized environment.

NodeJS Hosting Tips – Creating a Multi Room Chat Client

Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. NowJS is a framework built on top of Node.js that connects the client side and server side JavaScript effortlessly.

The core of NowJS functionality lies in the now object. The now object is special because it exists on the server and the client.

This means variables you set in the now object are automatically synced between the client and the server. Also server functions can be directly called on the client and client functions can be called directly from the server.

You can have a working HTTP server up and running in NodeJS with just a few lines of code. For example:

var http = require('http'); 
http.createServer(function (req, res) { 
res.writeHead(200, {'Content-Type': 'text/plain'}); 
res.end('Hello Worldn'); 
}).listen(8080);

This little snippet of code will create an HTTP server, listen on port 8080, and send back “Hello World” for every request. That’s it. Nothing more needed.

Using NowJS, communication between the client and server side is just as simple.

Client Side:

<script type="text/JavaScript"> 
now.ready(function(){ 
now.clientSideVariable = 'someValue'; 
now.serverSideFunction(); 
}); 
</script>

In this code snippet, the client side sets a variable to ‘someValue’ and calls serverSideFunction(), which is declared only on the server.

Server Side:

everyone.now.serverSideFunction = function() { 
console.log(this.now.clientSideVariable); 
}

The server side is then able to access clientSideVariable, which is declared only on the client.

All the details such as establishing connections and communicating change of data between the server and client are handed automagically by the framework.

In fact writing code using this framework is so simple, the NowJS hello world example is a working chat client and server written in under a dozen lines of code. Go check it out.

As a simple exercise to get comfortable with the NowJS API, we can modify the chat client example to support multiple chat rooms. Let’s take a look at how easy it is.

Server Side (multiroom_server.js)

1. The first thing we need to do is modify the distributeMessage() function to only send messages to users in the same chat room as the user.

// Send message to everyone in the users group 
everyone.now.distributeMessage = function(message){ 
var group = nowjs.getGroup(this.now.serverRoom); 
group.now.receiveMessage(this.now.name+'@'+this.now.serverRoom, message); 
};

We store the name of the server room on the client side (this.now.serverRoom). When the client calls the distributeMessage() function we send the message to everyone in the same chat room by using getGroup() and using the group.now object instead of theeveryone.now object. (everyone is just a group that contains all users connected to the server).

2. Next we need to handle the client changing chat rooms.

everyone.now.changeRoom = function(newRoom){ 
var oldRoom = this.now.serverRoom; 
//if old room is not null; then leave the old room 
if(oldRoom){ 
var oldGroup = nowjs.getGroup(oldRoom); 
oldGroup.removeUser(this.user.clientId); 
} 
// join the new room 
var newGroup = nowjs.getGroup(newRoom); 
newGroup.addUser(this.user.clientId); 
// update the client's serverRoom variable 
this.now.serverRoom = newRoom; 
};

The getGroup() method fetches the group object if it exists and creates a group if it doesn’t already exist. We use the groups addUser() and removeUser() methods to move the client from the old room to the new room.

That’s about it on the server side.

Client Side (multiroom.html)

3. First we add a drop down with the list of server rooms.

<select> 
<option selected="selected" value="room1">Room 1</option> 
<option value="room2">Room 2</option> 
<option value="room3">Room 3</option> 
</select>

4. Next we call the server side changeRoom() function when the user first connects and whenever the drop down is changed.

// on establishing 'now' connection, set the server room 
now.ready(function(){ 
// By default pick the first chatroom 
now.changeRoom($('#server-room').val()); 
}); 
// On change of drop down, clear text and change server room 
$('#server-room').change(function(){ 
$("#messages").html("); 
now.changeRoom($('#server-room').val()); 
});

5. For extra credit, we can allow the server to dynamically provide the list of rooms when the client connects.

The changes required would be

Server Side:

// Declare a list of server rooms 
everyone.now.serverRoomsList = {'room1':'Room 1','room2':'Room 2','room3':'Room 3'};

Client Side:

now.ready(function(){ 
// Pick up list of chatrooms from server and populate dropdown 
setServerRoomFromList(now.serverRoomsList); 
// By default pick the first chatroom 
now.changeRoom($('#server-room').val()); 
}); 
// populate the #server-room dropdown from a list 
function setServerRoomFromList(roomList){ 
$('#server-room').empty(); 
$.each(roomList, function(key, value){ 
$('#server-room'). 
append($(""). 
attr("value",key). 
text(value)); 
}); 
}

That’s really all you need to do. We now have a multi room chat client/server with

i) A drop down on the client side with list of server rooms

ii) On connection with server, client auto populates server room list and enters the first room

iii) Changing drop down changes room

iv) Entering new room clears the screen for the user

This is obviously a fairly barebones version (like the original example), but it serves as a proof of concept of all the essential elements of NowJS communication.

I am hoping that this post about tips of NodeJS Hosting would be useful for you.

MS Access Versus Client Server Database Platforms

Throughout my years working with Access, initially using it as a glorified spreadsheet package, I have gradually honed my skills but I am still learning new things everyday. Every new project takes my knowledge to a new level and I want the business world to realise just how versatile this product really is.

Having built systems as complex as Reinsurance pool ledgers I know just how powerful it can be. It is a shame that the IT fraternity have always mocked its capabilities as a reliable database application. This is mainly to do with the fact that users can build their own systems, which generally do not follow standard programming conventions and it becomes, from their point of view, impossible to support. However, designed and programmed properly this need not be the case.
 

OK so you cant build conglomerate size systems with Access, I accept that. But there are literally millions of companies in the world that are not conglomerates.
 
I have worked for Insurance companies that have invested millions of pounds in their systems which is obviously a completely different ball game, but for the small to medium sized business MS Access is invaluable.
 
Access can produce an extremely professional, user friendly interface or menu based functionality that easily rivals the bigger fish. Indeed, Access interfaces are often used to front client server systems such as SQL Server due to Access’ flexibility and ease of menu design. The only difference is the data is held on the SQL platform instead of internally in the Access platform. Obviously the volume of data here is what counts, but let me tell you, I have a database with over three million records in it and it works fine. It has only taken up 3/4s of the memory space that Access can handle, so as you can see, for most companies this is more than sufficient.
 
Lets talk about cost. For the price of developing a system in Access, you probably would have spent the same just getting the system specd out in Oracle. This is because the companies that develop these client server mainframe systems have huge infrastructures and as a consequence, huge overheads. They will charge a minimum of £100ph for every individual at every meeting they have with you, then there is the project manager, the accountant, the programmers and so on.
 

You then need powerful hardware to handle such a system, along with expensive licenses for every user. Access needs none of this! Any reasonable server can handle it or, if you are a small outfit, a desktop computer is fine. The only license you will ever need is the license you got when you purchased MS Access itself (most people already have it as it comes with MS Office).
 
So you are just left with the cost of developing it. Well most Access programmers either own or work for small establishments and simply dont have the same massive overheads.
 
If you need a bespoke system, please consider the merits of using Access, it may not be for you but then again it just might. Find yourself an established company, with good support mechanisms, and you might just save yourself a fortune!