Ubiquitous connectivity and duplex applications

Pretty soon we will all be connected to the internet all the time. Satellites will fill in the last remaining dead zones. Cheap ubiquitous connectivity is going to break many assumptions of the software industry. Afterwards it will appear to have been inevitable.

Currently the main business model of software is Software-as-a-Service (SaaS), where applications are delivered via the web browser from proprietary servers. SaaS typically offers a “freemium” option that is easily adopted but limited in features in order to funnel heavy users into subscribing to premium levels of service. Revenue in the SaaS model comes from subscriptions as well as placing ads and selling usage data. One problem with SaaS is that the users lose ownership of their data, which may leak or disappear or be censored outside of their control.

Ubiquitous connectivity will change the rules of the game, because for the first time it will be possible for all devices to be servers. Even hand-held mobile devices can act as servers once they are always connected. This means that applications no longer need to be broken into clients and servers. Instead applications running on user devices can be both clients and servers to other instances of the application running on other devices of other users. We call such applications duplex. Let’s sketch this out a bit.

Assume that the application operates on discrete “documents”. Word processors and spreadsheets and drawing apps all use documents, and nowadays they are all multiplayer. Slack workspaces and Discord servers could also be seen as multiplayer documents. The freemium tier of a duplex app is that each document is owned by a single end-user device. The app running on that devices serves the document to all authorized users (as well as the owner’s other devices). This only becomes possible with ubiquitous connectivity.

You may immediately object: what if the owning device is a phone? The other users will certainly experience worse latency than a massively provisioned CDN edge server. They will also drain the hosting phone’s battery. Those are definitely engineering challenges, but we believe they are not fundamental objections. Software performance problems have historically succumbed to incented engineers and the inexorable advance of hardware. But hey, what do you expect for free anyway? As long as it works tolerably well, there are many benefits. Not only is it free, but you own your data, and only reveal if to those you authorize. Your data never appears in cleartext outside authorized devices. There are no ads, no surveillance, and no censorship.

Every document in a duplex app is owned by a single device. Ownership can be transferred at any time to any authorized device, and this can be done on the fly without disrupting operation. For example documents could be transferred from a phone to a desktop machine with a better connection and more power. Documents could also be handed off to someone else’s devices. The premium level of duplex apps is to hand off your documents to a paid service that provides service level guarantees for latency and uptime. Paying for document hosting might compromise on security: one must trust the service to keep your data secure (though perhaps it could remain partially encrypted). However you don’t need to worry about losing your data, because it will be cached on your devices, and ownership can be revoked at any time.

Duplex apps are compatible with open source, and may indeed benefit from it. Since a fully functioning app is running on the user’s device it will probably be subject to reverse engineering anyway. It is probably best not to impose functionality limits on the freemium mode so as to not incent cracking. The only cost of freemium should be the performance constraints imposed by hardware and the network. There is indeed a risk that going open source would make it easier for competitors to clone and underprice the paid service. Perhaps content discovery should be restricted to the paid service to leverage network effects.

The ultimate network effect would be to build a general purpose platform for indie application developers to deliver duplex apps. Providing both SQL and JSON for document storage ought to handle many application needs. A possible strategy is to offer application developers a generous share of service revenue, which unlike app stores provides a recurring revenue stream. A nice touch for building good will would be to grant a small slice (1%?) of revenue to needy open source projects used in the service. But to get to a general purpose platform it may be necessary to first deliver a “killer app” that validates the approach. One suggestion: a replacement for Discord that is totally private and uncensored. Also please design it for intermittent usage by those not terminally online, like the old 90’s BBS/Forums.

How is duplex different from peer-to-peer and local-first?

Peer-to-peer applications work without any central server using sophisticated protocols that operate asynchronously, tolerating network partitioning and message reordering. The local-first movement advocates building peer-to-peer applications with CRDTs. But all peer-to-peer applications face a harsh reality: decentralized coordination is one of the fundamentally hard problems of computer science. It is necessary to compromise on the kinds of data and the levels of consistency that can be supported. Application developers must learn about these constraints and work around them. That did not work out well for NoSQL databases, where abandoning transactional consistency caused much pain.

Ubiquitous connectivity means that the goals of local-first software can be achieved without CRDTs. We can have centralized coordination without centralized servers. Everything is so much easier with centralized coordination. We can use standard transactional serialization if we want. We can also use a wider variety of asynchronous protocols. For example Google Docs and Figma rely on centralized coordination, and so could be reproduced in a duplex app with the additional benefit of transferable document ownership.

Another advantage of duplex over peer-to-peer apps is that it may have a viable business model.

Related work

These ideas germinated at the Programming Local-first Software Workshop and the colocated Ink & Switch Unconference. Notably, Matthew Weidner’s Homeserver proposal sees the need for centralized coordination to synchronize permission changes with updates, as well as for byzantine correctness.

Marijn Haverbeke (ProseMirror) and Aaron Boodman (Reflect) observe the benefits of centralized coordination in collaborative editing and multiplayer gaming respectively.

Helpful comments from reviewers:

  • Michael Toomim: Battery and latency are fundamental and perhaps fatal problems. Edge servers may be needed to meet modern performance expectations.
  • Greg Little: The criticisms of CRDTs can be overcome, making them a clear win over any server-oriented architecture.
  • Christian Tschudin: A different framing is that of documents with agency via fusion of mobile code and data, an approach that was the core of now-dormant work on “mobile agents” architectures in the early 2000. See also Borenstein’s ATOMICMAIL from 1992 and active networking that dates back to 1981 Jens Zander’s SOFTNET packet radio with code-carrying packets. A relevant venue is Workshop on Distributed Infrastructure for Common Good.
  • Mariano Guerra: an additional benefit would be built-in backup. Replicating documents across all your devices would insure against device loss. One could permit replica sharing among friends and family to get off-site backup. Related work: the Solid project — perhaps some of their protocols could be used. Also see Croquet for another kind of duplex architecture.

One Reply to “Ubiquitous connectivity and duplex applications”

  1. I would find the argument of “Cheap ubiquitous connectivity” quite compelling were it not already the case that large and rich parts of the world already live in this environment, and it doesn’t seem like “filling in the last remaining dead zones” via satellites is going to change much about the economics or incentives of the environment.

    This very well may be a case where technical possibility exists far before the social/cultural innovation takes advantage of it, but in that case we should be examining what other existing factors might be holding us back from adoption of duplex architecture.

Comments are closed.