Distributed Systems

Hey! welcome back to NadunRavihansaDeblog. From today's article, I'm going to talk about Distributed Systems in PAF

What is this Distributed System and Distributed Computing?

Before move on to the D.S (Distributed System) let's get to know what is this computer-based system. A computer-based system is a system that is implemented to capture, process, transfer, store. display and manage information. For this procedure, the system is consists of software, processors, networks, buses, firmware, application specific integrated circuits, storage devices and humans for process information.
Therefore we can divide this Computer-based system into 2 types
  1. Standalone systems
  2. Distributed systems

Then what is this Distributed Computing?

Distributed computing is mainly a computing concept. What is mean by this concept is different computer systems working together to get a solution to a single problem. To make easy to solve, the problem is divided into many smaller parts and dedicate each part of the problem to each computer system. These systems communicate with each other and perform like a single entity to solve the problem.

Let's get to know about these 2 systems

Standalone systems
Distributed systems
·        The whole project components are executed within a single device.
·        The project components are distributed and executed into multiple devices.

·        System doesn’t need a network to work.
·        System needs a network to communicate and run.
·        Database has one to one between processor and database.
·        Databases in different locations.
·        Must request in the central server and access it.
·        Has multiple servers to access.
·        Use only one or few coupled technologies to develop.
·        Use multiple technologies to develop.

Advantages of Standalone systems

  • Damage control (If something goes wrong only the standalone will be affected).
  • Simplicity ( easy to troubleshoot).
  • Network traffic may not affect the system.
  • Would not take long to install the system.
  • The technical knowledge to manage the system is low.
  • Development cost is low.

Disadvantages of Standalone systems

  • Users are restricted to a single computer.
  • The same software cannot install simultaneously.
  • Requires that any new programs must be set up one by one and it's much more time-consuming.
  • Hard to monitor.

Advantages of Distributed systems

  • Redundancy and resiliency
  • Even if the one server physically fails, the system will stay up.
  • Data loss scenarios are less.
  • Faster than Standalone systems.
  • Database inquiries are can be routed to a server with a particular user's info rather than sending all info to a single machine.
  • Can divide particular problems to different machines to solve the problem much faster.
  • Resources can be added easily.
  • Resources can be shared on multiple PC's.

Disadvantages of Distributed systems

  • The system is much more complicated than standalone systems.
  • Need people with good technical knowledge to manage the system.
  • Development cost is much higher.
  • Greater potential for bugs.
  • Increased processing overhead.

Elements of a distributed system

A distributed system consists of following logical components,
  • Communication system
  • Primary system controller
  • System data store
  • Database
  • Messages
  • Machines
  • Processors on machines
  • Programs
  • People

Do you know different type of services which gained from distributed systems?

These distributed systems are used for high-performance computing tasks. therefore this system can be divided into 2 types,
  1. Cluster computing
  2. Grid computing

Cluster computing-

The elemental hardware exists with a collection of the same type of workstations of pcs, connected so closely and by means of a high-speed local-area network, each node runs the same operating system. This system is used for parallel programming in which a single program is run in parallel on different machines. Ex:- Linux-based Beowulf clusters. The master node is controlling the other cluster connected nodes.


Grid computing-

Grid computing systems have a high degree of heterogeneity. In this system, the resources are gathered from different organizations to allow the gathering of a group of people to form a virtual organization. Members of the same organization have authorizations to the resources that are provided within the organization. The resources of these systems consist of computer servers. Below is a layered architecture for grid computing systems.




Let's check out what are the characteristics of web-based systems

Web applications are software that was designed to appear on the web with web-specific resources. Web applications differ from the small scale projects to large scale ERP. With the time pass, these web applications are have emerged and have become more complexed. Traditional applications were simple and less complex, static content, limited use and level of security were minimal. Nowadays the advanced web applications have introduced with dynamic contents, contain large information, easy to integrate, schedule and plan. Perform better and provide much more effective security.

There are 4 characteristics of web applications
  1. Product-related characteristics
  2. Use related characteristics
  3. Development related characteristics
  4. Evolution-related characteristics

Product related characteristics

This is an integral part of a web application. It consists of the present, hypertext and content. The role of the 'present' in product marketing is to be attractive, impressive and according to fashion trend going on the market. The 'Hypertext' is the base of the web application. It contains the basic elements such as link, node, and anchor. 'Content' is the information part. Generate of content, integration and updating and availability os an important factor.


Use related characteristics

