Building Real-Time Web Applications with Meteor

Building Real-Time Web Applications with Meteor

Building Real-Time Web Applications with Meteor Sophie Rust Jasper Schelling Donna Schipper Leiden University MSc student Leiden University MSc student Leiden University MSc student [email protected] [email protected] [email protected] ABSTRACT knowledge web developers needs to have to be able to The Meteor framework provides a way to develop real- create a complete web application. Each layer of the stack time web applications with just one programming language: has its own set of principles and constraints, complicating JavaScript. While keeping in mind other conventional the interfacing between the different layers. The following technology stacks as LAMP, the framework can be seen as milestones in the young history of web development a whole new paradigm because it makes use of server-side indicate a transformation of this convention and in the end JavaScript. First, we shortly explore the history of web led to the foundation of the Meteor platform. development frameworks in order to describe the context of Meteor. Second, the architecture and operating principles 2008: Release of the Chrome browser by Google that are discussed in order to explain the real-time aspects of included a new JavaScript interpreter (V8). It was Meteor. Strengths and weaknesses are explored and significantly faster than its competitors. The speed of example applications will be discussed to show the power JavaScript interpreters in general increased in a period of of Meteor. Finally a guide to build a Meteor application is competition between browsers [28]. Developers started to given and core elements contributing to create real-time integrate JavaScript interpreters into projects and applications with Meteor, such as 'templates' and technologies commonly associated with the ‘server-side’ of 'collections' are explained. web-application development. 2009: JavaScript based alternatives to technologies 1. PURPOSE, CONTEXT AND HISTORY common in the LAMP stack emerged: a new type of web Meteor is a set of interlocking web technologies that server (Node.JS/ IO.JS1), a new type of non-relational provides developers a modern method to create web- database (MongoDB2) and JavaScript as a server-side applications [20]. This paper discusses how Meteor development language to create web applications [12]. facilitates the creation of real-time web applications. With real-time is meant, web-based applications where the 2011: ‘Skybreak’ is announced [17]. Soon the project interactions between client and server take place at such a changes its name to Meteor [4]. The Meteor platform is speed that users experience direct feedback on their built on top of the previously mentioned developments and interactions with the application and other users. Modified coalesces technologies like Node.JS and MongoDB into a data is directly shown without the user having to refresh the cohesive whole. With one programming language page or the system having to execute periodical checks (JavaScript) on both the server and client side, and one data [15]. interchange format, JavaScript Object Notation (JSON), the breadth of skills required to develop web applications In order to understand the characteristics of a platform like decreased. [12]. Meteor, general background knowledge about the way web developers combine different technologies, is desired. Web 2012: The Meteor Group receives funding of Netscape developers rely on a ‘stack’: a set of software technologies creator Marc Andreessen. This allows future development that provides users with the functionality of a web-based of the project [27]. application [29]. In this set, the following technologies are 2014: Release of Meteor 1.0, the first public release [5]. commonly found: an operating system, providing the server with basic computer operations and networking, an http- 2. OPERATING PRINCIPLES server, which handles http-requests from web-browsers, In this part the basic operation of a Meteor project is database software to store data and a scripting language discussed. Since to some extent, the architecture has already with an interpreter to write the code that is executed when been discussed in order to explain the context and history of the user interacts with the web-application [33]. Meteor, we start with a description of what happens when a While many other stacks exist in parallel, the 'LAMP stack' user makes a request to a web server that is running Meteor. has become the most common set of server-side Afterwards, we describe what interactions between the technologies since the late 1990s. This stack consists of client and the server take place, to synchronize the data four open-source technologies; Linux (operating system), between both. In order to limit the scope of this article to Apache (web-server), MySQL (relational database) and Meteor's real-time characteristics, we do not discuss the PHP, Perl or Python (scripting languages). A reason for the development and deployment chain of a Meteor project. adoption of these open source technologies seems partly its low cost of acquisition, but mainly that the usage of an 2.1 Request open-source stack prevents what is called ‘vendor lock-in’, Most major software execution takes place on the client where an entity that uses closed source software becomes side. When a user makes the first request to a web dependent on the commercial vendors of that closed source application, the server sends a complete package to the software [9]. 1 Event driven framework to build network applicatons. htps://nodejs.org A weaknesses of the LAMP-based approached is the broad 2 Open source document database. htp://docs.mongodb.org/manual/ Building Real-Time Web Applications with Meteor 1 Figure 1. Overview of files an technologies taking part in client-server communication. client: html templates, css stylesheets, JavaScript the server, the Meteor server ships to each client a subset of application code and the parts of the Meteor framework that its database: MiniMongo, a reduced version of the enable the operation on the client, such as the in-memory MongoDB system [24]. This reduced database is used to JavaScript database, miniMongo [24] (see Figure 1). This facilitate the apparent aspect of real-time operation of a set of technologies provides the basic operation of the Meteor application. Whenever the data of a connected application in the client’s browser, as well as the low level client changes, it is first affected in the subset of the functionality to enable the application to interact with the database that is part of the clients application. Meteor server in a real-time manner. Simultaneously the server changes the data in the actual database [23]. In the background operation of the From the moment the client possess the initial state of the application, the client communicates with its server using application, no html markup is sent anymore. This setup is the Distributed Data Protocol (DDP). This protocol keeps chosen to facilitate one of the principles of Meteor: ‘Data the databases in sync between central database on the server on the Wire’. This means that during operation, the client and every connected client [22]. and server only exchange data: values that are inserted in the database by any of the clients or the server. As a developer, you define which parts of your html react to 3. STRENGTHS AND WEAKNESSES future changes in the data. When the data changes, its The major strength of using the Meteor framework is its presentation is automatically updated [16]. This reduces the shallow learning curve. Developers do not need to have a amount of data the application needs to send back-and broad knowledge of multiple technologies anymore, forth, and as such is one of the principles that enables real- because a lot of the interactions that usually cause the major time operation of an application [15]. However, this problems in a development process, are already covered by principle on its own is not enough to remain responsive Meteor [7]. Just having a thorough understanding of with a large amount of users. JavaScript, HTML and CSS gives developers the possibility to produce large scale projects. The Meteor framework has 2.2 Client and server interactions a big community and the Meteor organization offers a lot of To further enable the operation of a real-time web free resources that can be used to learn Meteor. Another application, the Meteor framework makes use of a advantage of working with Meteor is that web applications programming paradigm known as ‘reactive programming’. are real time by default. Updating an application made with Reactive programming is a specific method to create Meteor, can be done without temporarily being offline. software in such a manner that, when changes occur in the Finally Meteor offers a free hosting service that allows underlying data, changes in the data get propagated to all developers to deploy their application in a minute with only parts of the program that make use of that data, similar to one command [2]. the way that changes in data get propagated within a digital spreadsheet: when a value of one cell is updated, all other The apparent strengths of the Meteor platform are quite cells using the value of that cell, update the outcome of closely intertwined with its weaknesses. Developing an their calculations directly. The system reacts when data has application with Meteor for the first time may satisfy changed, instead of periodically asking if something has quickly, but for developers with little experience, this can changed. Meteor presents the benefits of this style of be a pitfall, as it is easy to ignore what is really happening programming as ’reactivity’ [21][25]. Much of the actual in the background. We feel it is important to take into functioning of this reactive standard cannot be seen while account how the underlying technologies are accessed by using the Meteor framework.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us