ThingsMigrate: Platform-Independent Migration of Stateful JavaScript IoT Applications

Authors Julien Gascon-Samson, Kumseok Jung, Shivanshu Goyal, Armin Rezaiean-Asel, Karthik Pattabiraman

Thumbnail PDF


  • Filesize: 1.2 MB
  • 33 pages

Document Identifiers

Author Details

Julien Gascon-Samson
  • Electrical and Computer Engineering Department, University of British Columbia, 2332 Main Mall, Vancouver, BC, Canada, V6T 1Z4
Kumseok Jung
  • Electrical and Computer Engineering Department, University of British Columbia, 2332 Main Mall, Vancouver, BC, Canada, V6T 1Z4
Shivanshu Goyal
  • Electrical and Computer Engineering Department, University of British Columbia, 2332 Main Mall, Vancouver, BC, Canada, V6T 1Z4
Armin Rezaiean-Asel
  • Electrical and Computer Engineering Department, University of British Columbia, 2332 Main Mall, Vancouver, BC, Canada, V6T 1Z4
Karthik Pattabiraman
  • Electrical and Computer Engineering Department, University of British Columbia, 2332 Main Mall, Vancouver, BC, Canada, V6T 1Z4

Cite AsGet BibTex

Julien Gascon-Samson, Kumseok Jung, Shivanshu Goyal, Armin Rezaiean-Asel, and Karthik Pattabiraman. ThingsMigrate: Platform-Independent Migration of Stateful JavaScript IoT Applications. In 32nd European Conference on Object-Oriented Programming (ECOOP 2018). Leibniz International Proceedings in Informatics (LIPIcs), Volume 109, pp. 18:1-18:33, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2018)


The Internet of Things (IoT) has gained wide popularity both in academic and industrial contexts. As IoT devices become increasingly powerful, they can run more and more complex applications written in higher-level languages, such as JavaScript. However, by their nature, IoT devices are subject to resource constraints, which require applications to be dynamically migrated between devices (and the cloud). Further, IoT applications are also becoming more stateful, and hence we need to save their state during migration transparently to the programmer. In this paper, we present ThingsMigrate, a middleware providing VM-independent migration of stateful JavaScript applications across IoT devices. ThingsMigrate captures and reconstructs the internal JavaScript program state by instrumenting application code before run time, without modifying the underlying Virtual Machine (VM), thus providing platform and VM-independence. We evaluated ThingsMigrate against standard benchmarks, and over two IoT platforms and a cloud-like environment. We show that it can successfully migrate even highly CPU-intensive applications, with acceptable overheads (about 30%), and supports multiple migrations.

Subject Classification

