Transforming JavaScript event-loop into a pipeline

The development of a real-time web application often starts with a feature-driven approach allowing to quickly react to users feedbacks. However, this approach poorly scales in performance. Yet, the user-base can increase by an order of magnitude in a matter of hours. This first approach is unable to deal with the highest connections spikes. It leads the development team to shift to a scalable approach often linked to new development paradigm such as dataflow programming. This shift of technology is disruptive and continuity-threatening. To avoid it, we propose to abstract the feature-driven development into a more scalable high-level language. Indeed, reasoning on this high-level language allows to dynamically cope with user-base size evolutions. We propose a compilation approach that transforms a JavaScript, single-threaded real-time web application into a network of small independent parts communicating by message streams. We named these parts uxions, by contraction between a flow and a function. The independence of these parts allows their execution to be parallel, and to organize an application on several processors to cope with its load, in a similar way network routers do with IP traffic. We test this approach by applying the compiler to a real web application. We transform this application to parallelize the execution of an independent part and present the result.

[1]  Eddie Kohler,et al.  The scalable commutativity rule , 2017, Commun. ACM.

[2]  Austin T. Clements,et al.  The scalable commutativity rule: designing scalable software for multicore processors , 2013, SOSP.

[3]  Nicholas D. Matsakis Parallel closures: a new twist on an old idea , 2012, HotPar'12.

[4]  Raul Castro Fernandez,et al.  Making State Explicit for Imperative Big Data Processing , 2014, USENIX Annual Technical Conference.

[5]  Utpal Banerjee Loop Parallelization , 1994, Springer US.

[6]  D. L. Parnas,et al.  On the criteria to be used in decomposing systems into modules , 1972, Software Pioneers.

[7]  Yu David Liu,et al.  Rate types for stream programs , 2014, OOPSLA.

[8]  Scott Shenker,et al.  Discretized Streams: An Efficient and Fault-Tolerant Model for Stream Processing on Large Clusters , 2012, HotCloud.

[9]  Jignesh M. Patel,et al.  Storm@twitter , 2014, SIGMOD Conference.

[10]  John Hughes,et al.  Why Functional Programming Matters , 1989, Comput. J..

[11]  David E. Culler,et al.  A Design Framework for Highly Concurrent Systems , 2000 .

[12]  Jinyang Li,et al.  Building fast, distributed programs with partitioned tables , 2010 .

[13]  Manu Sridharan,et al.  Translating imperative code to MapReduce , 2014, OOPSLA 2014.

[14]  Daniel Mills,et al.  MillWheel: Fault-Tolerant Stream Processing at Internet Scale , 2013, Proc. VLDB Endow..

[15]  G. Amdhal,et al.  Validity of the single processor approach to achieving large scale computing capabilities , 1967, AFIPS '67 (Spring).

[16]  Neil J. Gunther,et al.  A General Theory of Computational Scalability Based on Rational Functions , 2008, ArXiv.

[17]  Stéphane Frénot,et al.  Toward automatic update from callbacks to promises , 2015, AWeS@EuroSys.

[18]  Eric A. Brewer,et al.  Cluster-based scalable network services , 1997, SOSP.

[19]  Sanjay Ghemawat,et al.  MapReduce: Simplified Data Processing on Large Clusters , 2004, OSDI.

[20]  Jinyang Li,et al.  Piccolo: Building Fast, Distributed Programs with Partitioned Tables , 2010, OSDI.

[21]  Albert Cohen,et al.  Automatic Extraction of Coarse-Grained Data-Flow Threads from Imperative Programs , 2012, IEEE Micro.

[22]  Michael Isard,et al.  Composable Incremental and Iterative Data-Parallel Computation with Naiad , 2012 .

[23]  Paul Hudak,et al.  Functional reactive animation , 1997, ICFP '97.