Because of the continuous changes of the users, it is kind of difficult to predict the usage frequency of a web application. These use related characteristics consist of  3 parts such as Natural content, Social content and technical content. 'Natural content' includes the geographical location from where the web applications are accessed and availability of the web application. 'Social contents' is related to user specific aspect. There are thousands of competitive web applications around the globe, the user needs spontaneous and immediate benefits. 'Technical content' is related to the network of web application and the devices where the web application is used. there are few essential features for this unit such as bandwidth, stability, reliability and so on.

Development related characteristics

 This is a combination of the Development team, development process, technical infrastructure, and integration. The development team should have a great knowledge of the area that the person who is working. They must be proficient designers, database developers, IT experts, hypertext experts, application developers. The development of the process must be flexible. There must be parallel processors of development. The Technical infrastructure must be bugs free and development should be under a time limit. Server and Browser are the two external components that should be considered at the time of development. Integration means the support of integration with an already existing system or with external content and services.

Let's move on to different architectures for distributed systems

In distributed systems, components are presented on different platforms and several components can cooperate with another over a communication network in order to achieve a specific objective or goal. information processing is not confined to a single machine rather it is distributed over several independent computers. A distributed system can be demonstrated by the client-server architecture which forms the base for multi-tier architectures; alternatives are the broker architecture such as CORBA, and the Service-Oriented Architecture (SOA). Middleware is an infrastructure that appropriately supports the development and execution of distributed applications. It provides a buffer between the applications and the network.


Client-server architectures -

Distributed services which are called on by clients. Servers that provide services are treated differently from clients that use services. Clients know of servers but servers need not to know of clients. Clients and servers are logical processes. The mapping of processors to process is not necessary.



Distributed object architectures - 

No distinction between clients and servers. Any object in the system may provide and use services from other objects. Each distributable entity is an object that provides services to other objects and receives services from other objects. Object communication is through a middleware system called an object request broker. However, distributed object architectures are more complex to design than C/S systems.

Three-tire architectures -

In a three-tier architecture, each of the application architecture layers may execute on a separate processor. Allows for better performance than a thin client approach and is simpler to manage than a fat-client approach. A more scalable architecture - as demands increase, extra servers can be added.



Monolithic architecture and Microservices architecture

Monolithic architecture -

When a developer develops a server-side application, the developer can start with a modular hexagonal or layered architecture which consists of different types of components. such as 'Presentation' which is responsible for handling HTTP requests and responding with either HTML, 'Business' logic, database access to data access objects responsible and 'Application integration' to combine with other services.

Advantages
  • easy to develop
  • testing is not complicated
  • Deployment is easy
  • Simple to scale horizontally by running multiple copies
Disadvantages
  • Limitation in size and complexity
  • When the application is too large it's difficult to modify.
  • A huge application takes longer to start up.
  • Have to redeploy to apply updates.
  • Changes may lead to manual testing.
  • It makes hard to deploy continuously.
  • reliability issues

Microservices architecture -


In microservices architecture, the application is split into a set of smaller, interconnected services instead of building a single monolithic application. Each and every microservice is a small application that has its own hexagonal architecture consisting of business logic along with various adapters. Some microservices would expose a REST, RPC or message based API and most services consume APIs provided by other services.



Advantages

  • Reduce the complexity by splitting to smaller parts.
  • Faster to develop.
  • Much easier to understand and maintain.
  • Each service can be monitored independently by a team.
  • Reduces the barrier of adopting new technologies since the developers are free to choose the technology.
  • Deployed independently because of continuous deployment possible for complex applications.
  • Makes each service to be scaled independently.
Disadvantages
  • Must implement a inter-processs communication mechanism.
  • Need to update multiple database systems owned by different services.
  • Much time consuming.
  • Testing is much more complex.
  • More difficult to implement changes that span multiple services.
  • Deploying is more complex.

What is this MVC style?

MVC means Model-View-Controller. This architecture is mainly used to develop the interfaces that divide an application into 3 interconnected parts. This is done to separate internal representations of information from the ways information is presented to and accepted from the user. The idea of the MVC pattern the 3 parts are the 'Model', 'View' and 'Controller'.

Model -
The model handles the state of the application. The state is what your application is about. If your application is a forum, your model might contain class:: DBI objects representing threads, users and postings. The Model does not know anything about HTML, or web servers or anything like that. It just supplies ways to query the state, and ways to change that state.


