Wednesday, March 24, 2010

Architecture Styles-I

Architecture is centered on best practices concepts of reducing complexity through:
  • Simplicity
  • Abstraction
  • Separation of Concerns
  • Modular design
  • Being part of another big System
  • Tolerance
  • Decentralization
Every architecture is unique and drivers to support. Architecture needs to support QOS or non-functional attributes. But to what degree each of these attribute is supported is based on the trade-off analysis each architecture has to perform.
Some of the archtecture syles which I have encountered are:
Monolithic Architecture - is single tiered architecture where all the user-interface, database and logic are not logical seperated and tightly coupled and hosted on a single machine. It is very basic or no-architecture state becuas it lacks the concepts of modular desing, speration of concerns.
Client-Server - is a next step in architecture. It is 2-tiered distributed architecture. It distributes the system in the two main components Servers and Clients.
It started out with Database taking over as the Common Server and clients making the request to the Database server for data persistence and manipulation. Clients had all the logic for making request and also business logic unless Data server had some logic in form of Stored procedure.
3-Tier - This further evolved into 3-tier architecture; where One more Server layer came-in with Database. This Server hosted the all business logic and used the Database for all data persisitence needs. Clients did not have any business logic and contained the code just enough to make the call to the Server. Client however maintained the state for calling the Server.

Client-Server(2 Tier) , 3-tier, ... are instances of n-tier or layered architecture.

Layered Architecture follows the basic concept of architecture ; Separation of Concerns and Modularity. They have followed from the Layered OSI Model which  indicates how each layers performs only it function and is dependent only on its precedent layer for the data. This allows  the replacement of one layer with another layer if built according to specifications wihtout breaking the system.
Thus in 3-tier; user interface layer which is supporting the Struts can be replaced by JSF if the layer are totally independent from the business layer and while building user-interface with JSF the interfacing point and specifcation are  same(i.e each layer has been built in mind that is its a part of another big system which required few specification)
Distributed Architecture : is an architecture (of which 2-tier, 3-tier ...) are instance where consists of autonomous components hosted over seperate computer which communicates with each other over network to perform a some unified task. The modules running on different computer may also add in complexity of running different processing environment. 

Distributed communication over network is usually slower(than on same computer) , more error prone annd less reliable(due to  network failure). It also needs to take care of other issues like no shared memory and change in call protocol to remote  system.  Distributed Architecture needs to take into account issues like latency of remote access, concurrency and network failure.
Distributed Architecture design for object invocation from remote systems across system boundaries, by seralizing the call arguement by means of marshall/un-marshaling. It also needs to take care of


  • Maintaining state of objects to avoid chatty calls over networks(important resource which may cause bottleneck),
  • Security because of exchange of information over network wire which opens new surface for security breach,
  • Reliability due to unpredictability of infrmation exchange and acknowledgement (which opens new area of messaging and asynchronus rather than blocking calls),
Remaining styles in next post ...

No comments:

Post a Comment