Reviewing the 8 classic “fallacies of distributed computing” and how we can avoid them when writing iOS applications.
The fallacies of distributed computing
- The network is reliable.
- Latency is zero.
- Bandwidth is infinite.
- The network is secure.
- Topology doesn’t change.
- There is one administrator.
- Transport cost is zero.
- The network is homogeneous.
Fallacy #3: “bandwidth is infinite”.
Bandwidth is not unlimited and it is not free, this has implications beyond “downloading lots of data takes longer”.
- Apps over 20MB cannot be downloaded over cellular networks: see the App store approval guidelines.
If your app delivers video over cellular networks, and the video exceeds either 10 minutes duration or 5 MB of data in a five minute period, you are required to use HTTP Live Streaming. (Progressive download may be used for smaller clips.)
If your app uses HTTP Live Streaming over cellular networks, you are required to provide at least one stream at 64 Kbps or lower bandwidth (the low-bandwidth stream may be audio-only or audio with a still image).
From the Streaming Media Guide.
Audio streaming content over a cellular network may not use more than 5MB over 5 minutes
From the App store approval guidelines.
Many users do not have unlimited data plans so your app’s total bandwidth use while on a mobile network may be a concern.
Since the network is not reliable large requests, which take longer to complete, are sometimes going to fail as a network connection is interrupted. If your app cannot resume those connections you risk always transferring the first 80% of the data, losing the connection, and starting again from the beginning.
Users are also unreliable; they will close or background the app while you are trying to transfer data for them.
I use Charles to throttle network bandwith to test apps using low bandwith connections during development.
The Settings app provides an easy tool for measuring cellular bandwidth use if your app behaves differently while using the WWAN; look in Settings -> General -> Usage.