Tuesday 5 June 2012

Middleware between a Client-Server

Middleware Architecture Designing
I have been fortunate enough to get opportunities to work of some real time and performance critical applications. I felt the need of sharing my ideas and approaches to design applications that fit to expectations. Whatever follows is completely based on my understanding and perception of a good design. I I agree that this could have been designed better, as designs are evolutionary. There is nothing like the ‘Perfect Design’. As you will see, the design went through several iterations and evaluations (evolution's)  before getting finalized.

Scenario:
  • The Server is Java based, on a Solaris machine
  • The Clients are .NET based, on windows PC’s
  • Communication Message format between frontend and backend is standard (3rd partylibrary)
  • Client and Server may be on different Networks

        Design: (Iteration 1)
    Details:
  • This component will be built with Java (JDK v1.6.0.26)
  • There are 2 basic layers in this design namely
    • Network Layer - Handles communication over network (TCP/IP in this case) and message           format conversion (bytes to objects and vice versa)
    • Business Layer - Handles all business logic and processing that is to be done on the data
  • These layers are loosely coupled because of use of Queues between them.
  • Basically, every layer gets its input, does some processing over it and writes the output
  • For Network Layer (at the top, in design; this layer is connected to Client)
    • Input comes on the network in form of bytes (this layer is connected to Client)
    • Processing includes validating and translating bytes to business objects
    • Output is written to a Queue (which acts as input for Business Layer)
  • For Business Layer (includes Business Manager & Transaction Manager)
    • Input comes from the Queue (which was Network Layer's output)
    • Processing includes businessvalidating and translating bytes to application objects
    • Output is written to a Queue (which acts as input for Business Layer)
  • For Network Layer (at the bottom, in design; this layer is connected to Server)
    • Input comes from the Queue (which was Business Layer's output)
    • Processing includes translating business objects to bytes
    • Output is written to a network

No comments:

Post a Comment