Friday, March 8, 2019

Distributed Systems

Distributed System and Distributed Computing

Distributed system: a collection of independent computers that are connected with an interconnection network.
A distributed system contains multiple nodes that are physically separate but linked together using the network. All the nodes in this system communicate with each other and handle processes in tandem. Each of these nodes contains a small part of the distributed operating system software.
Distributed Systems
Types of Distributed System :
  • Client-Server Systems
  • Peer to Peer System

Advantages of Distributed Systems :

  • All the nodes in the distributed system are connected to each other. So nodes can easily share data with other nodes.
  • More nodes can easily be added to the distributed system i.e. it can be scaled as required.
  • Failure of one node does not lead to the failure of the entire distributed system. Other nodes can still communicate with each other.
  • Resources like printers can be shared with multiple nodes rather than being restricted to just one.



Distributed computing: a method of computer processing in which different parts of a computer program are run on two or more computers that are communicating with each other over a network.

A distributed computer system consists of multiple software components that are on multiple computers, but run as a single system. The computers that are in a distributed system can be physically close together and connected by a local network, or they can be geographically distant and connected by a wide area network. A distributed system can consist of any number of possible configurations, such as mainframes, personal computers, workstations, minicomputers, and so on. The goal of distributed computing is to make such a network work as a single computer.

Advantages of Distributed Computing :

  • The system can easily be expanded by adding more machines as needed.
  • Several machines can provide the same services, so if one is unavailable, work does not stop. Additionally, because many smaller machines can be used, this redundancy does not need to be prohibitively expensive.

Standalone System vs Distributed System

Standalone Systems :

Standalone applications are traditional software that are installed on each client system. Essence Computing only develops platform-independent applications, so that the user can use any Operating System of their choice on the system. The data can optionally reside on a Central server, so that the users get synchronized data.


  • All the components are executed within a single device
  • Do not need a network
  • Usually one or tightly coupled set of technologies are used to develop (JAVA, .NET)


Distributed Systems  :


The increasing criticality of these systems means that it is necessary for these online systems to be built for redundancy, fault tolerance, and high availability


  • The components are distributed and executed in multiple devices
  • Need a network
  • Multiple and loosely coupled set of technologies are used to develop (HTML +CSS + JS + PHP)


Elements of Distributed Systems 
  • Processing components
  • Data networks for components to communicate
  • Including the components who are dedicated for processing the communication, called connectors
  • Data stores (data bases) and Data
  • The configuration of the above elements



Different Types of Services in Distributed Systems

  • Mail service (SMTP, POP3, IMAP)
  • File transferring and sharing (FTP)
  • Remote logging (telnet)
  • Games and multimedia (RTP, SIP, H.26x)
  • Web (HTTP)


Browser based and non browser based clients


A browser-based (or web-based) tool, application, program, or app is software that runs on your web browser. Browser-based applications only require an internet connection and an installed web browser on your computer to function. Most web-based applications are installed and run on a remote server that you access with your web browser.

Examples :Google Slides,Office 365 Online

Non Browser based system need internet connection but its don't need the PC and Internet browser. Its can be used in Mobile Devices, Tablets and smart watches.

Examples : WhatsApp, Facebook


Characteristics of Different Types of Distributed System

Web sites 
  • Mobile Compatibility
  • Accessible to All Users
  • Well Planned Information Architecture
  • Fast Load Times
  • Browser Consistency
  • Effective Navigations

Web applications

  • Developer productivity
  • Elegance
  • Usability
  • Security
  • Reliability
  • Performance
  • Scalability
  • Testability
  • Deployability

Web services and client apps 

Web Services ;

XML-RPC (Remote Procedure Call) is the most basic XML protocol to exchange data between a wide variety of devices on a network. It uses HTTP to quickly and easily transfer data and communication other information from client to server.

UDDI (Universal Description, Discovery, and Integration) is an XML-based standard for detailing, publishing, and discovering web services. It’s basically an internet registry for businesses around the world.

SOAP, which will be described in detail later in the blog, is an XML-based Web service protocol to exchange data and documents over HTTP or SMTP (Simple Mail Transfer Protocol). It allows independent processes operating on disparate systems to communicate using XML.

REST, which will also be described in great detail later in the blog, provides communication and connectivity between devices and the internet for API-based tasks. Most RESTful services use HTTP as the supporting protocol



Rich Internet Applications (RIAs)/Rich Web - based Applications (RiWAs)