ACM Subject Classification
  • Computer systems organization → Distributed architectures
  • Computer systems organization → Embedded and cyber-physical systems
  • Computer systems organization → Dependable and fault-tolerant systems and networks
  • Software and its engineering → Middleware
  • Software and its engineering → Process management
  • Software and its engineering → Functional languages
  • Software and its engineering → Language features
  • Software and its engineering → Publish-subscribe / event-based architectures
  • JavaScript
  • Code Migration
  • Closures
  • IoT
  • Node.js


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Babel.js JavaScript Compiler, 2017. URL:
  2. Chromium octane benchmark suite, 2017. URL:
  3. DukTape, 2017. URL:
  4. ECMAScript 2015 Language Specification, 2017. URL:
  5. ECMAScript 5.1 Language Specification, 2017. URL:
  6. escodegen: ECMAScript code generator, 2017. URL:
  7. esprima: ECMAScript parsing infrastructure for multipurpose analysis, 2017. URL:
  8. FFmpeg Website, 2017. URL:
  9. Fluent ffmpeg-API for node.js, 2017. URL:
  10. Intel XDK, 2017. URL:
  11. Jimp: JavaScript Image Manipulation Program, 2017. URL:
  12. mjs, 2017. URL:
  13. TIOBE Index, 2017. URL:
  14. node-minify - npm, 2018. URL:
  15. Saba Alimadadi, Sheldon Sequeira, Ali Mesbah, and Karthik Pattabiraman. Understanding javascript event-based interactions. In Proceedings of the 36th International Conference on Software Engineering, pages 367-377. ACM, 2014. Google Scholar
  16. Esben Andreasen, Liang Gong, Anders Møller, Michael Pradel, Marija Selakovic, Koushik Sen, and Cristian-Alexandru Staicu. A survey of dynamic analysis and test generation for javascript. ACM Computing Surveys (CSUR), 50(5):66, 2017. Google Scholar
  17. Silviu Andrica and George Candea. Warr: A tool for high-fidelity web application record and replay. In Dependable Systems &Networks (DSN), 2011 IEEE/IFIP 41st International Conference on, pages 403-410. IEEE, 2011. Google Scholar
  18. Federico Bellucci, Giuseppe Ghiani, Fabio Paternò, and Carmen Santoro. Engineering javascript state persistence of web applications migrating across multiple devices. In Proceedings of the 3rd ACM SIGCHI symposium on Engineering interactive computing systems, pages 105-110. ACM, 2011. Google Scholar
  19. Brian Burg, Richard Bailey, Andrew J Ko, and Michael D Ernst. Interactive record/replay for web application debugging. In Proceedings of the 26th annual ACM symposium on User interface software and technology, pages 473-484. ACM, 2013. Google Scholar
  20. Tiancheng Chang and Hein Meling. Byzantine fault-tolerant publish/subscribe: A cloud computing infrastructure. In Reliable Distributed Systems (SRDS), 2012 IEEE 31st Symposium on, pages 454-456. IEEE, 2012. Google Scholar
  21. Ioannis K Chaniotis, Kyriakos-Ioannis D Kyriakou, and Nikolaos D Tselikas. Is node. js a viable option for building modern web applications? a performance evaluation study. Computing, 97(10):1023-1044, 2015. Google Scholar
  22. Christopher Clark, Keir Fraser, Steven Hand, Jacob Gorm Hansen, Eric Jul, Christian Limpach, Ian Pratt, and Andrew Warfield. Live migration of virtual machines. In Proceedings of the 2nd Conference on Symposium on Networked Systems Design &Implementation-Volume 2, pages 273-286. USENIX Association, 2005. Google Scholar
  23. Douglas Crockford. JavaScript: The Good Parts: The Good Parts. " O'Reilly Media, Inc.", 2008. Google Scholar
  24. Patrick Th. Eugster, Pascal A. Felber, Rachid Guerraoui, and Anne-Marie Kermarrec. The many faces of publish/subscribe. ACM Comput. Surv., 35(2):114-131, 2003. URL:
  25. Paul Fremantle, Benjamin Aziz, Jacek Kopeckỳ, and Philip Scott. Federated identity and access management for the internet of things. In Secure Internet of Things (SIoT), 2014 International Workshop on, pages 10-17. IEEE, 2014. Google Scholar
  26. Julien Gascon-Samson, Mohammad Rafiuzzaman, and Karthik Pattabiraman. Thingsjs: Towards a flexible and self-adaptable middleware for dynamic and heterogeneous iot environments. In Proceedings of the 4th Workshop on Middleware and Applications for the Internet of Things, M4IoT '17, pages 11-16, 2017. Google Scholar
  27. Evgeny Gavrin, Sung-Jae Lee, Ruben Ayrapetyan, and Andrey Shitov. Ultra lightweight javascript engine for internet of things. In SPLASH Companion 2015, pages 19-20, New York, NY, USA, 2015. ACM. Google Scholar
  28. Jayavardhana Gubbi, Rajkumar Buyya, Slaven Marusic, and Marimuthu Palaniswami. Internet of things (iot): A vision, architectural elements, and future directions. Future generation computer systems, 29(7):1645-1660, 2013. Google Scholar
  29. Jin-woo Kwon and Soo-Mook Moon. Web application migration with closure reconstruction. In Proceedings of the 26th International Conference on World Wide Web, WWW '17, pages 133-142, Geneva, Switzerland, 2017. Google Scholar
  30. Amit Levy, Bradford Campbell, Branden Ghena, Daniel B Giffin, Pat Pannuto, Prabal Dutta, and Philip Levis. Multiprogramming a 64kb computer safely and efficiently. In Proceedings of the 26th Symposium on Operating Systems Principles, pages 234-251. ACM, 2017. Google Scholar
  31. Jimmy Lin and Kareem El Gebaly. The future of big data is... javascript? IEEE Internet Computing, 20(5):82-88, 2016. Google Scholar
  32. James Teng Kin Lo, Eric Wohlstadter, and Ali Mesbah. Imagen: Runtime migration of browser sessions for javascript web applications. In Proceedings of the 22Nd International Conference on World Wide Web, WWW '13, pages 815-826, New York, NY, USA, 2013. ACM. Google Scholar
  33. Magnus Madsen, Ondřej Lhoták, and Frank Tip. A model for reasoning about javascript promises. Proceedings of the ACM on Programming Languages, 1(OOPSLA):86, 2017. Google Scholar
  34. James W Mickens, Jeremy Elson, and Jon Howell. Mugshot: Deterministic capture and replay for javascript applications. In NSDI, volume 10, pages 159-174, 2010. Google Scholar
  35. Dejan S. Milo\'\jičić, Fred Douglis, Yves Paindaveine, Richard Wheeler, and Songnian Zhou. Process migration. ACM Comput. Surv., 32(3):241-299, 2000. URL:
  36. JinSeok Oh, Jin-woo Kwon, Hyukwoo Park, and Soo-Mook Moon. Migration of web applications with seamless execution. In Proceedings of the 11th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments, VEE '15, pages 173-185, New York, NY, USA, 2015. ACM. URL:
  37. Koushik Sen, Swaroop Kalasapur, Tasneem Brutch, and Simon Gibbs. Jalangi: A selective record-replay and dynamic analysis framework for javascript. In Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering, pages 488-498. ACM, 2013. Google Scholar
  38. Weisong Shi, Jie Cao, Quan Zhang, Youhuizi Li, and Lanyu Xu. Edge computing: Vision and challenges. IEEE Internet of Things Journal, 3(5):637-646, 2016. Google Scholar
  39. Dongig Sin and Dongkun Shin. Performance and resource analysis on the javascript runtime for iot devices. In International Conference on Computational Science and Its Applications, pages 602-609. Springer, 2016. Google Scholar
  40. Meena Singh, MA Rajan, VL Shivraj, and P Balamuralidhar. Secure mqtt for internet of things (iot). In Communication Systems and Network Technologies (CSNT), 2015 Fifth International Conference on, pages 746-751. IEEE, 2015. Google Scholar
  41. A. Taivalsaari and T. Mikkonen. A roadmap to the programmable world: Software challenges in the iot era. IEEE Software, 34(1):72-80, Jan 2017. URL:
  42. Stefan Tilkov and Steve Vinoski. Node. js: Using javascript to build high-performance network programs. IEEE Internet Computing, 14(6):80-83, 2010. Google Scholar
  43. Timothy Wood, Prashant J Shenoy, Arun Venkataramani, Mazin S Yousif, et al. Black-box and gray-box strategies for virtual machine migration. In NSDI, volume 7, pages 17-17, 2007. Google Scholar
  44. Young Yoon, Vinod Muthusamy, and Hans-Arno Jacobsen. Foundations for highly available content-based publish/subscribe overlays. In Distributed Computing Systems (ICDCS), 2011 31st International Conference on, pages 800-811. IEEE, 2011. Google Scholar
  45. Amirreza Zarrabi. A generic process migration algorithm. International Journal of Distributed and Parallel Systems, 3(5):29, 2012. Google Scholar
  46. S. Zhongyuan, Q. Jianzhong, L. Shukuan, and Z. Qiang. Use pre-record algorithm to improve process migration efficiency. In 2015 14th International Symposium on Distributed Computing and Applications for Business Engineering and Science (DCABES), pages 50-53, Aug 2015. URL: