Computer Clusters March 22, 2007
Posted by nhabibi in Distributed Computing.1 comment so far
It may be useful to describe briefly some terms related to distributed computing, an interesting and complicated subject.
Computer Cluster: is a group of loosely coupled computers that work together closely so that in many respects they can be viewed as a single computer.
Cluster Types:
1-High-availability clusters: are implemented for improving the availability of services which the cluster provides. They operate by having redundant nodes, which provide service when system components fail.
2-Load-balancing clusters: operate by having all workload come through one or more load-balancing front ends, which then distribute it to a collection of back end servers. It’s referred to as server farm.
3-High-performance clusters: are implemented to provide increased performance by splitting a computational task across many different nodes in the cluster, and are most commonly used in scientific computing.
Grid computing (Grid clusters): a technology closely related to cluster computing. The key difference is that a cluster is a single set of nodes sitting in one location, while a Grid is composed of many clusters and other kinds of resources (e.g. networks, storage facilities). Grids typically support more heterogeneous collections than are commonly supported in clusters.
SunCluster : a High-availability cluster software package for Solaris operating systems. Sun Cluster is a kernel-level clustering software.
Sun Grid: is an on-demand grid computing service operated by Sun Microsystems.The Sun Grid is an open source project with its source code available.
Source : Wikipedia
More info:
SunCluster Tour
A good overview on wikipedia
Berkeley Open Infrastructure for Network Computing
Genetic Algorithm March 21, 2007
Posted by nhabibi in Artificial Intelligence, Machine Learning, Soft Computing.add a comment
Genetic Algorithm (GA) is a search technique to find true or approximate solution, inspired by evolutionary biology such as inheritance, mutation and recombination.
The concept is very simple. Assume we have a problem and a pool of solutions (search space). Typically solution are represented by 1s and 0s.
Each individual has a fitness, according to a defined criteria.
GA does many iterations and terminates when reaches a satisfactory fitness level.
Definitions:
mutate ==> changing 1 to 0 and vise versa in a bit string
crossover ==> combining 2 string (parents) and generating
2 new ones (offspring)
The steps in summary are:
while (max fitness of current generation is below of desired fitness) {
1- select probabilistically some individuals from current population
2- recombine them 2 by 2 (crossover)
3- mutate some of them
4- replace new generation with old one
}
You can see a graphical representation of GA in GA viewer.
An implementation of GA in Java, for playTennis problem: Java Class – Example file for testing
Note: It’s not well-documented, I wrote it quickly!
Java RMI March 20, 2007
Posted by nhabibi in Java, Programming.1 comment so far
The Java Remote Invocation (RMI) is a technology to develop distributed applications more easily. It’s object equivalent of RPC:
Remote method invocation allows applications to call object methods located remotely, sharing resources and processing load across systems. Unlike other systems for remote execution which require that only simple data types or defined structures be passed to and from methods, RMI allows any Java object type to be used – even if the client or server has never encountered it before. RMI allows both client and server to dynamically load new object types as required.
Developing RMI applications, it’s little (?) tricky at first. I use a check-list, every time I want to make one!
There’re many tutorials and samples online, but basic steps, in summary, are: (RPC developers must be familiar with terms)
*Writing an interface (MyInterface) : a description of the methods we will allow remote clients to invoke.
*Implementing the interface (MyClass): implementing the functionality of the above methods.
*Writing a RMI Server (MyServer): a server that makes an instance of MyClass and registers it with a registry.
*Writing a RMI client (MyClient): a client that calls the registry to obtain a reference to the remote object, and calls its methods.
*Compiling: compiling the classes as ordinary with javac command, and, compiling the MyClass with rmic tool. This last one, creates stub and skeleton files
*Running Registry: making a registry ready to listen for incoming request with rmiregistry tool
*Running the Server and Client: running MyServer and MyClient with java command
That’s it!
More on RMI home on sun.
Database Locking March 19, 2007
Posted by nhabibi in Computer-Science Term, Database.add a comment
One of the most important feature of a DBMS, is its ability to support concurrent transactions and keep the DB safe against inconsistency,by means of database locking:
When many people may be reading the same data item at the same time, it is usually necessary to ensure that only one application at a time can change a data item. Locking is a way to do this. Because of locking, all changes to a particular data item will be made in the correct order in a transaction.
Different DBMS have different locking mechanisms, but lots in common.
The problems of running concurrent are grouped in to 3: Dirty Read – Non Repeatable Read – Phantom Reads
Isolation levels represent DBMS capability to prevent above problems. The higher level, the more complicated mechanism.
4 levels are considered: Read Uncommitted – Read Committed -
Repeatable Read – Serializable
More info here.
You can see a short report, in Persian, here. We introduced the locking in Sql Server, Oracle and Microsoft Access, briefly.