Network Misconceptions in Application Development

Understanding and Addressing Common Misconceptions for Robust Application Performance

Mahdi Shahbazi
Front-end World
4 min readJan 30, 2024

--

Network Misconceptions in Application Development
Generated with AI

Introduction

Network interactions have become an integral component of modern applications. Whether it’s web applications, which are heavily dependent on network connections, or mobile and desktop applications, many of which need internet access to unlock all their features (despite some offering offline modes). These network calls are essentially unavoidable in the contemporary digital arena.

Here we will look at 6 different misconceptions about networks that we can see in applications which can cause different issues.

1. The Network is Reliable:

Indeed, networks are becoming increasingly reliable with each passing day. Nevertheless, they’re not entirely fail-proof yet. You’d still encounter connectivity issues in certain parts of the world where robust internet isn’t readily available. Moreover, the cellular network on mobile devices can prove to be even more sluggish and undependable. Even when dealing with high-speed, low-latency internet, you can still experience failed network calls due to a range of issues such as packet loss, hardware snags, etc.
As such, it is crucial to keep this in mind while devising and crafting your application.

2. Network Latency is Non-Existent:

Contrary to this common belief, a network call isn’t as immediate as a method call; there’s invariably some degree of latency involved with each network call. The more network interactions your app necessitates, the more latency your users are bound to experience. In fact, from my experience, this is one of the principal culprits responsible for poor application performance.

the more latency your users are bound to experience
Generated with AI

3. Network is secure

This assumption can have catastrophic ramifications for certain applications. For instance, consider a scenario where users connect to a free WiFi network at Starbucks, which isn’t the actual Starbucks network. Would your data transmission approach remain the same under these circumstances? And what about when it comes to transmitting sensitive information like credit cards or social security numbers?
As an application creator, you don’t have control over where and how users will use your application. Consequently, the onus falls on you to ensure the security of your network calls.

4. Data Structure Remains Unchanged:

Are you a part of the team that manages server-side code? How much confidence do you place in the external APIs you use? Can you guarantee their updates will be backward compatible? These questions highlight the importance of heeding Postel’s Law (also known as the Robustness Principle), which advises:

Be conservative in what you do, be liberal in what you accept from others.

Originally aimed at network device interaction, this advice underscores the unpredictability inherent in network events. One common issue is receiving empty data for a portion of the response. For instance, specific user surnames being null in user data on the server side can become a significant problem. In statically typed languages, it can trigger exceptions during the unmarshalling process, and unpredictable behavior in dynamically typed languages.

5. Complete Data Receipt While Streaming:

Managing data loss in HTTP calls is comparatively straightforward — you either receive everything or nothing. Therefore, you can prepare to retry or display an error message to the user. However, with streaming, it’s not immediately evident when you’ve lost some data. Detecting such anomalies requires a prepared mechanism. Perhaps the server could send incremented IDs, or a separate HTTP call can be made at the end of the stream. There are a variety of solutions, and the optimal choice is dependent on the specific circumstances.

6. Users Possess Infinite Bandwidth:

The truth is, they don’t — especially when considering mobile applications. Implementing strategies such as providing users with the choice to view different video qualities or loading data only when necessary can prove incredibly beneficial. It is essential to avoid unnecessary downloads/uploads onto the user’s device.

Understanding and Addressing Common Misconceptions for Robust Application Performance
Generated with AI

Conclusion

In conclusion, developing contemporary applications includes a thorough understanding of multiple facets of network interactions. Misperceptions about network reliability, latency, security, constant data structure, complete data receipt in streaming, and user bandwidth can result in significant functional problems. By acknowledging these commonly held yet incorrect assumptions, developers can craft more robust and efficient applications. It ultimately comes down to being proactive instead of reactive — understanding the potential pitfalls, planning for them, and having preventative measures in place to ensure your application operates as desired, regardless of the network challenges it encounters.

Thanks for reading.

--

--