Paper 6
Paper 6
Web Pages
Abstract ............................................................................................ ii
Terminology .................................................................................... iii
Table of contents ............................................................................ iv
1 Introduction ................................................................................ 1
BACKGROUND .........................................................................................................................1
DISPOSITION ............................................................................................................................2
MongoDB .......................................................................................................................................... 4
Express .............................................................................................................................................. 5
React.js .............................................................................................................................................. 5
Node.js............................................................................................................................................... 7
MEVN STACK .........................................................................................................................8
Vue.js................................................................................................................................................. 8
3 Theoretical Framework........................................................... 12
PREVIOUS STUDIES ................................................................................................................12
LIMITATIONS .........................................................................................................................24
CONCLUSIONS........................................................................................................................24
7 References ................................................................................. 25
8 Appendices ................................................................................ 27
APPENDIX 1 ...........................................................................................................................27
APPENDIX 2 ...........................................................................................................................27
APPENDIX 3 ...........................................................................................................................27
APPENDIX 4 ...........................................................................................................................28
APPENDIX 5 ...........................................................................................................................29
1 Introduction
The chapter provides a background for the study and the problem area the study is addressing.
Further, the purpose and the research questions are presented. The scope and delimitations of
the study are also described. Lastly, the disposition of the thesis is outlined.
Background
JavaScript is a high-level, dynamic, programming language that is one of the most popular and
widely used programming languages in the world today as most of the websites and web
browsers use and support JavaScript (areknawo.com, 2019).
With JavaScript becoming very popular, many tools, libraries, and frameworks are built upon
it over the years, that solves the common programming problems more easily and efficiently.
Often the lifespan of the frameworks/libraries is not too long as a newer one gets to be
introduced almost every 6 months claiming to have a better user interface development
according to another study published on stack overflow website (Allen, 2018).
With the rapid changes in the tech industry regarding the frameworks and libraries, developers
are forced to keep up and constantly learn new technologies which are commonly referred to as
JavaScript Fatigue. Each of these technologies come with their advantages and disadvantages
which makes the process of decision making when building a web application pretty hectic.
Angular.js, Backbone.js, Amber.js, Vue.js and React.js are a few very popular and commonly
used frameworks and libraries with Vue.js and React.js having the lead positions. According to
the survey published by the website ashlynolan.com, there has also been an increase of 4.3% in
usage of Vue.js and React.js among the developers, compared to last years’ survey study
(ashlynolan.com, 2019). Having to choose one of these frameworks and libraries when creating
a single page web application, questions arise such as what aspects a developer should consider
when choosing one of these frameworks or libraries. As performance is one of the main
technical aspects, which of these technologies have a better run-time performance? Which
technologies are more commonly combined with these frontend frameworks and libraries and
why are they preferred?
As it will exceed the scope of this thesis to explore all the technologies built on JavaScript over
the years, this study will focus on comparing the run-time performance of two of the most
popular JavaScript libraries React.js and Vue.js in combination with MongoDB (a NoSQL
database), Node.js (a server-side run-time environment) and Express ( a Node.js framework).
The reason behind this choice of stacks in this thesis is the knowledge gap identified by
researching the previous studies. Although previous studies are addressing a range of
overlapping topics, there are gaps in these inquiries that should be addressed to provide a more
complete comparative overview of the software stacks in terms of performance, most notably
between React.js and Vue.js, which will be the primary topic of this study. Moreover, the reason
Vue.js and React.js was chosen to be combined with MongoDB, Node.js and Express are that
the mentioned software is all programmed throughout using JavaScript and in order to get valid
data in the performance analysis of Vue.js and React.js, the other parameters need to be kept
the same. In continuation these two stacks will be referred to by their abbreviations, MERN
(MongoDB, Express, React.js, Node.js) and MEVN (MongoDB, Express, Vue.js, Node.js)
Furthermore, this thesis will cover the preferential trend between the software stacks among
industry practitioners in Sweden to further understanding of trends and relevance between the
various stacks.
1
2. What are the preferred software stacks for single page application development
among Swedish based companies?
To answer these questions and thereby fulfill the purpose, an experimental study will be
conducted to analyze the run-time performance of the mentioned stacks in regard to building a
single page application. In addition, a survey study will be conducted to gather primary data
from industry practitioners regarding the preferential trend in software combination and usage.
Disposition
This report follows the Jönköping University’s School of Engineering thesis report template and
is divided into the following chapters.
- Technical background
- Method and implementation
- Findings and analysis
- Discussions and conclusions
2
2 Technical Background
This chapter provides explanation to the building of web applications as well as describing each
of the technologies used in the respective stacks, MERN and MEVN.
JavaScript
JavaScript is a high-level, dynamic, object-oriented programming language that was developed
by Brenden Eich in 1995. It is one of the most popular and widely used programming languages
in the world today as it is shown in a recent study published by the website stack overflow in
Figure 1 -Most Popular Technologies (stackoverflow.com 2019). JavaScript was traditionally
only used for manipulating Document Object Model (DOM) and Cascading Style Sheets (CSS)
and was known to be a client-side scripting language. In 2009 an engineer called Ryan Dahl
developed a JavaScript run-time environment named Node.js that can be used to run server-
side applications.
Software stack
A software stack is a number of independent software that are brought together in to support
the execution of an application. Different software stack may be put together to support
different applications depending on the requirements. For example, the software stacks for a
web application may include client-side software, a server-side runtime environment, and a
server-side database that communicates and work together through a set of complex
instructions. In the hierarchy of a software stack, the lower level typically interacts with the
hardware and the higher level executes the tasks in the client-side (Margaret Rouse 2019).
3
and React.js are just a few examples of JavaScript client-side software that are popular today
(Kryzhanovska 2019).
MERN Stack
The MERN Stack is an acronym for MongoDB, Express, React.js and Node.js which are all open-
source software optimized to build a SPA. Together the stack consists of a database, a back-end
framework, a front-end library and a server-side runtime environment respectively. Using
Node.js allows the MERN stack to be very efficient as a hosting web service due to being non-
blocking, meaning it is able to serve a great number of clients concurrently. Each of these
technologies used in the MERN stack will be explained in detail further below in this section.
MERN stack is programmed throughout using JavaScript Language meaning the developer
needs to feel conformable using only one programming language. Aside from the obvious
advantage of not having to switch language when working on the different parts of the
application, it also makes the code sharing (logic, validation, etc.) throughout the application
possible. See Figure 2 for MERN stack architecture.
MongoDB
MongoDB is a NoSQL (non SQL), non-relational, document-oriented database, that is used by
the MERN stack. MongoDB stores the data into collections of documents. Documents are
collections of key-value pairs that can store various datatypes. Collections are a way for
MongoDB to organize and keep track of the documents in a collection and also prevent name-
overlapping. Every document in MongoDB has a unique Object Identifier that is automatically
generated through which the document can be accessed. The data is stored natively in the form
of BSON (Binary JavaScript Object Notation). The reason for that is that MongoDB supports
inserting various datatypes in different programming languages, given the driver for the
language is supported. Then the driver converts the different data types used in the applications
(which can be written in various programming languages) to BSON types. This design allows a
faster scan when querying and increased efficiency in data storage (MONGODB.COM 2019).
Querying
MongoDB is based on the JavaScript Language and the query language is based on JSON which
is an abbreviation for (JavaScript Object Notation). Using JSON as the query language brings
a considerable amount of ease of use in terms of querying. By specifying the type of operation
in a JSON object a document can be created, deleted, retrieved, updated or searched for and
allows the developer to construct more programmatic queries. SQL database on the other hand
is more limiting when it comes to programmatic queries since the query language is “English-
like” and a specific record can be reached using query words such as SELECT or WHERE.
Storing the data in an object rather than storing it in a form of relations or tables as it is in a
more traditional SQL database, gives the developer some flexibility on structuring models
(Subramanian 2019 p. 10-11).
4
No predefined Schemas
No predefined schemas mean that there is no need to specify the data type or sizes before
storing the data. This allows the developer to test and iterate without the need of restructuring
the model every time, a new change is made. Unlike an SQL database that the model has to be
modified for a change to be accepted. Therefore, the development in MongoDB becomes faster.
The downside with this is that it could potentially introduce some other issues since the datasets
are less organized. If a more structured dataset environment is preferred or required,
Mongoose, an express MongoDB database driver can be used that emulate a similar structured
environment as SQL.
Scalability
When it comes to data sizes and scalability of an application, developers have two options,
either to scale up meaning they have to invest on a bigger machine that is capable of storing
more data or scale out which is a term used for distributing the data across multiple machines.
Scaling up can be very expensive and can eventually reach up to the hardware's physical limit
where purchasing another big machine can be too costly. MongoDB is designed to scale-out, it
partitions the data across multiple servers and automatically balances the data load. Mongo’s
routing system is used to assure that the data is read and written to the correct machine. This
design provides a more sustainable scalability option as more servers and storage space can be
added as needed (Bradshaw 2019).
Express
Express.js or simply Express is a Node.js framework originally built by TJ Holowaychuk It
simplifies building server-side code. Although this technically, could be done with Node.js
alone, Express helps the developer to achieve the same result with less and cleaner code while
having access to additional functionalities. Express can essentially be described as a set of
middleware that is built to manage all responses expected of a web-application such as response
codes, setting cookies or sending custom headers. While Express is lightweight and has a
limited set of built-in middleware, the developer can customize their own sets to fit their specific
needs or choose to use middleware from third parties (Subramanian 2019 p. 8-10).
Express Routing
A prominent feature of the framework is routing, the specification of how to process HTTP-
request matching certain patterns in the application’s endpoints (URIs). It essentially parses
the request URL, headers, parameters, and responds as specified (Subramanian 2019 p. 8-10).
Template Engine
Express Template engines enables the use of static template files in the application. The
variables in the templates are replaced by the actual values and transformed into the HTML file
before sending it back to the client. This is to offer an easier way of designing the HTML page.
Express uses the “Jade” template engine by default, but there are a few others that can be
integrated such as Pug and Mustache (expressjs.com 2019).
React.js
React.js is the client-side software used in the MERN stack. It is an opensource, JavaScript
component-based library that was developed by Facebook in 2011. Unlike other JavaScript
libraries such as jQuery that is used to create an MVC (Model, View, Controller) pattern,
React.js creates only views in HTML. In MVC architecture, the Model manages the application's
data, View renders the model for the client and Controller updates the model when there is a
change. In a regular MVC model, Views listen to the models and get updated according to the
changes accruing in the model. Using MVC pattern, it can be more difficult to maintain since
every time there is a small change in the view, the model gets updated and that update might
5
cause another update in the view. That is why React.js was developed in the first place, to
prevent the struggle of dealing with the transitions of the updates (Subramanian 2019 p. 5-6).
Declarative
Views in React.js are declarative. A declarative view allows the code to be more predictable and
easier to maintain since the developer only needs to design the component for each view and
React.js efficiently updates only the component that the change has occurred in. This is done
with the help of virtual DOM (Document Object Model) which is an in-memory data structure
that is built to represent the data when the view is declared. React.js compares the virtual DOM
with the actual DOM and if there is a difference then the actual DOM is updated accordingly.
Compared to the alternative way of updating the DOM as it is in jQuery, the computation of the
difference is more costly, whereas React.js offers an optimized way to perform minor changes
(Subramanian 2019 p. 5-6).
Component-based
Components are the building blocks of React.js which are smaller and reusable code snippets
that maintain their own state and renders. Technically, they are JavaScript classes or functions
that are capable of receiving inputs and properties (props) and return a React.js element. Each
of these React.js elements describe how the UI (User interface) should look. Other components
can be put together to form a parent component which can represent a full view or a page in an
application (Kaga, 2018). See Figure 3 for the illustration of React.js Component.
6
Figure 4 React.js lifecycle methods - (reactjs.org 2019).
Node.js
Node.js is a JavaScript runtime environment. JavaScript itself, is only a computational
language, to execute the JavaScript code on the server-side, a runtime environment is needed.
Node.js runtime environment consists of additional functionalities to JavaScript including
access to the file system (read and write the files in the file system with JavaScript) and access
to the network (using JavaScript, Http requests can be sent, and responses received). That
means Node.js can execute JavaScript code that was written in an environment where it has
access to the functionalities that are not natively part of the JavaScript language (Subramanian
2019 p. 8-10).
Node.js is built on Chrome’s V8 engine (an open-source runtime engine that is written in C++)
and can run on Linux, Mac OSX and Microsoft Windows systems after 2008R2/Windows 2012.
Moreover, any other language that compiles into JavaScript before execution can be run by
Node.js. TypeScript, CoffeeScript and Dart are a few examples of many (Patel 2018).
Node.js Modules
To reuse or combine multiple JavaScript files, Node.js makes use of its own model that is based
on Common.js. Node.js modules allow a JS file to be exported and imported in another file as
long as the module specifications are followed. Node.js modules allow the developer to split the
codes into smaller and reusable chunks and offer better structure and organization of code.
These modules can be seen as libraries that use the functions written in another JavaScript file.
Node.js includes a few built-in modules that have access to the file system and network system.
Other third-party libraries can be downloaded and installed using NPM (Node Package
Manager) which is a default package manager for Node. (Subramanian 2019 p. 8-10)
Event Driven
Node.js uses an event-driven, non-blocking I/O (inputs/outputs), asynchronous model to
perform multitasking. I/O events refer to any events related to the modification of local files or
handlings of Http requests. Other languages used in the server-side, make use of threading to
imitate simultaneous code execution. For example, when the server receives 2 requests of A and
B, the request B is put on hold (it is blocked) and once the request A is handled, only then
request B will be carried out and the response of both requests will be sent back to the client.
Node.js, on the other hand, is non-blocking and uses callbacks to keep track of the functions
that are pending. In the example mentioned above, Node.js would process both requests
concurrently as illustrated in Figure 5, omitting the waiting time and resulting in an efficient,
lightweight development (Subramanian 2019 p. 8-10).
7
Figure 5 Blocking I/O vs Non-Blocking I/O (Patel 2018).
MEVN Stack
The MEVN stack is another software stack combination that uses the same technologies as
MERN with the only difference being in the client-side software. MEVN uses Vue.js for the
client-side software which is a JavaScript framework developed by Evan You in 2014. Evan You
is a former Google developer who was working on Angular.js (another client-side software
framework). While working on developing Vue.js, Evan You focused on omitting the
complexities that developers had while learning Angular.js and wished to create a more
lightweight framework. Currently, Vue.js is maintained by a community of international
developers (Mobilunity.com 2020).
Vue.js
Vue.js is a progressive JavaScript framework that is used to build dynamic user interfaces and
when combined with other modern tooling it can be used for creating effective SPAs. Very
similar to React.js, Vue.js’ core library is also focused on the view layer only (Vuejs.org 2020).
Components in Vue.js
Very similar to React.js Vue.js also uses components which are reusable instances. These
instances go through a number of initialization steps including, data set up observation,
compiling the template. In addition, it also runs life-cycle hooks that allow the developer to
execute their own code at different stages. Some of the main lifecycle hooks in Vue.js include
created, mounted, updated and destroyed. See Figure 6 for Vue.js lifecycle diagram.
8
Figure 6 -Vue.js Lifecycle diagram (vuejs.org 2019).
9
There are 4 different ways of creating components in Vue.js.
• SFC (Single File Component)
• Component with a template
• Component with a render function
• Component with a render function and JSX syntax (Lilo, 2019)
Single file component is the most common way of creating a component in Vue.js. In Vue.js,
every component accepts a few options including data, computed, watch, methods and lifecycle
hooks.
10
Figure 10 -Computed property in Vue.js components (vuejs.org 2020).
The same result can be achieved using methods. In the above example, instead of writing
computed, it could be written methods and include the reversedMessage function within the
methods object. They operate exactly the same, the only difference is the caching. When using
the computed option, if the message is not changed, the function won’t be executed, and the
previous result will be returned. While using methods object the function will be executed every
time the reversedMessage function is called (Vuejs.org 2020).
Watchers are used to track changes in the data object. Although the official documentation
suggests the use of computed property rather than custom watchers, watchers can be used when
wishing to perform an asynchronous operation (Vuejs.org 2020).
11
3 Theoretical Framework
Previous studies
Although there have been prior studies relating to the comparison of various JavaScript
framework/libraries as well as inquiries into developers choice of frameworks there is to the
best of the author’s knowledge no studies that solely focuses on the comparison of React.js,
Vue.js and contingent technologies in regards to trend, architecture, and performance in
development of single-page applications. Besides, considering that these technologies are
constantly updated and improved, the exploration of the latest iterations of these stacks is
crucial. To add reliability and validity to this study two similar studies are introduced.
“What affects the choice of a JavaScript framework” is a bachelor thesis (Duvander, Romhagen,
2019) written by Jacob Duvander & Oliver Romhagen for Jönköping University. In the thesis,
the authors aim to find out the reason behind JavaScript framework preference among
developers. The authors concluded that an active community, reputation, learning curve and
documentation of frameworks are the key factors impact the choice of frameworks among
developers. (Duvander, Romhagen, 2019)
“Supporting Web development decisions by comparing three major JavaScript Frameworks” is
a bachelor thesis written by Eric Wohlgethan for faculty of engineering and Computer Science
of Hamburg. Wohlgethan in his thesis explores some of the features and accessibility aspects of
React.js, Vue.js and Angular.js, though he does not perform any performance tests.
Wohlgethan’s aim is to find out whether any of these three stands out in a way that can be used
for most of the use cases (Wohlgethan, 2020).
Although these mentioned studies are addressing a range of overlapping topics there are gaps
in these inquiries that should be addressed to provide a more complete comparative overview
of the software stacks in terms of performance, most notably between React.js and Vue.js, which
will be a primary topic of this study. Moreover, this paper will contribute an analysis of
preference among industry practitioners in Sweden based on quantitative data to further
understanding the trends and relevance between the various stacks.
12
4 Method and implementation
The chapter provides an overview of the work process of the study. Further, the approach and
design of the study are described as well as the data collection and data analysis. The chapter
ends with a discussion about the validity and reliability of the study.
Work process
For the experimental study, two simple “to-do” applications were created using MERN and
MEVN respectively and their run-time performance was compared using Google Chrome
development tool while executing CRUD- operations (Create tasks, Read tasks, Update tasks
and Delete tasks). Both the stacks make use of the same database (MongoDB), server-side run
time environment (Node.js) and the Node.js framework (Express) and their only difference are
in the client-side framework/libraries. This approach is taken to minimize the risk of
misevaluation. The experiment is iterated 20 times to ensure that the collected data is valid. All
the tests can be replicated by anyone who has access to the source code, the same version of
Google Chrome and a cloud based instanced as specified below. Tools that were used in the
experiment are as follows:
• Google Chrome (Version 79.0.3945.130)
• Google Chrome’s built-in developer tools
• Linux/Unix, Ubuntu 18.4 LTS Bionic | 64 bit (installed on a virtual machine
hosted by AmazonEC2)
The reason Google Chrome was chosen is that according to statcounter.com Chrome is among
the most commonly used web browser worldwide holding 63% of browser market share. See
Figure 11. The other reason for choosing Google Chrome is the built-in developer tools that
among other useful features also allows the analysis of runtime performance.
13
Figure 11 Browser market share worldwide (gs.statcounter.com 2019).
During the experiments, the CPU throttling1 (6x slowdown) was used to be able to monitor the
performance in a clearer way. Four tests were made using Google Chrome’s built-in “Web
developers’ tools”. These tests are as follows:
1. Loading the application
• Recording starts from the reloading of the page and ends when all of the text
and the graphical elements are loaded.
2. Adding a to-do task
• Recording starts after writing the text in the text area and before pressing the
enter key and stops when the task is added to the list and displayed.
3. Removing a to-do task
• Recording starts from when the delete button is pressed and stops when the
task is deleted, and the new list is fetched.
4. Updating a to-do task
• Recording starts after the new text is written in the text area and before the
update button is clicked. The recording stops after the task is updated and the
new list is displayed.
Software and libraries used in building the to-do applications are as follows:
- Visual Studio Code (version 1.38.0)
- Mongoose (Object data modelling for MongoDB) (version 5.8.9)
- Express.js (version 4.17.1)
- Node.js (version 10.16.3)
- Vue.js (version 3.11.0)
- React.js (version 16.12.02)
1 Throttling is relative to your computer's capabilities. For example, the 2x slowdown option makes the
CPU operate 2 times slower than its usual ability. DevTools can't truly simulate the CPUs of mobile
devices, because the architecture of mobile devices is very different from that of desktops and laptops.
14
- NPM (version 6.9.0)
The to-do app is a basic application that allows adding, removing, deleting and displaying the
list of added to-do tasks. The application is built based on the 3-tier model that includes a
frontend application, a backend application and a database.
Two frontend applications are built with Vue.js and React.js and both contain similar design
and functionalities. Both of the applications contain 4 components, each handling one of the
CRUD operations and then they are brought together in the main file of the application (app.js
and Vue.js) See Figure 12 and Figure 13 for the User Interfaces of each application. Also, the
styling of the frontend applications was done using inline CSS.
15
Figure 14 Mongoose database schema.
The survey was created using Google Forms and questions were limited to two, a multiple-
choice question and one open-ended. On the first question, the participants were asked to
choose the software stack they use when building a single page application and the choices
included were MERN or MEVN, Both of the above and other. If they chose the “other” option,
the they could write the software stack they use. The MERN and MEVN stack were included in
the choices to measure the popularity of the stacks and the option “other” was included to gather
data on their preferred software combination. On the second open-ended question, the
participants were asked to elaborate on their choice of stack and share the factors that play a
role in their decision-making process.
The survey was sent to approximately 70 companies located all over Sweden, the chosen
companies were mostly tech companies who were assumed to work with web development. The
companied mostly were directly contacted through the email address they provided in their
official webpage and they were asked to forward the email to their development team, if they
are not the right person to respond to the survey. LinkedIn and Facebook developers’ group
were also used to reach out to developers who are currently working at a Sweden based
company.
16
5 Findings and Analysis
The chapter answers the research questions by processing the collected empirical data and
presents formulated results of the study based on the research questions and purpose. The
analysis is performed according to those principles stated in the methods chapter.
Research question 1
To answer the first research question, an experiment was conducted to measure the run-time
performance of the to-do applications built with MERN and MEVN stacks. The tests in the
experiment included measuring the loading time of the application, adding a task, updating a
task and deleting a task. In this experiment, each task was iterated 20 times and the average of
the 20 iterations are then compared. The data gathered from the tests are presented and
analyzed below. St DEV refers to the standard deviation of the sample data, see Eq. (1). and ME
in the tables below refers to the margin of error determined with 95% confidence (Z score =1.96)
interval Eq. (2).
(1)
∑(𝜒 − 𝜒)2
𝑠=√
𝑁−1
Where s is the sample standard deviation, N the number sample data, 𝝌 is the
mean value of the sample data
𝑠 (2)
𝑀𝐸 = Ζ
√𝑁
The loading time of each application built with the MERN and MEVN stacks was recorded using
the performance tool from Google Chromes’ developers’ tools. The measurement was taken
from the beginning of evaluating the script and to the end of the composite layer. The start time
was then deducted from the end time, to gather the duration of the run time. Table 1 displays
the results gathered from the test for loading the to-do applications.
# MERN MEVN
1 90 107
2 70 91
3 64 85
4 77 96
5 99 97
6 66 86
7 54 88
8 65 127
9 90 89
10 56 103
11 63 100
12 71 86
13 65 89
14 88 107
15 87 89
16 70 90
17 68 98
17
18 52 107
19 62 94
20 52 100
Mean 70 96
St. DEV 14 10
ME 6 4
Table 1- Running time (ms) when loading the applications
As it is shown in Table 1, the average runtime performance of MERN (with 95% confidence
interval) is between 64 and 76ms (70 ± 6ms) while MEVN is between 92 and 100ms (96 ± 4ms)
based on the 20-sample data shown above. Because the calculated lower bound average of
MEVN at (92) is higher than the average upper bound of MERN at (76) by 15ms it is safe to say
that MERN outperformed MEVN at loading. However, from a user experience perspective, this
difference might not even be perceivable.
The recording for adding a task started after writing the text on the inputs and before clicking
enter. Therefore, the measurement started from when the submit event was registered and
ended when the compositing layer was over. The duration was calculated by deducting the start
time from the end time. Table 2 shows the results gathered from the test on adding a task.
# MERN MEVN
1 439 428
2 153 409
3 446 427
4 149 176
5 416 182
6 149 407
7 422 174
8 159 396
9 465 433
10 437 420
11 436 552
12 151 405
13 447 471
14 421 412
15 423 398
16 469 420
17 160 414
18 403 412
19 419 291
20 427 195
Mean 350 371
St. DEV 133 107
ME 58 47
Table 2- Running time (ms) when adding a task
Table 2 shows that MEVN performed the loading task in the average range of 324-418ms and
MERN executed the same task with an average interval of 291-407ms. Because these average
ranges overlap it is not possible to conclude that either of the stacks performed better then the
other. However, the difference between the mean average of MERN (350) and MEVN (371) is
21ms and the difference in the margin of error for MERN (58) and MEVN (47) is 11ms. Because
these differences are so small, it is not unreasonable to suspect that the respective stacks’
runtime performance with regards to adding a task, is very similar.
The measurement for updating a task started from when the update button was clicked (event:
clicked) and ended when the list was updated on the User Interface. Similar to the other tests,
the duration was calculated by deducting the start time from the end time. Table 3 displays the
results gathered from the tests for updating a task.
# MERN MEVN
1 497 407
18
2 441 414
3 288 398
4 440 433
5 424 373
6 409 408
7 427 447
8 331 526
9 411 412
10 442 394
11 476 419
12 444 428
13 409 412
14 426 390
15 432 422
16 433 393
17 406 412
18 417 409
19 413 431
20 428 405
Mean 420 417
St. DEV 44 31
ME 19 13
19
Data from Table 4 follow the same pattern as in Table 3 and Table 2, where MERN average
value is 463±61 and MEVN average value is 439±25 and overlapping upper and lower average
bounds prohibits any definite conclusions. Calculated differences in mean averages (24ms) and
margin of errors (36ms) suggest similar runtime performance between MERN and MEVN with
regards to delete-operations.
Research Question 2
To answer the second research question regarding the software stack preference among the
Swedish based companies, a semi-structured survey was conducted, and companies located in
different parts of the country including, Stockholm, Jönköping, Gothenburg and Malmö were
contacted. Out of the approximately 70 companies that were contacted 12 of them responded.
From the semi-structured survey, both qualitative and quantitative data were collected which
in this section will be presented and analyzed.
The first question of the survey aimed to gather preferred software stacks among the
participants. The participants were asked to either choose between MERN and MEVN or both
and if they did not use any of them, they were asked to mention the software stack they use. The
second survey question was asked to get some insight into why they prefer the ones they chose.
The quantitative and qualitative data gathered from the survey are discussed below. Figure 15
displays the preferred software stacks among the respondents of the survey.
MERN
20
Preferred client-side software
11
10
9
8
7
6
5
4
3
2
1
0
React Vue Both
21
Preferred server-side software
11
10
9
8
7
6
5
4
3
2
1
0
Node.js Go Django Java
22
6 Discussion and conclusion
This chapter summarizes the results of the study. Further, it describes the implications and
limitations and also describes the conclusions and recommendations of the study. Suggestions
for further research are given at the end of the chapter.
Discussion of findings
The purpose of conducting the experiment was to find out how fast MERN and MEVN perform
when executing CRUD operations of a single page application in comparison to one another.
Experimentation successfully allowed the collection of primary and empirical data, in this case
the speed of which the respective stack executed the four CRUD operations. For the experiment,
two simple “to-do” applications were built with both MERN and MEVN. Both of the
applications had the same functionality and structure. The backend application which was built
with Node.js and Express framework served both of the front-end applications which were built
in accordance with Vue.js and React.js documentation.
Each corresponding CRUD operation; creating, reading (loading), updating and deleting a task
was executed and the runtime was measured with the two “to-do”-applications. 20 iterations
were performed. The data collected were then averaged to be able to compare the run-time
performance of each task tested between the MERN and MEVN stack. However, it must be
noted that, due to the limited timeframe, the comparison was based on the DOM manipulation
of text-only content and that no image rendering was included in the tests. Therefore the
mentioned results is a performance analysis of the stacks in regards to text-only content
rendering.
The results gathered from the tests which are displayed in section 5.1 ,shows that MERN stack
performed faster than the MEVN stack in loading with a very minimal difference. When
comparing the results gathered from the adding, updating and deleting, it was noted that both
the MERN and MEVN stacks perform very closely to one another. However, reporting exact
differences was not possible but since the average values and the margin of error of both the
stacks were very close, it was safe to say that the performances of both the stacks were very
similar when adding, deleting and updating a task.
The applications were installed on a Cloud-based Virtual Machine to prevent the collection of
invalid data. If the applications were running on a physical machine there could be other
applications running in the background that could affect the performance of the to-do
applications and proving that the measurement was done on equal grounds would not have
been possible. That being mentioned, there were still fluctuations in the data collected from
each test. This could be a result of network latency that according to Popescu, et al. is inevitable
among the applications deployed on cloud-based computing instances. When choosing a
computing instance from the providers such as Google Cloud Platform, Amazon EC2 or
Microsoft Azure, it is possible to choose the specifications of the used instances, but it is not
fully possible to guarantee that network latency will not affect the performance of the
applications (Popescu, et al, 2017) which in this case could explain the fluctuations reported in
the test results. That being said, with 20 iterations it was possible to reach a relatively low
standard deviation in the sample data and measure the run-time performances of both of the
applications.
The purpose with conducting the semi-structured survey was to identify the preferred software
stack among the swedish based companies for better understanding of trends and the relevance
between the various stacks in Sweden. To meet the purpose, a semi structured survey was
conducted and the survey was sent to approximately 65-70 companies in Sweden that were
assumed to be working with web development related services. It’s not possible to give an exact
number on how many were contacted, as some of the companies were asked to forward it
through their relevant channel. Out of all the companies contacted, only 12 people responded,
therefore generalising the result became quite hard, as there could be other preferences and
opinions that are not listed in the results.
Although the number of respondents were low, the results collected relieved that even though
Vue.js and React.js are quite commonly used for building a single page application they are not
always combined with MongoDB , Express and Node.js. Depending on the requirement, the
community behind the software and availability of the specific software developer companies
do change their software combination and they are not strictly sticking to one software stack.
23
Moreover, some of respondents of the surveys mentioned that availability of the developer or
the pre-existing knowledge of the developer was the reason they preferred that software stack,
this indicates that as a developer , one gets to have quite a flexibility in choosing a software
depending on the knowledge and the preference they have.
Limitations
Due to time restrictions the experiment was limited to measure the runtime performance of
rendering text only, not images. Including image-rendering too would better reflect how the
respective software actually performs. Also a larger dataset of measurements would increase
the accuracy of the results.
Not getting enough survey responses from the companies was a major limitation as it severely
limited the ability to draw more general conclusions. Further, not collecting specific data such
as the respondent's position within the company also limited analysis.
Conclusions
In comparison MERN and MEVN both execute CRUD operations in single page applications at
very similar speeds. This implies that runtime performance is not a deciding factor in the choice
between MERN or MEVN, and more specifically between React.js and Vue.js.
According to the results reported in section 5.2, Vue.js and React.js are commonly preferred by
all the responding Swedish based companies, though they are not always preferred in
combination with Node.js or MongoDB. One of the reasons for their preference of Vue.js was
the ease of learning of the framework, a possible reference to how Vue.js' components are
structured. As Vue.js keeps the markup, logic and style separate and allows the developer to
write pure HTML in the template section of the component and pure CSS in the styling section.
This approach decreases the steepness of the learning curve for Vue.js which gives it an
advantage over React.js. The learning curve is an important aspect in a developers choice of
framework as Duvander and Romhagen also reported in their thesis when investigating the
factors that influence developers’ choice of framework. In contrast to Vue.js, React.js uses JSX
and keeps the markup and the logic together allowing to use JavaScript features fully when
building the view of the page. This presents an additional complexity that increases the
steepness of the learning curve for the developers but makes it “powerful” as one of the
respondents stated. React.js' strong focus on JavaScript gives a lot of power to the developer to
manipulate the data and the view, a point also concluded by Wohlgethan referred to in section
3.1.
Further, the community behind a framework is another factor for developers in choosing a
framework or a library. This was reflected in a response from the survey where Vue.js was
preferred because it is not maintained by Facebook. The importance of the community was also
a conclusion also made by Duvander et. all in “what affects developers choice of framework”
referred to in section 3.1.
Ultimately it is not unreasonable to assume that there are not a given set of reasons that
determine the choice of software combinations in the development of web applications, but a
multitude. Besides the ones elaborated upon above, the factors that determine the company’s
choice of software stacks range from what resources are available, the skill sets of the
developers, the clients’ needs and even the individual biased preference of any developer
involved in the decision-making process.
Further research
To give the study more legitimacy and validity a similar study can be performed where the
experiment regarding the run time performance of MERN and MEVN includes image rendering
as well as text rendering, to see whether the results would still be similar to the results gathered
in this study.
In addition, a broader survey study could also be conducted where it is not only limited to
Sweden and only to the developers in the companies but rather includes both freelance
developers as well as companies located all over Scandinavia to get a broader overview on the
software preferences.
24
7 References
Anastasya Kryzhanovska 2019, Pros and Cons of building single page application in 2019
https://gearheart.io/blog/pros-and-cons-building-single-page-applications-2019/
(Acc. December 14, 2019)
Ashleynolan.co.uk 2019, The Front-End Tooling Survey 2019 – Results
https://ashleynolan.co.uk/blog/frontend-tooling-survey-2019-results
(Acc. December 27, 2019)
aws.amazon.com, 2020, Launch a Linux Virtual Machine,
https://aws.amazon.com/getting-started/tutorials/launch-a-virtual-machine/
(Acc. February 18, 2020)
Clusterdb.com 2019, The modern application stack part 5, figure
http://www.clusterdb.com/tag/react
(Acc. December 14, 2019)
Edureka.com, 2019, in React everything is a component, figure 3
https://www.edureka.co/blog/react-components/
(Acc. December 25, 2019)
Eric Wohlgethan 2018, Supporting Web Development Decisions By Comparing Three Major
JavaScript Frameworks: Angular , React and vue.js
http://edoc.sub.uni-
hamburg.de/haw/volltexte/2018/4350/pdf/BA_Wohlgethan_2176410.pdf
(Acc. March 21, 2020)
Expressjs.com (2019) Using template engines with Express
https://expressjs.com/en/guide/using-template-engines.html
(Acc. December 22, 2019)
gs.statcounter.com 2019, Browser Market Share Worldwide,
https://gs.statcounter.com/
(Acc. January 28, 2020)
Ian Allen 2018, The brutal lifecycle of JavaScript frameworks,
https://stackoverflow.blog/2018/01/11/brutal-lifecycle-javascript-frameworks/
(Acc. January 25, 2020)
Jacob Duvander and Oliver Romhagen 2019, What affects the choice of a JavaScript framework
http://www.diva-portal.org/smash/get/diva2:1352822/FULLTEXT01.pdf
(Acc. January 22, 2020)
John Kaga, 2018, Understanding React Components
https://medium.com/the-andela-way/understanding-react-components-
37f841c1f3bb
(Acc. December 25, 2019)
Lilo 2019, 4 different ways to create Vue components
https://dev.to/lilotop/4-different-ways-to-create-vue-components-3nma
(Acc. January 4, 2020)
Margaret Rouse (2019), Software Stack
https://searchapparchitecture.techtarget.com/definition/software-stack
(Acc. December 14, 2019)
Margaret Rouse, 2020, searchservervirtualization.techtarget.com , Virtual Machine,
https://searchservervirtualization.techtarget.com/definition/virtual-machine
(Acc. February 18, 2020)
Mobilunity.com 2019, Vue JS Framework: An Overview of Vue Application
https://mobilunity.com/blog/vue-js-developer-for-hire/
(Acc. January 4, 2020)
Mongodb.com (2019), BSON Types
https://docs.mongodb.com/manual/reference/bson-types/
(Acc. December 18, 2019)
25
P. Patel, 2018, freecodecamp.org, What exactly is Node.js?
https://www.freecodecamp.org/news/what-exactly-is-node-js-ae36e97449f5/
(Acc. December 22, 2019)
Popescu, D., Zilberman, N., & Moore, A. (2017). Characterizing the impact of network latency
on cloud-based applications’ performance,
https://www.repository.cam.ac.uk/bitstream/handle/1810/270654/UCAM-CL-
TR-914.pdf?sequence=1&isAllowed=y
(Acc. February 22, 2020)
Reactjs.org, 2019, Introducing Hooks
https://reactjs.org/docs/state-and-lifecycle.html
(Acc. December 25, 2019)
Rebbeca Bevans 2020, Scribber.com, A guide to experimental design
https://www.scribbr.com/methodology/experimental-design/
(Acc. February 7, 2020)
Shannon Bradshaw, Eoin Brazil, Kristina Chodorov, (2019) MongoDB: The definitive guide,
United States Of America, O’Reilly Media.inc
Shona McCombes 2020, Scribber.com, How to do survey research
https://www.scribbr.com/methodology/survey-research/
(Acc. February 7, 2020)
Simplelearn.com 2019, MongoDB replication and sharding tutorial
https://www.simplilearn.com/replication-and-sharding-mongodb-tutorial-video
(Acc. December 25, 2019)
Stackoverflow.com 2019, Developer Survey Results,
https://insights.stackoverflow.com/survey/2019
(Acc, December 27, 2019)
Vasan Subramanian, (2019) Pro MERN Stack Bangalore, Karnataka, India, ISBN-13
(electronic): 978-1-4842-4391-6
Vuejs.org 2019, Components basics,
https://vuejs.org/v2/guide/components.html
(Acc, January 4, 2020)
Vuejs.org 2019, Computed properties and watchers
https://vuejs.org/v2/guide/computed.html
(Acc, January 4, 2020)
Vuejs.org 2019, Lifecycle diagram
https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram
(Acc, January 4, 2020)
26
8 Appendices
Appendix 1
Screen shot from the survey questions
Appendix 2
Screenshot from the quantitative data gathered from the survey using Google form
Appendix 3
Screenshots from the qualitative data gathered from the survey using Google form
27
Appendix 4
List of developers responded to the survey. The name of respondents is hidden to protect their
privacy. This list is added to share the name of the companies only.
28
Appendix 5
Screenshots from frontend application built with React
29
30
31
32
33
34
Appendix 6 – Screenshots from the frontend application built with Vue.js
35
36
37
38
39
40
Appendix 7 – Screenshots from the backend application created with Node.js and Express
41
42
43