iPhone Distributed Computing Fallacy #8: the network is homogeneous

Jonah Williams ·

Reviewing the 8 classic “fallacies of distributed computing” and how we can avoid them when writing iOS applications.

The fallacies of distributed computing

  1. The network is reliable.
  2. Latency is zero.
  3. Bandwidth is infinite.
  4. The network is secure.
  5. Topology doesn’t change.
  6. There is one administrator.
  7. Transport cost is zero.
  8. The network is homogeneous.

Fallacy #8: “the network is homogeneous”.

Mobile devices are something of an exception compared to web development; it is possible for an app to have a largely homogeneous network of users. Unfortunately assuming that the network is homogeneous still leads to problems on several levels.

Similarly to fallacy #6 not all networks will have the same configuration. For example some wifi networks will allow peer to peer communication between devices and some will not. Allowing a mobile app to communicate with other devices (ie synch with a desktop app) can therefore be difficult even if both are on the same network. TN2152 “Document Transfer Strategies” has an excellent overview of several techniques for communicating between devices or with remote services.

A web service might initially be designed for use only by iOS apps but it would be nice if adding apps for other device families later was not unnecessarily difficult. The service may therefore need to serve multiple data formats so its clients can choose to receive content as xml, json, or whatever they can easily parse. Binary and proprietary data formats may be difficult to parse on multiple devices.
For services based around a central server this shouldn’t be a serious problem as the server can serve content in each client’s preferred format and translate between them. For applications with direct peer to peer communication (ie using GameKit) connecting an iOS app to an Android app, or just handling clients using multiple versions of the same app, is more difficult.