View -
The View is the representation of the user interface. usually, there are many IVews in a single application. A View can query the model, but it is not supposed to change the state. In web-based MVC systems, a view can be implemented using a template that renders an HTML page. In our hypothetical forum application, the views would be the templates for rendering a full thread, the login page, the posting page etc.

Controller 
User actions on the view are sent to the Controller. In a web environment, this is usually done by having the controller handle the incoming HTTP requests. The Controller receives user requests and translates them into actions that the Model should take. Then it selects the appropriate View to handle the response. It is possible to have more than one Controller, but most web application frameworks assume you only have one.


Strengths
  • Simultaneous development
  • High cohesion
  • Low coupling
  • Ease of modification
  • Multiple views for the model
Weaknesses
  • Code navigability
  • Multi-artifact consistency
  • Pronounced learning curve


Let's check out RPC with RMI

RPC is C based, as such it has structures programming semantics, on the other side, RMI is a java based technology and it's object-oriented. With  RPC you can just call remote functions exported into a server, in RMI you can have references to remote objects and invoke their methods, and also pass and return more remote object references that can be distributed among many JVM instances, so it's much more powerful. RMI stands out when the need to develop something more complex a pure client-server architecture arises. it's very easy to spread out objects over a network enabling all the clients to communicate without having to establish individual connections explicitly.


What is this CORBA?

The Common Object Request Broker Architecture (CORBA) is an open standard for distributed object computing defined by the Object Management Group (OMG). CORBA is an object bus enabling the client to invoke methods on remote objects at the server independent of the language the objects have been written in, and their location. The interaction between client and server is mediated by object request brokers (ORBs) on both the client and server sides, communicating typically via IIOP (Internet Inter-ORB Protocol).


The life cycle of a CORBA application -

  1. Define the service as interfaces in IDL.
  2. Compile the IDL to generate client stub and server skeletons.
  3. Implement the service and associate it with the skeletons via the portable object adapter (POA).
  4. Publish the service with a Naming or Trading Service for use by clients.

CORBA in web services -

Web services are an emerging distributed middleware technology that uses a simple XML-based protocol to allow applications to exchange data across the Web. Services are described in terms of the messages accepted and generated. Users of such services do not need to know anything about the details of the implementation (object model, programming language, etc.); they only need to be able to send and receive messages.

Let's check out XML specifications

What is this XML? XML means Extensible Markup Language. This XML is used to describe data. It is a flexible way to create information formats and electronically are structured data via the public internet and corporate networks that have already implemented. XML is a formal recommendation from the 'WWW Consortium'. It is smaller to 'HTML'. Both XML and HTML contain markup symbols to describe the page or file contents. HTML code describes web page content only in terms of it is to be displayed and interact with.
The XML file contains important tags such as,
  • PRODUCTNAME - The name of a producer, product or code.
  • ITEM ID - Definite and permanent product identification.
  • CATEGORYTEXT - The whole path to the product.
  • DELIVERY - Shipping or delivery cost for particular products.
  • DELIVERY DATE - Correct info on product availability.
  • IMGURL ALTERNATIVE, VIDEO URL, ACCESSORY - for better presentation and product display.
  • ITEMGROUP ID - Size options, colors, designs, etc., particular products that can be associated together.

What are the differences between XML and JSON

The differences between XML and JSON is that XML is a meta-language/markup language and JSON is a lightweight data interchange. That is, XML syntax is designed specifically to have no inherent semantics. In other words, XML is a markup language, whereas JSON is a way of representing objects. 
Example:-
With XML -
<Document>
    <Paragraph Align="Center">
        Here <Bold>is</Bold> some text.
    </Paragraph>
</Document>
With JSON
{
    "Paragraphs": [
        {
            "align": "center",
            "content": [
                "Here ", {
                    "style" : "bold",
                    "content": [ "is" ]
                },
                " some text."
            ]
        }
    ]
}

JSON
XML
·        JavaScript object notation
·        Extensible markup language
·        Based on JavaScript language
·        Derived from SGML
·        Way of representing objects
·        markup language and uses a tag structure to represent data items
·        Does not provide any support for namespaces
·        supports namespaces
·        Supports array
·        doesn’t support the array
·        Easier to read than XML
·        documents are comparatively difficult to read and interpret
·        Doesn’t use an end tag
·        has start and end tags
·        Less secured
·        is more secured than JSON
·        Doesn’t support comments
·        supports comments
·        Supports only UTF-8 encoding
·        supports various encoding


That's all for this article and hope you had a better understanding of distributed systems. Thank you for reading and good luck!


References

Comments

Popular Posts