Your Web Client is Part of a Distributed System

Nate Eborn
2 min readSep 21, 2017

I apologize in advance for any misuse of distributed system terminology or misapplication or misrepresentation of distributed system principles. Please call me out on my mistakes.

With that out of the way, to reiterate the title, your web client is part of a distributed system. The following are several things to keep in mind about the role your web client plays in that distributed system.

Caching

Web clients are hanging on to more data for longer. As browsers and operating systems provide more means for web clients to persist data, web clients are becoming more responsible for managing caching of that data.

With single-page applications, as the length of time between page refreshes increases even caching of in-memory data is important to consider.

Consistency

Distributed data stores have to reconcile potentially conflicting updates from multiple concurrent clients and other nodes. Web clients deal with a microcosm of the distributed store, needing to reconcile virtually concurrent updates generally from two sources: the server and the user.

Another aspect of a client’s role in aiding consistency is how it communicates updates to the server.

Hopefully the server provides means for specific, well defined updates. Then the client can be targeted and deliberate; i.e. requesting updates for only specific, user-updated fields rather than an entire record.

Also, clients are often working with aggregate, object based representations of data rather than the granular tuples (records) one finds in a data store. While these complex representations likely simplify client logic and reduce network requests, they can be cumbersome and obtuse for communicating updates.

For example, if a relationship between records is modeled using an array, rather than overriding the entire array with each update, it is likely more correct to make a targeted request to add and/or remove only specific records from the relationship.

Atomicity

As it becomes easier to have web clients do more, occasionally it’s healthy to take a step back and ask if they should.

http://i0.kym-cdn.com/photos/images/original/000/877/596/f66.jpg

Sure a web client can handle multi-step updates, coordinate requests to multiple endpoints, and attempt to rollback in case of failure. But in context of a distributed system, the client is most prone to hardware and network failures not to mention the whims of the user.

In Conclusion

Sorry for not providing more concrete examples or references. Mostly I am hoping that committing some of the thoughts that literally keep me up at night (it’s 12:26 AM) to writing will provide some reprieve.

Happy to engage in a conversation if there is any particular point about which you have thoughts or questions.

--

--