Querying MongoDB with LINQ in a Server-Side JavaScript Environment - Nakabasami, Kousuke; Amagasa, Toshiyuki; Kitagawa, Hiroyuki (International Conference on Network-Based Information Systems, 2013)
This paper discusses an extension of JSINQ, a JavaScript implementation of LINQ, to provide an ability to query MongoDB, a popular document-oriented NoSQL storage. In recent Web systems, it has become popular to use NoSQL storage for data management, and to use JavaScript not only on client-side, but also on server-side due to the popularization of server-side JavaScript environments. Meanwhile, LINQ is being used to facilitate querying or manipulating data in various programming languages, such as C# and JavaScript, using an SQL-like syntax. However, current implementations of LINQ in JavaScript do not support MongoDB. To this problem, we extend JSINQ to provide an ability to query MongoDB. More precisely, we extend JSINQ so that we can specify the MongoDB collection to query. When processing a LINQ query, we extract the query conditions related to MongoDB collections, rewrite them to those in MongoDB API format, and send the rewritten queries to MongoDB. When the results are back, we convert them in a in-memory data structure, and pass them to the JSINQ processor. We conduct some experiments based on TPC-H to show the feasibility and the scalability of the proposed system.