At QCon New York 2019, front end Software engineer Thijs Bernolet of Oqton explained some of the challenges in creating front end architectures influenced by machine learning.
As discussed in Bernolet's talk abstract for "Front End Architecture in a World of AI", increasingly humans are no longer the only clients interfacing with your data; machine and AI clients are starting to manipulate data in real time and can create suggestions or influence human behaviour. The talk focused on managing the complexities of dealing with many different clients that are not all human, and presented strategies on how to build a single interface that both humans and AI clients can leverage.
Looking back to Eternal moonwalk, a Michael Jackson fansite created in 2009 by Bernolet and his team that features a continuous video montage of fans moonwalking, he remarked that in 2009 it was not possible to easily manage, tag, and edit the uploading of 15,000 videos in three days. But in today's world of machine learning, there are many possibilities and challenges.
According to Bernolet, the primary challenge with machine learning influencing the user interface is the sharing of state between UI code and machine learning logic, overlapping with data models representing users. Foundations of a sound user interface logic typically rely on principles of loose coupling and high cohesion. Machine learning agents tend to impact infrastructure, data models, and business logic, breaking the UI foundational paradigms.
Bernolet explains that traditional UI models such as MVC degrade due to the introduction of tight coupling between the model and view layers. His team started investigating Redux and asked the question if Redux could also be used by machine learning agents, with action sequences as training actions.
Bernolet demonstrated his proof of concept for a Redux CLI, and he appreciates the Redux ecosystem support for features like undo/redo, time travel, handling of side effects, and Redux devtools.
Bernolet ran into issues in managing distributed state with Redux, including merging states and race conditions. Explorations included operational transforms (OT), and Conflict-free replicated data (CFRD) types. Their team started to consider that management of these challenges might get solved by leveraging git rebase style operations with OT in the browser, which resulted in a git-js proof of concept.
The talk highlights some of the challenges of working with Redux in distributed state systems. Alternatives to Redux that might solve similar challenges could include solutions based on JSON patch, such as @dojo/framework/stores and json-patch-ot.
The combination of Redux and client-side git with OT solves Bernolet and his team's use case for optimizing the manufacturing process through a combination of user and machine learning inputs. And this approach, had it existed ten years earlier, might have simplified the development of Eternal Moonwalk.