1. Direct interaction: An RIA can use a wider range of controls that allow greater efficiency and enhance the user experience. In RIAs, for example, users can interact directly with page elements through editing or drag-and-drop tools. They can also do things like pan across a map or other image.
2. Partial-page updating: RIAs incorporate additional technologies, such as real-time streaming, high-performance client-side virtual machines, and local caching mechanisms that reduce latency (wait times) and increase responsiveness.
3. Better feedback: Because of their ability to change parts of pages without reloading, RIAs can provide the user with fast and accurate feedback, real-time confirmation of actions and choices, and informative and detailed error messages.
4. Consistency of look and feel: With RIA tools, the user interface and experience with different browsers and operating systems can be more carefully controlled and made consistent.
5. Offline use: When connectivity is unavailable, it might still be possible to use an RIA if the app is designed to retain its state locally on the client machine.
6. Performance impact: Depending on the application and network characteristics, RIAs can often perform better than traditional apps. In particular, applications that avoid round trips to the server by processing locally on the client are likely to be noticeably faster.

Different Architectures of Distributed Systems

01. Client Server Architecture
  • Client − This is the first process that issues a request to the second process i.e. the server.
  • Server − This is the second process that receives the request, carries it out, and sends a reply to the client.

Thin-client model : In thin-client model, all the application processing and data management is carried by the server. The client is simply responsible for running the presentation software.

Thick/Fat-client model :In thick-client model, the server is only in charge for data management. The software on the client implements the application logic and the interactions with the system user

02. Multi Tier Architecture

A Multi-tier Architecture is a software architecture in which different software components, organized in tiers (layers), provide dedicated functionality. The most common occurrence of a multi-tier architecture is a three-tier system consisting of a data management tier (mostly encompassing one or several database servers), an application tier (business logic) and a client tier (interface functionality).

03. Service Oriented Architecture

its a style of software design where services are provided to the other components by application components, through a communication protocol over a network. The basic principles of service-oriented architecture are independent of vendors, products and technologies



Micro-service architecture vs Monolithic architecture


Benefits and challenges of microservices (when compared with the monolithic model)?

Benefits

  • Deployability: more agility to roll out new versions of a service due to shorter build+test+deploy cycles. Also, flexibility to employ service-specific security, replication, persistence, and monitoring configurations.
  • Reliability: a microservice fault affects that microservice alone and its consumers, whereas in the monolithic model a service fault may bring down the entire monolith.
  • Availability: rolling out a new version of a microservice requires little downtime, whereas rolling out a new version of a service in the monolith requires a typically slower restart of the entire monolith.
  • Scalability: each microservice can be scaled independently using pools, clusters, grids. The deployment characteristics make microservices a great match for the elasticity of the cloud.
  • Modifiability: more flexibility to use new frameworks, libraries, datasources, and other resources. Also, microservices are loosely-coupled, modular components only accessible via their contracts, and hence less prone to turn into a big ball of mud.
  • Management: the application development effort is divided across teams that are smaller and work more independently.
  • Design autonomy: the team has freedom to employ different technologies, frameworks, and patterns to design and implement each microservice, and can change and redeploy each microservice independently

Challenges

  • Deployability: there are far more deployment units, so there are more complex jobs, scripts, transfer areas, and config files to oversee for deployment. (For that reason, continuous delivery and DevOps are highly desirable for microservice projects.)
  • Performance: services more likely need to communicate over the network, whereas services within the monolith may benefit from local calls. (For that reason, the design should avoid "chatty" microservices.)
  • Modifiability: changes to the contract are more likely to impact consumers deployed elsewhere, whereas in the monolithic model consumers are more likely to be within the monolith and will be rolled out in lockstep with the service. Also, mechanisms to improve autonomy, such as eventual consistency and asynchronous calls, add complexity to microservices.
  • Testability: integration tests are harder to setup and run because they may span different microservices on different runtime environments.
  • Management: the effort to manage operations increases because there are more runtime components, log files, and point-to-point interactions to oversee.

MVC (Model View Controller) Architecture


MVC is popular as it isolates the application logic from the user interface layer and supports separation of concerns. Here the Controller receives all requests for the application and then works with the Model to prepare any data needed by the View. The View then uses the data prepared by the Controller to generate a final presentable response. The MVC abstraction can be graphically represented as follows.

Image result for mvc

Model − The lowest level of the pattern which is responsible for maintaining data.

The model is responsible for managing the data of the application. It responds to the request from the view and it also responds to instructions from the controller to update itself.

View − This is responsible for displaying all or a portion of the data to the user.

It means presentation of data in a particular format, triggered by a controller's decision to present the data. They are script-based templating systems like JSP, ASP, PHP and very easy to integrate with AJAX technology.

Controller − Software Code that controls the interactions between the Model and View.

The controller is responsible for responding to the user input and perform interactions on the data model objects. The controller receives the input, it validates the input and then performs the business operation that modifies the state of the data model.




Different approaches of use of MVC for web-based systems

  • MVC does not use server-based forms, that’s why it is ideal for those developers who want full control over their application behavior.
  • Test driven development approach is supported by MVC architecture.
  • MVC use front controller pattern. Front controller pattern handles the multiple incoming requests using single interface (controller). Front controller provides centralized control. We need to configure only one controller in web server instead of many.
  • Front controller provides support rich routing communications to design our web application.


No comments:

Post a Comment