The Web is rapidly becoming a mature platform to host distributed applications. Pervasive computing application running on the Web are now common in the era of the Web of Things, which has made it increasingly simple to integrate sensors...
moreThe Web is rapidly becoming a mature platform to host distributed applications. Pervasive computing application running on the Web are now common in the era of the Web of Things, which has made it increasingly simple to integrate sensors and microcontrollers in our everyday life. Such devices are of great interest to Makers with basic Web development skills. With them, Makers are able to build small smart stream processing applications with sensors and actuators without spending a fortune and without knowing much about the technologies they use. Thanks to ongoing Web technology trends enabling real-time peer-topeer communication between Web-enabled devices, Web browsers and serverside JavaScript runtimes, developers are able to implement pervasive Web applications using a single programming language. These can take advantage of direct and continuous communication channels going beyond what was possible in the early stages of the Web to push data in real-time. Despite these recent advances, building stream processing applications on the Web of Things remains a challenging task. On the one hand, Web-enabled devices of different nature still have to communicate with different protocols. On the other hand, dealing with a dynamic, heterogeneous, and volatile environment like the Web requires developers to face issues like disconnections, unpredictable workload fluctuations, and device overload. To help developers deal with such issues, in this dissertation we present the Web Liquid Streams (WLS) framework, a novel streaming framework for JavaScript. Developers implement streaming operators written in JavaScript and may interactively and dynamically define a streaming topology. The framework takes care of deploying the user-defined operators on the available devices and connecting them using the appropriate data channel, removing the burden of dealing with different deployment environments from the developers. Changes in the semantic of the application and in its execution environment may be applied at runtime without stopping the stream flow. Like a liquid adapts its shape to the one of its container, the Web Liquid Streams framework makes streaming topologies flow across multiple heterogevii viii neous devices, enabling dynamic operator migration without disrupting the data flow. By constantly monitoring the execution of the topology with a hierarchical controller infrastructure, WLS takes care of parallelising the operator execution across multiple devices in case of bottlenecks and of recovering the execution of the streaming topology in case one or more devices disconnect, by restarting lost operators on other available devices. The Ph.D. grind has been a long and illuminating journey with many ups and few downs. First and foremost I would like to thank Prof. Cesare Pautasso for having spent a good amount of the past five years working with me. Our success and failures had taught me a lot -on an academic and personal level. I grew up a lot as a researcher during this journey thanks to his precise and sharp observations, and his dedication in our work increased its quality, teaching me how good research is done. I'd like to thank Prof. Marc Langheinrich and Prof. Robert Soulé from Lugano, Prof. Gustavo Alonso from Zürich, and Prof. Tommi Mikkonen from Helsinki for being part of this journey of mine, and for their strong feedback and support. Their invaluable comments had helped the development of this dissertation. This amazing journey wouldn't have been the same without my first travel companion, Vassilis, and all the old and new team: Achille, Ana, Daniele, Marcin, Saeed, and Vincenzo, and all the amazing people I've met at USI. Their support through these Ph.D. years has been amazing. Last but not least, I'd like to give big credits to Andrea with whom I shared great trips and amazing moments, while squatting his place every morning for a cup of coffee. The biggest shoutout of all goes to my family and their infinite support, and all my friends that walked with me through this big journey of mine. Finally, I'd like to credit Lisa, the most amazing person I've ever met. Her help and support throughout my bachelor, master, and Ph.D. years made me grow in many ways, making me a better person.