Wednesday, March 6, 2019

Programming Applications and Framework - IT3030

Tutorial 04 – Distributed systems


1.Explain the term “distributed systems”, contrasting it from “distributed computing”
Distributed systems are computer systems where multiple computer systems are working together effectively as a single unit. Examples of distributed systems include content distribution networks used to serve websites and online videos, supercomputers built out of multiple powerful mathematical processors and distributed databases used in many online systems. Distributed systems can be more resilient, more powerful and speedier than single-computer systems, but they can also require more maintenance and careful thought about organization and problems that can go wrong.


Distributed computing is a field of computer science that studies distributed systems. A 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.[1] The components interact with one another in order to achieve a common goal. Three significant characteristics of distributed systems are: concurrency of components, lack of a global clock, and independent failure of components.[1] Examples of distributed systems vary from SOA-based systems to massively multiplayer online games to peer-to-peer applications. 

2. Compare and contrast the standalone systems with distributed systems, providing examples for advantageous use of both           
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.



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.




3. Discuss the elements of distributed systems 

  • Processing components 
  • Data networksfor components to communicate
  • Data stores (data bases) and Data 
  • Theconfiguration of the above elements
  • The components to share the computing resources ,increasing the processing power ,provide better user experience 
  • The users to share data and other resources, such as documents and files 


The engineers to have a centralized control
4. Identify different types of services, which can be gained from distributed systems, specifying the protocols used for them 
  • Mail service SMTP, POP3, IMAP
  • Games and multimedia RTP, SIP,H.26x
  • Web HTTP
  • File transferring and sharing FTP
  • Remote logging (telnet) 
5. Identify examples for both browser-based and non-browser-based clients of distributed systems 
  • The world wide web – information, resource sharing
  • Clusters, Network of workstations
  • Distributed manufacturing system (e.g.,automated assembly line)
  • Network of branch office computers -Information system to handle automatic
  • processing of orders
  • Network of embedded systems
  • New Cell processor (PlayStation 3)
6. Discuss the characteristics of different types of Web-based systems, including the RiWAs
TTs  for  the  Browser-based  Client-Components  of RiWAs

There  are  several  approaches  for  the  browser-based RiWAs, inherited  from RIAs. The  first approach, which is the proprietary plugin based approach, uses the technologies such as Adobe (former Macromedia) Flash/Flex [13], JAVA Applets,  or  MS  Silverlight  [5].  These  technologies  are enriched  with  utensils for  developing desktop  applications like rich GUIs. 


TTs for the  non-browser-based client-components of RiWAs 

The  standard desktop  application development TTs like JAVA  or  .Net  and  related libraries/frameworks  can  be utilized  for  non-browser-based  client-components development. For DC development, these frameworks  may contain  their  own  tools  or  some  third-party frameworks/libraries can be incorporated.  

7. Explain different architectures for distributed systems, explaining special features of each 
Client-Server Architecture
The client-server architecture is the most common distributed system architecture which decomposes the
system into two major subsystems or logical processes −

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.

In this architecture, the application is modelled as a set of services that are provided by servers and a set of clients that use these services. The servers need not know about clients, but the clients must know the identity of servers, and the mapping of processors to processes is not necessarily 1 : 1

Advantages
  • Separation of responsibilities such as user interface presentation and business logic processing.
  • Reusability of server components and potential for concurrency
  • Simplifies the design and the development of distributed applications
  • It makes it easy to migrate or integrate existing applications into a distributed environment.
  • It also makes effective use of resources when a large number of clients are accessing a high-performance server.
Disadvantages
  • Lack of heterogeneous infrastructure to deal with the requirement changes.
  • Security complications.
  • Limited server availability and reliability.
  • Limited testability and scalability.
  • Fat clients with presentation and business logic together.

Multi-Tier Architecture (n-tier Architecture) 

Multi-tier architecture is a client–server architecture in which the functions such as presentation, application processing, and data management are physically separated. By separating an application into tiers, developers obtain the option of changing or adding a specific layer, instead of reworking the entire application. It provides a model by which developers can create flexible and reusable applications.

Advantages


  • Better performance than a thin-client approach and is simpler to manage than a thick-client approach.
  • Enhances the reusability and scalability − as demands increase, extra servers can be added.
  • Provides multi-threading support and also reduces network traffic.
  • Provides maintainability and flexibility

Disadvantages

Unsatisfactory Testability due to lack of testing tools.\

More critical server reliability and availability.

Peer to Peer (P2P)

The general idea behind peer to peer is where there is no central control in a distributed system. The basic idea is that, each node can either be a client or a server at a given time. If the node is requesting something, it can be known as a client, and if some node is providing something, it can be known as a server. In general, each node is referred to as a Peer.
In this network, any new node has to first join the network. After joining in, they can either request a service or provide a service. The initiation phase of a node (Joining of a node), can vary according to implementation of a network. There are two ways in how a new node can get to know, what other nodes are providing.

Centralized Lookup Server - The new node has to register with the centralized look up server an mention the services it will be providing, on the network. So, whenever you want to have a service, you simply have to contact the centralized look up server and it will direct you to the relevant service provider.

Decentralized System - A node desiring for specific services must, broadcast and ask every other node in the network, so that whoever is providing the service will respond.
8. 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 

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.

References
  • https://www.scribd.com/document/239346702/Advantages-and-Disadvantages-of-Using-a-Network-Compared-to-a-Stand-Alone-Computer
  • http://www.itrelease.com/2015/09/what-are-advantages-and-disadvantages-of-distributed-operating-systems/
  • https://blog.codeship.com/monolithic-core-vs-fully-microservice-architecture/
  • https://medium.com/koderlabs/introduction-to-monolithic-architecture-and-microservices-architecture-b211a5955c63

No comments:

Post a Comment