Archive for the 'Distributed Systems' category

How to Run Java RMI?

11 Mar 2011 by

There is a tricky in getting Java RMI works and runs. First, you need to understand the Overview of Java RMI and know how to implement it. Java RMI relies on 3 components–client, server and registry service.

Note: This article refers to the code developed in How to Implement Java RMI.

Registry Service

There are 2 ways to deal with registry service.

  • Run rmiregistry command in Dos prompt or Console if it is not created in the code
  • Create RMI registry service in the code

Registry registry = LocateRegistry.createRegistry(1099);

    Server

    • It needs interface class(IPower.java) created in Step 1 of How to Implement Java RMI article
    • Run java PowerServer

    Client

    • It also needs interface class (IPower.java)
    • Be sure that you pointed to the right server’s registry service
    • Run java PowerClient

    No responses yet

    How to Implement Java RMI?

    10 Mar 2011 by

    Java RMI Implementation

    Java RMI Implementation

    Implement Java RMI could be ever easier if you follow my rule strictly. You need to understand Java RMI Overview before you can catch the code.

    According to the above figure, there are 4 steps need to be involved in Java RMI development. I will give you an example of creating Java RMI application dealing with Fibonacci and Factorial calculation using badly recursive algorithm. These two methods will be available for invocation at the server side. I will call the server program as PowerServer and client program as PowerClient.

    Continue Reading »

    2 responses so far

    Java RMI Overview

    08 Mar 2011 by

    Java RMI Overview

    Java RMI Overview

    Java RMI or Remote Method Invocation is an example of Remote Procedure Call (RPC) enabling client program to locate the server object and remotely invoke the methods from server through server’s stub and skeleton function. Java RMI is usually referred to Distributed Object rather than RPC. This is because Java natively is object oriented programming. So we say object as a whole. Moreover, RPC somehow is mentioned to procedural programming.

    Continue Reading »

    One response so far

    Marshalling and Serialization

    08 Mar 2011 by

    Marshal object to a file

    Marshal object to a file

    In practice, the terms marshalling and serialization are used interchangeably to describe the process of squashing data types into a well-defined intermediate format that is suitable for transmission on a network or for storage in a file. You might be familiar with Remote Procedure Call (RPC) as the core stub function needs to marshal the argument and return value of a method before they are actually transmitted over the network.

    This article, I will show you with an example of marshalling and unmarshalling a Java object. Be reminded that:

    • Not all data types can be serialized
    • User-defined class must implement Serializable interface
    • Attempt to marshal or serialize a non-serializable object will throw an Exception in Java

    Continue Reading »

    No responses yet

    Remote Procedure Call (RPC)

    07 Mar 2011 by

    RPC Overview

    RPC Overview

    RPC is the middle which allows client to call remote functions located on the server side. RPC is designed bearing in mind to combat the main disadvantage in inter-process communication (UDP and TCP) as it is hard in developing protocol. Moreover, we want to make distributed systems more transparent.

    In order to call remote functions or methods, client depends on Stub function stimulating client as a real functions or methods locally.

    Continue Reading »

    No responses yet

    Distributed Systems False Assumption

    06 Mar 2011 by

    Distributed Systems Component

    Distributed Systems Component

    Usually distributed systems consists of 3 main components namely Server, Network and Software. Server contains operating systems for providing network services or middleware on which distributed systems software relies. Network is the connectivity among those servers serving as the super high way for information sharing. Software refers anything soft platform that makes distributed system works and serves for clients as a coherent system. Software involves from ground up to user interface that users normally interact.

    At each component, there is a generally common false assumption made by several system designers. These assumptions cannot be negligible; otherwise distributed systems cannot run smoothly.

    Continue Reading »

    One response so far

    Pros and Cons of Distributed Systems

    06 Mar 2011 by

    What is distributed systems and why do we need it have been discussed in this blog. So now I will discuss the pros and cons of distributed systems in general. Understanding this pros and cons shapes the designing the distributed systems.

    Pros

    • Cost
      • Mainframe is too expensive compares to buying several commodity servers. Commodity servers refer to a server with Intel Xeon architecture or AMD Opteron or Mac architecture.
    • Performance
      • By combining thousands of servers processing power and storage capacity, distributed systems is extremely powerful compares to mainframe or super computer.
    • Scalability
      • Resources such as processing and storage capacity can be increased incrementally. In other words, if distributed systems is better designed, adding nodes and storage and just plug-and-play.
    • Reliability
      • By having redundant components, the impact of hardware and software faults on users can be reduced. The fault components just simply be added to scale it up.
    • Inherent distribution
      • Some applications like the web, email, instant messaging, social network, etc. are naturally distributed.

    Cons

    • Network
      • Current network capacity might be limited by 10 Gbps. And network is needed to connect thousands of independent computers and is subjected to performance bottleneck.
    • Security
      • Security is the most concerning issue in every computing. Distributed systems also needs to be designed not to be easily compromised.
    • Software complexity
      • Developing software for distributed systems is the hardest part. It requires a lot of expertises with different software platforms to build very large interactive software stack.

    No responses yet

    Why do we need distributed systems?

    05 Mar 2011 by

    According to Moore’s Law, the processing power of CPU gains double for every 18 months. This should be pretty enough for today computing. However, it is not and there is a demanding on deploying distributed systems. What is the distributed systems anyway? There are several definitions around it. I would like to quote from 2 main editors.

    Coulouris et al

    A distributed system is one in which components located at networked computers communicate and coordinate their actions only by passing messages

    Tanenbaum, Van Steen

    A distributed system is a collection of independent computers that appears to its users as a single coherent system

    Continue Reading »

    5 responses so far

    TCP Programming with Java

    04 Mar 2011 by

    TCP Programming has been developed for the sake of reliability in data transmission. Unique feature of TCP is Acknowledgment scheme, Packet ordering and congestion control. These make TCP more popular in network transmission control protocol. Nowadays, the protocol dominant in the Internet is HTTP but be remembered that it relies on TCP architecture. There are several variant of TCP protocols that have been extensively researched. For example, TCP Tahoe, TCP Reno, TCP New Reno, TCP Westwood, TCP Vegas, etc. In contrast with UDP Programming, TCP is much easier.

    Continue Reading »

    4 responses so far

    UDP Programming with Java

    02 Mar 2011 by

    Resource on UDP Programming is limited and even rare for some programming languages. For TCP Programming, I guess, there is a lot and many languages support it. For example, Java, C, C++, C#, WinSock, etc. So this article is to contribute to those limitation by taking an advantage of java.net package that supports UDP programming interface. The understanding of UDP and TCP is required.

    Continue Reading »

    6 responses so far