Introduction to Distributed development

Source: Internet
Author: User
Tags soap web services
Introduction to Distributed development 1 Overview

A distributed application is one in which applications are distributed across different computers, working together through a network to accomplish a task, typically the server/client model. Broader understanding of "distribution", not just applications, but also databases, etc., distributed on different computers, complete the same task. There are two main purposes for distributing an application across different computers:

1) Decentralized server pressure

Large-scale system, many modules, a large number of concurrent, using only one server load will often occur when the pressure is too large and cause system paralysis. You can split them both horizontally and vertically to deploy these modules to different servers. The pressure on the entire system is distributed to different servers.

L Transverse: divide by function.

L Portrait: N-tier architecture, where some of the layers are distributed to different servers (the concept of layering is described later in this article).

2 provide service, function reuse

Using services for functional reuse is more advanced than using components for code reuse. For example, if the three modules in a system need to use the report function, one method is to make the report function into a separate component, then let three modules all reference this component, the computation operation is carried out by three modules respectively, another way is to make the report function as a separate service, Let these three modules use this service directly to obtain data, all computing operations are performed in one place, it is obvious that the latter scheme is much better than the former.

The service is not only available internally but also externally, and if other partners need to use our Reporting Services, we do not want to expose all the information directly to them. In this case, the component approach is not very reasonable, through the public service and the user of the service to do authorization and validation, then we can ensure that partners can get the data they need, but also to ensure that the core data is not disclosed. 2 Architecture

Distributed system architecture, mainly from the following aspects: tiered, service-oriented and distributed database. 2.1 Layered Model

Generally, we divide the application functionality into three aspects, corresponding to the 3-tier schema pattern. They are the data tier, the middle tier (business logic layer), and the presentation layer, as shown in the following illustration.

1 Data layer: Store the data and get the more original data from the database.

2 business Logic Layer: between the data layer and the presentation layer, responsible for processing data from the data store or sent to the data store, transforming the data into a meaningful information that conforms to the business rules.

3) Presentation layer: Obtain information from the business logic layer and display it to the user, responsible for interacting with the user.

Three-tier architecture mode, separating the business logic from the data storage and carrying it separately with separate servers, is advantageous to the pressure of the decentralized system. The advantages are as follows:

1 because clients do not contain business logic, they become more concise. This makes deployment and maintenance easier, because updating the business logic requires only the operation of the application server.

2 The client is separated from the database details. The application server works together with several different data sources, distributed across database servers, and the distributed database systems are described below, and provides only a single point of access to the client.

3 If the design is correct, the business logic can be distributed to several load-balanced application servers. If the user needs increase, more servers can be added to meet the requirements. At the same time, the business logic can be published as a service for client applications or other services to be invoked, and built into a service-oriented system architecture. 2.2 Service-oriented

A car rental company decided to create a new application for car bookings. The creator of the rental car reservation application knows that the business logic that the application implements must be accessible to other software running inside and outside the company. As a result, they decided to create the application in a service-oriented manner and expose the logic of the application to other software by defining a well-defined set of services.

To implement these services and to communicate with other software, this new application will use the. Net Framework's distributed computing technology, mainly:

1) asp.net Web services

It uses SOAP interaction information, Cross-platform, Cross-language, and most platforms currently support basic WEB services, so this is the most straightforward way to achieve cross vendor interoperability before WCF releases. Generally used in the B/s structure of the system, the need for IIS to start.

The following illustration shows the scenario of a client consuming Web service. A client can be a Web application, another Web service, and so on.
   
The consumer of a Web service invokes a method on a Web service named methods (). The actual call to the downward layer propagates as a SOAP message over the network and propagates to the top of the Web service. The Web service executes and responds (if any). It is possible to implement a two-way notification or publish/subscribe function between a Web service and a client, but it must be done manually. The client can implement its own web service and pass a reference to the Web service in a call to the server. The server can save the reference and then callback to the client.

2). NET Remoting

Designed specifically for tightly coupled. NET to. NET communications, it provides a seamless and straightforward development experience for applications on the local network. Generally used in the C/s structure of the system, need to use a WinForm or Windows services to start.

3 Microsoft Message Queuing (MSMQ)

Provides durable, stable messaging, which is often the best solution for intermittent-connected applications. These applications require guarantees for data transfer, workload separation, and application lifetime.

4 WCF Service

WCF is a unified architecture for building and running service-oriented applications using managed code, and is a platform for developers to build a cross-platform (can communicate with applications running on the Java EE Server, non-Windows systems), secure, trustworthy, transactional solutions that are compatible with existing distributed systems. It is a synthesizer of Microsoft's distributed application development, integrating all the technologies related to distributed systems under the. Net Platform.

In terms of communication, WCF can cross processes (communication between different applications on the same machine), cross subnets, enterprise networks (communication between different machines within a local area network), and even the Internet (communication between different machines in the Internet). From the host program, it can be Asp.net,exe, WPF (Windows Presentation Foundation), Windows Forms, NT Service, COM +. 2.3 Distributed Database System

Distributed database system consists of several database systems distributed in several computer nodes, which provides an effective access means to manipulate the sub databases on these nodes. A distributed database can be used as a complete database, but in fact it is distributed across geographically dispersed nodes. Distributed database system is suitable for decentralized departments, allowing each department to store its commonly used data locally, implement local storage, and thus improve response speed and reduce communication costs. It has the following advantages:

1 solve the problem that the organization is dispersed and the data need to be interconnected. For example, the banking system, the headquarters and branches in different cities or cities in various regions, in business they need to process their own data, but also need to exchange and deal with each other, which requires a distributed system.

2) Balanced load. The load is shared among the processors, and the critical bottleneck can be avoided.

3) High reliability. The data are distributed in different venues and there are multiple copies, even if the individual sites fail to cause the entire system to be paralyzed.

4 Extensibility is good. When new, relatively autonomous organizational units need to be added, they can be augmented with minimal impact on the current institution.

5 Improve system Performance system. Can be based on distance from the user to select the most recent copy of the data to operate, reduce the cost of communication, improve the performance of the entire system.

Although distributed database system has many advantages, it also brings a lot of new problems. Such as: Data consistency problem, update synchronization and query decomposition, such as complexity, data remote transmission implementation, communication cost reduction, etc., this makes the development of distributed database system becomes more complicated. 3 Summary

The development of distributed application, to layered applications, the independent of each other, through the service or interface to make calls, not only facilitate the development of management, but also facilitate the integration of other platform applications, the implementation of functional modules reuse, and improve the application of scalability. In the case of a lot of business data, we should also consider building a distributed database system, which can realize data synchronization by DBMS data subscription and distribution technology, so as to achieve the goal of data sharing, and also can be combined with some distributed computing technologies, such as. NET Remoting technology to solve the communication problems between the databases, and so on.

For large web site applications, distributed deployment strategies can be considered in the following ways:

1 The proxy server implements the separation of requests.

2 cache distributed deployment to improve system performance.

3 split the external functions of the site, such as different domain names before, suffix, URL rewrite.

4 service-oriented, each service is distributed to a single server.

5 distributed cluster deployment of database.

6) Set up a dedicated application server. such as the service of sending mail notification.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.