JavaScript is used by millions of developers. As the only native language supported by web browsers, it is the dominant language for web development. Thanks to high-performance runtimes such as node.js, JS is also used more and more to write application servers or network services. Unlike any major programming language in wide use today, JavaScript is the only language whose major runtimes are all fundamentally event-driven. Web browsers are driven by user interaction and page events. Application servers are driven by incoming network requests.
This event-driven nature of the runtime presents an opportunity for persistent memory abstractions to be introduced virtually transparently into any JavaScript program: every turn of the event loop is essentially a micro-transaction, taking the application from one valid state to the next. In between every event, the call stack is guaranteed to be completely empty, which makes for an ideal moment to checkpoint the application: just persist all the dirty memory in the heap.
V8Ken was an early attempt at reconciling Ken’s persistent memory abstractions with V8, the JavaScript virtual machine that powers both the Google Chrome browser as well as the node.js server-side environment. It was a concrete proof-of-concept that a complete JavaScript VM can be made persistent in a way that is completely transparent to the application.
Transparently persisting applications has many implications: it avoids the overheads of serializing/deserializing application state into/from external data formats and the latency overhead of communicating with an external (database) process. If transparent orthogonal persistence can be made fast enough, it can completely change the way people design scalable applications. The mantra today is still to make applications stateless so they can be scaled out easily. Unfortunately this puts all the burden on the database, which then becomes the bottleneck. If applications could be made stateful in a way that is both persistent and scalable, that would trigger a paradigm shift in how we design scalable applications.