A Note on Distributed Computing

Local computing means programs that are confined to a single address space.

本地計算即只有一個地址空間的程序

Distributed computing means programs that make calls to other address spaces, possibly on another machine. Nothing is known about the recipient of the call other than that it supports a particular interface.

分佈式計算是指會調用其它地址空間的程序,很可能是在其它機器上。調用者只知道一個接口,而關於被調用者的其它信息一無所知

There is an overall vision of distributed OO computing in which there is no essential distinction between objects that share an address space and objects that are on two machines with different architectures located on different continents. Whether local or remote, these systems are defined in terms of a set of interfaces declared in an interface definition language – the implementation is independent of the interface and hidden from other objects.

分佈式面向對象計算有一個全局的視野,不管是共享相同的地址空間的對象還是在不同計算機上的對象,這些對象之間沒有本質的區別。不管是本地的還是遠程的,這些系統都是通過接口定義語言中的一系列接口組成的——接口的實現是相互獨立的,且實現過程對其它對象是隱藏的。

Given the isolation of an object’s implementation from clients of the object, the use of objects for distributed computing seems natural.

通過對用戶隱藏對象的實現細節,分佈式計算中對象的使用似乎很自然。

There is a single paradigm of object use and communication used no matter what the location of the object might be. In actual practice, a local member function call and a cross-continent object invocation are not the same thing.

不管對象的位置在哪,對象的使用和通信都只有一個機制。實際上,本地成員方法調用和跨節點調用不是同一件事情。

First phase of writing an application proceeds with writing the application without worrying about where the objects are located and how their communication is implemented. The developer will simply strive for the natural and correct interface between objects. This approach enforces a desireable separation between the abstract architecture of the application and the need for performance tuning.

分佈式應用的第一個階段是寫一個應用程序,而不用考慮對象的位置以及通信的實現過程。開發者儘量讓對象使用自然且正確的接口。這種對應用架構和性能調優之間的抽象,是一種令人滿意的隔離

The second phase is to tune performance. The right set of interfaces to export to various clients can be chosen.

第二個階段是提高性能。使用合理的接口,以讓不同的用戶使用。

The final phase is to test with “real bullets” (e.g., networks being partitioned, machines going down). Interfaces between objects can be beefed up to deal with these sorts of partial failures introduced by distribution by adding replication, transactions or whatever else is needed.

最後階段是用“真槍實彈”進行測試(比如網絡分割,機器down掉)。在處理這類問題時,對象間接口的功能應該被增強,可以使用副本、事務機制,或者任何需要使用的手段。

A central part of this vision is machines an application is built using OO all the way down, the right “fault points” to insert process or machine boundaries will emerge naturally. One justification for this vision is that there is no impact of the correctness of the program. It makes no difference to the correctness of the program whether the operation is carried out within the same address space, on some other machine, or off-line by some other piece of equipment.

願景的一箇中心部分是一直通過面向對象的方式編程,插入一段處理過程或者機器界限的功能正確的“故障處理點”將會很自然地融合到程序中。這個願景的一個理由是這對程序的正確性沒有影響。不管是在相同的地址空間,或者一些遠程的機器,或者一些其它類型的離線裝備上,這些操作對程序的正確性都沒有影響。

The vision is centered around the following principles:

願景擁有以下幾個中心原則:

  • there is a single natural OO design for a given application, regardless of deployment context;
    不管部署環境如何,對給定的應用程序來說,都有一個給定的自然的面向對象設計方案。
  • failure and performance issues are tied to the implementation of components, and consideration of these can be left out of an initial design; and
    失敗和性能相關的問題被綁定到組件的實現過程中,這些是設計最開始就要考慮的
  • the interface of an object is independent of the context in which that object is used.
    對象的接口獨立於使用環境
    Unfortunately, all of these principles are false!
    不幸的是,這些原則都是錯的

The desire to merge the programming and computational models of local and remote computing is not new.

將本地計算和遠程計算的編程和計算模型融合在一起的需求不是現在纔出現的。

Programming distributed applications is not the same as programming non-distributed applications. Making the communications paradigm the same as the language paradigm is insufficient to make programming distributed programs easier, because communicating between the parts of a distributed application is not the difficult part of that application.

編寫分佈式應用程序和編寫非分佈式應用程序不是一樣的。讓通信機制和語言本身的提供的機制一樣,不會讓分佈式應用程序更簡單,因爲分佈式應用程序不同組件之間的通信不是程序中比較難的部分。

The hard problems in distributed computing concern dealing with partial failure and the lack of a central resource manager, ensuring adequate performance and dealing with problems of concurrency, differences in memory access paradigms between local and distributed entities.

分佈式應用中比較難的部分是要考慮局部失敗、中心資源管理器的缺乏、保證充足的性能、處理併發導致的問題以及本地和分佈式組件之間內存訪問機制的差異。

The often overlooked differences concerning memory access, partial failure, and concurrency are far more difficult to explain away, and differences concerning partial failure and concurrency make unifying the local and remote computing models impossible without making unacceptable compromises.

缺乏對內存訪問、局部失敗、併發性的關注,非常難以解釋。局部失敗和併發相關問題使得如果不作不可接受的妥協的話,編寫本地和遠程統一的計算模型是不可能的

It is the disparity between processor speed and network latency that is often seen as the essential difference between local and distributed computing.

處理器速度和網絡延遲的不同,通常被認爲是本地和分佈式計算的核心區別。

