Friday, March 8, 2019

Distributed System



A distributed system is the collection of autonomous computers that are connected using a communication network and they communicate with each other by passing messages. The different processors have their own local memory. They use a distribution middleware. They help in sharing different resources and capabilities to provide users with a single and integrated coherent network.
Distributed computing is a field of computer science that studies distributed systems and the computer program that runs in a distributed system is called a distributed program.
A distributed system requires concurrent Components, communication network and a synchronization mechanism. A distributed system allows resource sharing, including software by systems connected to the network.
Examples of distributed systems / applications of distributed computing
·       Intranets, Internet, WWW, email.
·       Telecommunication networks: Telephone networks and Cellular networks.
·       Network of branch office computers -Information system to handle automatic processing of orders,
·       Real-time process control: Aircraft control systems,
·       Electronic banking,
·       Airline reservation systems,
·       Sensor networks,
·       Mobile and Pervasive Computing systems.

 Eelements of distributed systems
 •Processing components
•Data networksfor components to communicate
•Including the components who are dedicated for processing the communication, called connectors
•Data stores (data bases) and Data
•Theconfiguration of the above elements

Browser-based(WebApp): (Browser as an interface.).Noting installed on client machine, when we hit a server all resources(client View and data ) are loaded on request.A web application is hosted in a browser-controlled environment. A web application uses multi-tier architecture which consists of; user client, middle tier, and application server.
Example : accessing a website(e.g amazon ,facbooketc) from web browser.
non-browser-based(Client/Server Application): (A software installed on client machine acting as user-Interface and interact with that specific server). Clientside resources are already available as software package on client side.Interaction with server is only to fetch data.
Example: (skype desktop,GTAV -onlinemode, or any other software)installed on a system, which interacts with the server.
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

Monolithic Architecture
A monolithic application has single code base with multiple modules. Modules are divided as either for business features or technical features. It has single build system which build entire application. It also has single executable or deployable binary.
Microservice Architecture
A microservices architecture consists of a collection of small, autonomous services. Each service is self-contained and should implement a single business capability.
The benefits of monolithic application are:
·        Easy to develop as it has the big variety of available tools that are ready to be integrated into apps. It is simple to deploy because all actions are performed with one directory at once.
·        Fast to develop as all of these Rails tools require minimum effort to be applied. It means that you don’t need to think how all works in tools like ActiveJob, ActionMailer or ActionCable.
Simplicity is one of the major advantages. Due to the simple structure of the monolithic architecture, there is no need to perform many complicated operations and extra activities that are required for complex systems.
limitations of Monolithic Applications
Simplicity is good but there are cases when it is not enough to be completely happy with the process of app development and its results. Let’s review the drawbacks of monolithic software:
·        With every new approach integrated into your app, you have more and more dependencies on external libraries. Your codebase becomes large. This makes the workflow more difficult. What is more important, all of your machines become more wasteful in terms of power and money. And if your monolithic application becomes unsupported, you don’t have many options except starting a new app from scratch or decomposing current app into microservices.
·        Every Rails tool works following the principle of a black box. It’s the characteristics not only of Rails, but of any external library. It doesn’t bother you until your task is simple and Rails can take care of it. If the task is complicated, it will be hard to monkey patch the use of the tool according to your needs and keep it synchronized with its source. Additionally, all these out-of-box tools are made to cover all possible use cases, that you may not need but have no choice to cut out.

 MVC style, indicating the limitations of it in the context of web-based systems
MVC stands for Modelviewcontroller. It is a software architectural pattern for implementing user interfaces on computers. It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user.
Components of MVC
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.
Disadvantages of MVC
·       Increased complexity
·       Inefficiency of data access in view
·       Difficulty of using MVC with modern user interface.
·       Need multiple programmers
·       Knowledge on multiple technologies is required.
·       Developer have knowledge of client side code and html code.
RPC and RMI are the mechanisms which enable a client to invoke the procedure or method from the server through establishing communication between client and server. The common difference between RPC and RMI is that RPC only supports procedural programming whereas RMI supports object-oriented programming.
RPC  -Remote Procedure Call is a programming language feature devised for the distributed computing and based on semantics of local procedure calls. It is the most common forms of remote service and was designed as a way to abstract the procedure call mechanism to use between systems connected through a network. It is similar to IPC mechanism where the operating system allows the processes to manage shared data and deal with an environment where different processes are executing on separate systems and necessarily require message-based communication.
RMI - Remote Method Invocation (RMI) is similar to RPC but is language specific and a feature of java. A thread is permitted to call the method on a remote object. To maintain the transparency on the client and server side, it implements remote object using stubs and skeletons. The stub resides with the client and for the remote object it behaves as a proxy.
Key Differences Between RPC and RMI
1.     RPC supports procedural programming paradigms thus is C based, while RMI supports object-oriented programming paradigms and is java based.
2.     The parameters passed to remote procedures in RPC are the ordinary data structures. On the contrary, RMI transits objects as a parameter to the remote method.
3.     RPC can be considered as the older version of RMI, and it is used in the programming languages that support procedural programming, and it can only use pass by value method. As against, RMI facility is devised based on modern programming approach, which could use pass by value or reference. Another advantage of RMI is that the parameters passed by reference can be changed.
4.     RPC protocol generates more overheads than RMI.
5.     The parameters passed in RPC must be “in-out” which means that the value passed to the procedure and the output value must have the same datatypes. In contrast, there is no compulsion of passing “in-out” parameters in RMI.
6.     In RPC, references could not be probable because the two processes have the distinct address space, but it is possible in case of RMI.
Both RPC and RMI serves the same purpose but are used in languages support different programming paradigms, therefore have distinct features.

 XML and JSON, indicating the pros and cons of both
Comparison between JSON and XML
·       Simplicity: XML is simpler than SGML, but JSON is much simpler than XML. JSON has a much smaller grammar and maps more directly onto the data structures used in modern programming languages.
·       Extensibility: JSON is not extensible because it does not need to be. JSON is not a document markup language, so it is not necessary to define new tags or attributes to represent data in it.
·       Interoperability: JSON has the same interoperability potential as XML.
·       Openness: JSON is at least as open as XML, perhaps more so because it is not in the center of corporate/political standardization struggles.

JSON
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
·       Json Path for extracting information in deeply nested structures
Con:
·       Simple syntax, only a handful of different data types are supported.
XML
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



No comments:

Post a Comment