Somewhere in 2011 I started to use Knockout by Steve Sanderson – a JavaScript library that eventually became a de-facto standard "backbone" for your view models in SPAs running on Microsoft web stack. The computed observable abstraction it offers provides an astonishingly convenient way of describing how certain parts of the model change in response to changes made to other parts.
In 2012 I joined Quora and learned it's built on the company's own web framework with its own gemstone: quora.com updates the content all of its users see in real-time. When someone upvotes an answer or writes a comment, other users instantly see the change without refreshing the page, and this applies to every piece of content! It is 2012, and as far as I remember, none of the top websites was capable of something remotely similar to this — in short, this was quite unusual, and the problem was looking really hard to tackle at such a scale. You can learn more about the underlying technology in Shreyes Seshasai's Tech Talk @ Stanford from May 2011: "webnode2 and LiveNode", but overall, Quora used (and AFAIK, still uses) an abstraction allowing its UI components to capture and track the dependencies on data and re-render themselves on server-side once these dependencies change.
My thoughts at that point were nearly the following:
- Steve Sanderson's Knockout is an amazing technology recomputing parts of your view model once their dependencies change. Unfortunately, it works only on the client.
- Quora's LiveNode + webNode2 is another incredible technology solving a very similar problem on the server-side. Moreover, Quora.com is a live proof you can rely on such dependency tracking and successfully scale to 300M+ monthly active users.
- So... Can we write a library that works both on the server-side and the client-side enabling developers not just to use the same abstractions everywhere, but also to propagate the state changes in any direction relying on shared models and APIs? And can we make these abstractions truly transparent?
It took a while to get back to this problem — my first few years at ServiceTitan were absolutely terrific, but also quite intense in terms of the workload. 2020 was the first year I've got a chance to write a fair amount of code; besides that, a few other things happened over these years:
- React (I love it from the day one) took #1 spot among web UI frameworks
- Knockout got a strong competitor: MobX, which does the same, but almost transparently. A very similar "computed observable" abstraction was implemented in many other UI libraries – e.g. Vue.js uses it as well.
- I realized the problem with dependency tracking is deeply connected with caching and eventual consistency. You can read about this further, but overall, the further you scale, the more it becomes desirable for you to have a technology that invalidates cached data as quickly as possible after the moment it becomes inconsistent with the ground truth.
- And finally, Blazor made it possible to run .NET code in browser / WebAssembly - and in particular, enable server-side and client-side code to use shared .NET assemblies. FYI Blazor is also created by Steve Sanderson - yes, the same person who long time ago created Knockout!
So the demand for such a library was still there, and moreover, all the tools needed to build it became available.
The only missing piece was Fusion itself.