If the only difference between local and distributed object invocations was the difference in the amount of time it took to make the call, one would strive for a future in which the two types of calls would be virtually indistinguishable – rational people would disagree as to the wisdom of this approach.

如果本地調用和分佈式對象調用的唯一不同是要考慮調用時間的不同,有人追求在將來讓這兩種調用實際上是一樣的———理智的人不會認爲這是一種智慧的解決方案。

Pointers in a local address space are not valid in another (remote) address space. Either all memory access must be controlled by the underlying system, or the programmer must be aware of the different types of access – local and remote. Providing distributed shared memory is one way of completely relieving the programmer from worrying about remote memory access.

訪問本地地址空間的指針在另一個(遠程)地址空間是無效的。要麼內存訪問一定會被潛在的系統控制,要麼程序員需要考慮本地和遠程訪問的區別。分佈式共享內存可以讓開發者完全不用擔心遠程內存訪問所引入的問題。

Adding a layer that allows the replacement of all pointers to object references only permits the developer to adopt a unified model of object interaction – it cannot be enforced unless one also removes the ability to get address-space-relative pointers from the language used by the developer. This requires that programmers learn a new style of programming which does not use address-space-relative pointers. One gives up the complete transparency between local and distributed computing.

添加這樣一層來更換指向對象引用的指針,可以讓開發者進行對象交互時使用統一的接口——這是不可能實現的,除非讓開發者不再使用相對地址空間的指針。這需要開發者學會新的編程模型,這種模型不再使用相對地址空間的指針。這種方式將放棄本地編程和分佈式編程的透明度。

It is logically possible that the differences between local and remote memory access could be completely papered over and a single model of both presented to the programmer. When we turn to the problems introduced to distributed computing by partial failure and concurrency, it is not clear that such a unification is even conceptually possible.

將本地和遠程內存訪問的區別隱藏起來邏輯上是完全可以實現的。當我們轉向因局部失敗或併發導致的分佈式計算的問題時,現在還不清楚這樣的統一在概念上是否是可行的。

Partial failure is a central reality of distributed computing. Both the local and the distributed world contain components that are subject to periodic failure. In the case of local computing, such failures are either total or detectable.

局部失敗是分佈式應用的一個核心問題。本地和分佈式計算世界都包含週期性失敗的組件。在本地計算的案例中,這些失敗要麼是完全失敗的,要麼是可以檢測的。

在分佈式計算中,可能一個組件(計算機、交換機)失敗而其他組件正在運行。沒有通用的代理檢測哪個組件失敗並將該失敗通知其他組件,也沒有全局的狀態被用來檢測發生了哪種錯誤。到底是網路失敗還是網絡另一端的進程失敗,是很難檢測的。

Partial failure requires that programs deal with indeterminacy. The interfaces that are used for the communication must be designed in such a way that it is possible for the objects to react in a consistent way to possible partial failures.

局部失敗導致程序對不確定性進行處理。通信用的接口必須被設計成在面對局部失敗時允許對象保持一致的運行方式。

The result of choosing the earlier development phases is the resulting model is essentially indeterministic in the face of partial failure and consequently fragile and non-robust. The price of adopting the model is to require such failures are unhandled and catastrophic.

選擇開發的早期階段的結果,是因爲局部失敗是不確定的,而使得結果模型是不確定的。採用這種模型的代價是允許失敗時不被處理的和災難性的。

Distributed object by their nature must handle concurrent method invocations. Either all objects must bear the weight of concurrency semantics, or all objects must ignore the problem and hope for the best when distributed.

分佈式對象必須處理併發方法調用。要麼所有對象容忍併發機制的代價,要麼在希望分佈式計算帶來最好的一面時忽略分佈式系統面臨的可能問題。

Either the programming model must ignore significant modes of failure or the overall programming model must assume a worst-case complexity model for all objects within the program, making the production of any program, distributed or not, more difficult.

要麼編程模型忽略失敗,要麼爲編程所有的對象設計一套考慮最壞情況的模型,使得不管是不是分佈式編程,任何生產環境的應用都更加複雜。

Robustness is not simply a function of the implementations of the interfaces that make up the system. It is not the sole factor for determining system robustness. Many aspects of robustness can be reflected only at the protocol/interface level.

魯棒性不僅僅是對構成系統的接口的實現過程中的函數。函數不是決定系統魯棒性的基礎因素。很多魯棒性只是反映在了協議/接口層。

Merging the models by attempting to make distributed computing follow the model of local computing requires ignoring the different failure modes and basic indeterminacy inherent in distributed computing, leading to systems that are unreliable and incapable of scaling beyond small groups of machines that are geographically co-located and centrally administered.

讓分佈式計算模型遵循本地計算模型需要忽略不同的失敗模型和繼承自分佈式計算中固有的不確定性,而且這會導致系統不可靠並且不能對物理上在一起且中心化管理的一組計算機進行自由伸縮。

A better approach is to accept there are irreconcilable differences between local and distributed computing, and to be concious of those differences at all stages of the design and implementation of distributed applications.

更好的方式是接受本地計算和分佈式計算的不可能協調的區別。並且在設計和實現分佈式系統的各個階段考慮這些不同。

Programming a distributed application will require thinking about the problem in a different way than before it was thought about when the solution was a non-distributed application. Keeping the difference visible will keep the programmer from forgetting the difference and making mistakes.

編寫分佈式應用程序要求用不同的方式考慮問題,以區別於非分佈式應用。讓這個不同保持可見,將會讓程序員忘記其中的不同並避免出錯。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章