Distributed Systems

Tutorial -04



01.Explain the term “distributed systems”, contrasting it from     “distributed computing”

Computer based distributed systems mainly divided in to two types.according to distribution of the components.

1.Standalone Systems(Desktop Applications)
2.Distributed Systems

Distributed computing is a field of computer science that studies distributed systems

distributed system is a system whose components are located on different networked computers, which communicate and coordinate their actions by passing messages to one another.




02.Compare and contrast the standalone systems with distributed systems, providing examples
for advantageous use of both

Standalone Systems - 1.All the components are executed with a single line.
                                    2.Do not need a network
                                    3.Usually one or tightly
                                    coupled set of technologies
                                    are used to develop (JAVA.NET)

Standalone Advantages

One advantage of a standalone computer is damage control. For example, if something goes wrong, only the standalone will be affected. Simplicity is another advantage, because it takes a lot less expertise to manage one computer than it does to set-up or troubleshoot several. Standalone computers can also be more convenient. For example, printing on a network may require you to walk some distance from the computer to the printer. Inversely, any peripherals on a standalone have to be in arm's reach. Finally, a standalone does not affect other computer users. With a network, one user may waste space by watching movies or listening to music. In turn, everyone else using the network may see slower computer performance.

Standalone Disadvantages

Standalone computers have drawbacks. First of all, users are restricted to a single computer. On a network, users can access their files from any connected computer. Second, the same software cannot be installed simultaneously. While a network allows everything to be changed at once, a standalone requires that any new programs must be set up one-by-one, which is much more time-consuming. Third, it is much cheaper to connect every computer to one printer than to buy a printer for each standalone computer. Finally, standalones are harder to monitor. On a network, certain software can be used to simultaneously view each user's activity.

Distributed Systems - 1.The components are distributed and executed in multiple devices
                                   2. Need a network
                                       3.Multiple and loosely coupled set of technologies are use develop(HTML+ CSS + JS + PHP)


Advantages of Distributed System :

  • Sharing Data : There is a provision in the environment where user at one site may be able to access the data residing at other sites.
  • Autonomy : Because of sharing data by means of data distribution each site is able to retain a degree of control over data that are stored locally.
  • In distributed system there is a global database administrator responsible for the entire system. A part of global data base administrator responsibilities is delegated to local data base administrator for each site. Depending upon the design of distributed database
  • each local database administrator may have different degree of local autonomy.
  • Availability : If one site fails in a distributed system, the remaining sites may be able to continue operating. Thus a failure of a site doesn't necessarily imply the shutdown of the System.

Disadvantages of Distributed Systems :

  • The added complexity required to ensure proper co-ordination among the sites, is the major disadvantage. This increased complexity takes various forms :
  • Software Development Cost : It is more difficult to implement a distributed database system; thus it is more costly.
  • Greater Potential for Bugs : Since the sites that constitute the distributed database system operate parallel, it is harder to ensure the correctness of algorithms, especially operation during failures of part of the system, and recovery from failures. The potential exists for extremely subtle bugs.
  • increased Processing Overhead : The exchange of information and additional computation required to achieve intersite co-ordination are a form of overhead that does not arise in centralized system.



03.Discuss the 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




04.Identify different types of services, which can be gained from distributed systems, specifying
the protocols used for them

Their are many types of distributed system services


1.Mail Service (SMTP , POP3, IMAP)
2.File transferring and sharing (FTP)
3.remote logging (TELNET)
4.Games and Multimedia
5.web(HTTPS)



05. Identify examples for both browser-based and non-browser-based clients of distributed
systems

Browser based Computer tools and applications which run on a web browser via the Internet without accessing the operating system of any individual computer. These applications are accessed through web pages and can be used by people who are prevented from downloading software applications by firewalls.


Non Browser based -A "Browser App" would be a recognized web browser application like Internet Explorer, Firefox, Chrome, Opera, and the like. All other applications would be considered "non-browser" apps or applications whose main purpose is something other than to contact sites on the internet at your request



06. Discuss the characteristics of different types of Web-based systems, including the RiWAs

Types of Web-based Systems
•Web sites
•Web applications
•Web services and client apps
•Rich Internet Applications (RIAs)/Rich Webbased
Applications (RiWAs)




07.Explain different architectures for distributed systems, explaining special features of each

The basic architecture of the distributed systems is called the client-server (or two-tier)
architecture
Usually (not always) the client (user) sends a request asking the server for some service and the server responses with the resources





3-tier architecture is used, when there is a need for data persistence and also to separate the application logic from the data

When there is a need for further separation and distribution of the components, more tiers can be added and extend the 2-tier or 3-tier architecture into an n-tier architecture


When different types of distributed systems want to communicate and share their services
forming enterprise level systems, the Service Oriented Architecture (SOA) is used.


08.Compare and contrast the micro-service architecture from monolithic architecture


Monolithic Architecture

In simplest terms, Monolithic means composed all in one piece i.e. code components are interconnected and interdependent.For example, when a web client (browser) sends a request, following happensThe business layer performs the business logic.Data access layer performs database collects/stores specific tasks.Presentation layer shows the data to the user.Basically, the same code basemaintains all the code (presentation, business and data access layer).

Benefits of Monolithic Architecture

  • Complexity: In a microservice based application, It is more difficult to implement changes that propagates through various services. In a monolithic application, it is relatively simple to update the corresponding modules, add the changes and deploy them in one go.
  • Deployability: For monolithic application, all changes can be pushed via single deployment.
  • In contrast, a microservice application, generally, uses various services.
  • Each service requires its own set of configuration for deployment as well as monitoring, which adds additional level of overhead.
  • Testing: If a functionality depends on various services then testing it becomes very complex. In monolithic application, testing is relatively easy.
  • Handling Failure: In a monolithic application, components are internally connected to each other so handling failure is much easier as everything is, part of single application.
  • In a microservice application, developers need to handle the logic for, intercommunication as well as failures, between services, which ultimately increases complexity.

Microservice Architecture

In general, a microservice is:
 A self-contained, well-defined, small and independently deployable unit.Which does not depend on the state of other services.The idea is to split application into a set of smaller, interconnected services instead of building a single monolithic application.Each microservice is a small application that has its own architecture, consisting of business logic along with various adapters.Most microservices expose REST APIs and most services consume APIs provided by other services.

Benefits of Microservice Architecture

  • Easier to understand and maintain: Microservices tackle the problem of complexity by decomposing application into a set of manageable services which are much faster to develop, and much easier to understand and maintain.
  • Adopting new technologies: Each service is independent so choosing programming language is more dependent to actual problem, rather than choices made at the start of the project.
  • Fault isolation: Microservices improve fault isolation so that the application can remain largely unaffected by the failure of a single service.
  • Scalable and Cost effective: Scaling services, as the need arises, is much cost effective.
  • Say, an application consists of 2 modules – auth and product. Due to microservice architecture, user can scale any one service(say product, without actually affecting the auth service).
  • Also, with the AWS Lambda like auto scalable services, in case of increased demand for a particular service, it’s very easy and much more economical to scale micro-service.



9. Explain the MVC style, indicating the limitations of it in the context of web-based systems
Model view controller (MVC) is a very useful and popular design pattern. If you're writing software, you should know it. Unfortunately it's also one of the hardest to truly understand. In this article I will provide what I think is the simplest explanation of MVC, and why you should use it.

The MVC pattern, in a nutshell, is this:

1) Model: It specifies the logical structure of data in a software application and the high-level class associated with it. It is the domain-specific representation of the data which describes the working of an application. When a model changes its state, domain notifies its associated views, so they can refresh.

2) View: View component is used for all the UI logic of the application and these are the components that display the application’s user interface (UI). It renders the model into a form suitable for interaction. Multiple views can exist for a single model for different purposes.



3) Controller: Controllers act as an interface between Model and View components. It processes all the business logic and incoming requests, manipulate data using the Model component, and interact with the Views to render the final output. It receives input and initiates a response by making calls on model objects.


10. Identify different approaches of use of MVC for web-based systems and discuss their strengths and weaknesses 

Advantages of MVC

1) Faster development process: MVC supports rapid and parallel development. With MVC, one programmer can work on the view while other can work on the controller to create business logic of the web application. The application developed using MVC can be three times faster than application developed using other development patterns.

2) Ability to provide multiple views: In the MVC Model, you can create multiple views for a model. Code duplication is very limited in MVC because it separates data and business logic from the display.

3) Support for asynchronous technique: MVC also supports asynchronous technique, which helps developers to develop an application that loads very fast.

4) Modification does not affect the entire model: Modification does not affect the entire model because model part does not depend on the views part. Therefore, any changes in the Model will not affect the entire architecture.

5) MVC model returns the data without formatting: MVC pattern returns data without applying any formatting so the same components can be used and called for use with any interface.

6) SEO friendly Development platform: Using this platform, it is very easy to develop SEO-friendly URLs to generate more visits from a specific application.

Disadvantages of MVC

1) Increased complexity

2) Inefficiency of data access in view

3) Difficulty of using MVC with modern user interface.

4) Need multiple programmers

5) Knowledge on multiple technologies is required.

6) Developer have knowledge of client side code and html code.

The Benefits of using The MVC 

Different views and controllers can be substituted to provide alternate user interfaces for the same model.
Multiple simultaneous views of the same model
The change propagation mechanism insures that all views simultaneously reflect the current state of the model.
Changes affecting just the user interface of the application become easier to make.
With MVC it can be easier to test the core of the application, as encapsulated by the model.
The problems of MVC2

There’s increased complexity as an apllication may use other patterns at the same time as MVC.
The view and the controller are closely coupled wich makes modification to one affect the other.
Changes to the model interface will necessitate changes to the controller and the view.
When the model is active frequent changes to model can result in excessive updates of the corresponding views.

11. Discuss the need for very specific type of communication technologies/techniques for the distributed/web-based systems 
Interactions and communications
Fundamentals
Remote Procedure Call
Message-oriented Communication
12. Compare and contrast RPC with RMI 
RPC vs RMI

RPC (Remote Procedure Call) and RMI (Remote Method Invocation) are two mechanisms that allow the user to invoke or call processes that will run on a different computer from the one the user is using. The main difference between the two is the approach or paradigm used. RMI uses an object oriented paradigm where the user needs to know the object and the method of the object he needs to invoke. In comparison, RPC isn’t object oriented and doesn’t deal with objects. Rather, it calls specific subroutines that are already established.

RPC is a relatively old protocol that is based on the C language, thus inheriting its paradigm. With RPC, you get a procedure call that looks pretty much like a local call. RPC handles the complexities involved with passing the call from the local to the remote computer. RMI does the very same thing; handling the complexities of passing along the invocation from the local to the remote computer. But instead of passing a procedural call, RMI passes a reference to the object and the method that is being called. RMI was developed by Java and uses its virtual machine. Its use is therefore exclusive to Java applications for calling methods on remote computers.

Summary:

1.RMI is object oriented while RPC isn’t
2.RPC is C bases while RMI is Java only
3.RMI invokes methods while RPC invokes functions
4.RPC is antiquated while RMI is the future
13. Explain the need for CORBA, indicating it’s use in web-based systems 
The Common Object Request Broker Architecture (CORBA) is a standard developed by the Object Management Group (OMG) to provide interoperability among distributed objects. CORBA is the world's leading middleware solution enabling the exchange of information, independent of hardware platforms, programming languages, and operating systems. CORBA is essentially a design specification for an Object Request Broker (ORB), where an ORB provides the mechanism required for distributed objects to communicate with one another, whether locally or on remote devices, written in different languages, or at different locations on a network.

The CORBA Interface Definition Language, or IDL, allows the development of language and location-independent interfaces to distributed objects. Using CORBA, application components can communicate with one another no matter where they are located, or who has designed them. CORBA provides the location transparency to be able to execute these applications.

CORBA is often described as a "software bus" because it is a software-based communications interface through which objects are located and accessed. The illustration below identifies the primary components seen within a CORBA implementation.

14. Discuss the XML specification, highlighting the important sections such as element naming conventions 
XML is a software- and hardware-independent tool for storing and transporting data.

What is XML?
  • XML stands for eXtensible Markup Language
  • XML is a markup language much like HTML
  • XML was designed to store and transport data
  • XML was designed to be self-descriptive
  • XML is a W3C Recommendation
  • XML stands for Extensible Markup Language. It is a text-based markup language derived from Standard Generalized Markup Language (SGML).
XML tags identify the data and are used to store and organize the data, rather than specifying how to display it like HTML tags, which are used to display the data. XML is not going to replace HTML in the near future, but it introduces new possibilities by adopting many successful features of HTML.

There are three important characteristics of XML that make it useful in a variety of systems and solutions 
  • XML is extensible − XML allows you to create your own self-descriptive tags, or language, that suits your application.
  • XML carries the data, does not present it − XML allows you to store the data irrespective of how it will be presented.
  • XML is a public standard − XML was developed by an organization called the World Wide Web Consortium (W3C) and is available as an open standard.
  • XML Usage
  • A short list of XML usage says it all −
  • XML can work behind the scene to simplify the creation of HTML documents for large web sites.
  • XML can be used to exchange the information between organizations and systems.
  • XML can be used for offloading and reloading of databases.
  • XML can be used to store and arrange the data, which can customize your data handling needs.
  • XML can easily be merged with style sheets to create almost any desired output.
  • Virtually, any type of data can be expressed as an XML document.s
15. Compare and contrast XML and JSON, indicating the pros and cons of both 

JSON (JavaScript Object Notation)

Pro:
  • Simple syntax, which results in less "markup" overhead compared to XML.
  • Easy to use with JavaScript as the markup is a subset of JS object literal notation and has the same basic data types as JavaScript.
  • JSON Schema for description and datatype and structure validation
  • JsonPath for extracting information in deeply nested structures
Con:
  • Simple syntax, only a handful of different data types are supported
  • XML (Extensible markup language) 
Pro:
  • Generalized markup; it is possible to create "dialects" for any kind of purpose
  • XML Schema for datatype, structure validation. Makes it also possible to create new datatypes
  • XSLT for transformation into different output formats
  • XPath/XQuery for extracting information in deeply nested structures
  • built in support for namespaces
Con:
  • Relatively wordy compared to JSON (results in more data for the same amount of information).



16. Identify other data formatting/structuring techniques available for the communication of web-based systems

Communication can vary also depending on the amount of people it involves. Communication on the web can be divided into the following types, involving a different amount of participants at a time:

One to one- one person communicates with somebody else, for example a student sends an A&O e-mail message to his/her trainerOne to many- one person communicates with many others, e.g. a student posts a message in A&O's discussion forumMany to many- many persons communicate with each other, e.g. via videoconferencing

The most relevant tools for communication in the VERT courses you are about to take are the following

Internet e-mail- The regular e-mail can be sent to the instructor or other students e.g. if there is something that needs immediate attention.A&O's mail- This e- mail is dedicated to studying and stays in A&O virtual learning environment.A&O discussion forum- A tool for asynchronous, one-to-many communication for many purposes.





















Comments