One of the important things about the Agentic Distributed App model, as I've already said in a separate blog post, is that we need an application model that just anyone can jump in and create programs that span the gap between multiple machines. There is, naturally, a lot wrong with merely saying that this is possible, simply leaving it dangling out there with no questions asked nor answered.
After all, when people talk about distributed computing research now, they are talking among other things about problems that would stymie novice programmers: things like memory coherency, race conditions, partition tolerance, reliability, security, and of course system topology. I think it's fair to say that most programmers, to say nothing of new ones, prefer to think about and work with single-threaded logic and not address the various dangers and brain-benders involved in keeping memory synchronized between two independent machines, either of which might create a sudden shift in the status quo.
While I do have some thoughts about multithreading, and Project MAD's place in that morass, I'd like to start somewhere simpler.
Distributed Single Thread Programs
One of the things that might not be obvious from everything I've said so far, is that the ADA is supposed to among other things empower single-threaded programs that just so happen to be distributed across multiple machines. Even if these machines and the software agents on them are executing code at the same time, it remains important to create applications with centralized logic, where all events pass through a central filter, ensuring that events never conspire to have two parts of the same program working at cross purposes. This is not the only logical model that an ADA application can have, but it is the most reasonable model for many applications to take, or to put it more bluntly, it is the only route many application programmers will ever want to take. Understanding and dealing with parallel operations can get complicated very fast.
If this still seems odd, understand that many Agents under the ADA model are nothing more than handlers for specific resources, translating internal application events to external events and vice versa. If you want to process keyboard inputs, something needs to be waiting for those keyboard input events on the machine that actually receives the event, and perhaps some basic processing can be done there, but the active logic that responds to the event should be a part of the main logic loop, at least under the single-thread model. Likewise, if you are performing GUI operations as part of your program, the functions that actually get placed in a GUI Agent may be little more than batch commands that draw on the screen and handle windowing events. They may have little or no program logic involved; that may mostly happen in a centralized location, most likely the program core.
The ADA is not specifically about making multiple threads cooperating in parallel easy, much less trivial. It is about making sharing of resources across device boundaries easy. It is also about creating an application model that explains how you deploy an application into such a system, with minimal assumptions. It is about handling edge cases like only having disk access in one remote location, while most of the computation and devices used are elsewhere. It is about adding new resources in such a way that others how what you have and how to use it, even if that new resource is wildly different from everything you have so far connected. None of that obliges an application programmer to take classes on networking and distributed systems.
Granted, the ADA is more useful when you are tackling parallel or parallelizable loads. A single threaded app in a distributed system will be slower than the same on a monolithic system, but a massively parallel task can use the ADA model to natively farm out tasks to any and all processors within a system (or just to some of them) in order to make use of spare capacity that might otherwise be unused. And while it would be unkind to suggest that the ADA simply will have a load balancer built in for parallel loads, it unquestionably has everything you might need to make a good load balancer. Metrics like system load are important to consider when determining where you will deploy new agents, or which agents to deploy a workload to, and the ADA shall be able to dynamically add and remove agents anywhere in the system. Thus, for things like supercompute workloads and web service load balancing, the ADA should give you everything you need for an ideal solution, whether that ideal solution comes built in or not.
It should be emphasized that this comes without needing to design and build custom hardware. Many data center companies invest heavily in computers designed to pack as much computing power and/or storage into as small a chassis as possible, and while that remains a possibility, the MAD computing paradigm will let you create a machine that has the same capability as one of these advanced systems out of spare parts. Where space or efficiency is critical, it still behooves one to invest in specialty hardware, but it sure would be nice to know that wasn't the only good option.
The App Streaming Model (For All Applications)
It's also worth noting that there are present-day use cases for the MAD paradigm that have little to do with parallel loads. One, for example, is the game streaming model that several games companies have attempted, and to some extent succeeded at, in the past decade or so. It is sometimes very inconvenient to have multiple game consoles tied to your television, or to only be able to play PC games while sitting at your computer. The standard application model we all grew up with had no solution to this problem, and so several companies developed edge-case solutions to attempt to fill the gap. Some, such as Google Stadia, collapsed relatively quickly, while others, such as the game streaming engine built into Valve's Steam platform, have continued.
Likewise, mobile app platforms have attempted over the years to design a “streaming app model” that doesn't require mobile applications to be installed, while still having all of the same benefits to the user. This is designed mostly to remove the need for web apps, which are far from an ideal way to design and distribute applications. Web apps persist even today because they are a model that is completely understood and completely under the programmers' control. Web apps don't need much special training to create if you already have web programmers, and can flexibly handle different mobile operating systems and even desktops - but they are more limited than native apps. At the same time, from a user's perspective, it's nice not to need applications persistently installed on your phone, especially if they insist on taking up background compute resources, need constant updates, or like sending you unwanted notifications. It's nice to simply run an app without giving anything up to the people who created that app, and without going through a store and tedious install process.
And I'd be remiss not to mention interactive video peripherals such as car entertainment displays, or like Chromecast. In a way, these solutions prove the fundamental premise of Project MAD: once you get used to the idea of simply connecting your phone to a thing, it becomes difficult to understand why this has been difficult for so many years. Of course you can trivially stream video from a phone to a TV; of course you can use your phone's navigation in your car. The problem isn't complicated, and the moment these technologies appeared, we wondered why it took so long for them to arrive.
But each of these solutions is a step to the side. They are specific-case solutions to the general problem: Input, Output, and Processing are on different machines, but they are all part of the same application. Trying to take one of these existing, specific-case solutions and turn it into a general-case solution will not work well, because the assumptions do not transfer. Certainly, for the examples I've listed, you can understand that really only input, output, and processing are involved, but for example: where are your files stored? In most cases, they are stored where you do the processing, but what happens when that isn't true? For Chromecast, for instance, the dongle that attaches to your TV doesn't always stream from your phone; it may stream from the original source (Youtube, etc) and bypass your phone completely, which is good, but if you need to store preferences, that will end up being done on your phone, not the dongle nor in the cloud. (Of course, the cloud service will automatically update your history in most cases, so there is storage there, too)
So now, the model must account for input, output, processing, storage, and media source. That growing list only serve to change the question: what have we not thought of yet? What else might be a resource that we need to deal with? How do we deal with all of these existing devices, and how will we deal with any new ones? Do they each need special consideration? In which ways will we need to alter the fundamental model to incorporate each?
And that is the core advantage of a general case solution: the model doesn't change as you add new resources. You don't need to treat adding remote inputs differently from adding remote outputs. You don't need to treat adding writable storage different from adding media sources. Each Agent that you add improves the capabilities of the Application, but that doesn't complicate the model. The ADA handles game streaming, app streaming, chromecast, car displays, home media libraries, and many other edge cases with the same fundamental underlying model. Products that were headline news when they first appeared become obvious applications of the underlying technology.
Similarly, the Internet of Things device paradigm has been waiting for a model where either software on your network takes charge of the peripherals, or the peripherals can seamlessly install a service or application on a piece of hardware you control, which you can then use to control it. The former describes the ADA in general, while the latter is similar to app streaming. In either case, software must bridge the gap between devices; the question is whether the user brings their own software (which controls the devices via ADA agents) or whether the devices supply it (your phone acts as an ADA server and runs an app stored on the IOT device). As a bonus, the ADA as a framework would suggest that IOT devices with their own control apps could be controlled by ‘thin clients’ consisting of nothing more than an interface, such as a wall-mounted display. If you already have an interactive display with a wireless interface, perhaps on your thermostat, refrigerator, toaster, washing machine, oven, shower, water bottle, toothbrush, hair brush, stuffed animal, or sex toy, that display could control your other IOT devices in exactly the same way that your phone or computer could. This, too, has nothing to do with parallel computation; it only has to do with connecting devices.
Granted, I am being perhaps a touch sensationalist, but only because it is frustratingly difficult to do things that should be easy. Without the perspective of MAD/ADA, I can agree, the problems look tangled and difficult. Every addition to the model is something new, and each might add some new complication. And as I've said multiple times, if my solutions turn out to be inadequate, I still believe that finding a general-case solution to the problems created by something like Project MAD will have most if not all of the benefits above.
One way or another, I hope for a future where we can just do fun things with our devices.
No comments:
Post a Comment