A model-driven approach for promoting Cloud PaaS Portability Elias Adriano Nogueira da Silva University of São Paulo(USP-ICMC), São Carlos, Brazil
eliasadriano2010.appspot.com/ Renata P. M. Fortes
University of São Paulo(USP-ICMC), São Carlos, Brazil
[email protected] Daniel Lucrédio
Federal University of São Carlos(UFSCar), São Carlos, Brazil
www.dc.ufscar.br/~daniel June 24, 2013
Abstract
1
Cloud computing has become an important re-
The concept of cloud computing has gained re-
search subject in software engineering. Among
cent attention mainly because of the industry's
the many research gaps related to this new
initiative.
computing model is the lack of portability be-
demic community started to look at these tech-
tween cloud platforms,
nologies more carefully.
which generates the
Introduction
It was only recently that the acaAlthough still in the
Lock-In problem. The Lock-In is the diculty
stage of gaining maturity, the cloud quickly be-
in migrating data and applications from a cloud
came an important research subject in software
platform to another. Current attempts to ad-
engineering. Among the research opportunities
dress this problem revolve around standardiza-
related to software engineering for the cloud
tion of APIs and frameworks.
We propose a
[3] [28], the Data Lock-In problem stands out.
dierent path, using model-driven engineering
Data Lock-In is the diculty of extracting data
(MDE). We selected two cloud platforms and
and programs from one platform to use in an-
built a DSL and a set of automated transfor-
other, and is caused by the dierence between
mations that generate code for each platform,
platforms [3]. The lack of portability that gen-
based on a single portable model. We present
erates the Lock-In is hindering the cloud adop-
the results of two studies. In a rst study, sub-
tion.
jects were asked to use the two versions of the
of creating their systems using some specic
same application, each one generated for a dif-
technology and then start being charged unfair
ferent platform from a single model. The sub-
rates for its use, or even become stuck with a
jects did not notice any dierence between the
technology that may turn out to be inadequate
two versions in terms of functionality. In a sec-
and needs to be abandoned [3].
ond study, we observed that besides facilitating
The development community is afraid
Some eorts to address this problem can be
cloud portability, MDE can increase productiv-
found in the literature.
ity and reusability. These results indicate that
standards for developing cloud-related tech-
MDE may be an alternative to standardization,
nologies [28]. If enough cloud service providers
not only helping to solve portability problems
successfully adhere to the standards, applica-
but also leading to additional benets.
tions could then be more easily ported between
Most try to establish
them.
In this work, however, we suggest the
2
Background
use of Model-Driven Engineering (MDE). With MDE, software engineers can work on a higher
Cloud Computing has the potential to revo-
abstraction level, in conceptual models that
lutionize the way systems are developed and
best capture the essence and logic of the appli-
marketed. Research related to developing ap-
cation.
Applications can be generated by au-
plications for the cloud is relatively new. Many
tomated transformations, thus freeing develop-
studies in the literature are results of research
ers from the complexity required for implemen-
eorts that propose an appropriate formal def-
tation on dierent platforms [11].
By allow-
inition for this technology [28]. However, there
ing developers to focus most of their eorts on
are still many inconsistencies on denitions and
platform-independent development, the Lock-
questions about the concepts and services of-
In problem can be eectively reduced, or even
fered by cloud providers, as well as its use [3].
avoided at all. The choice for MDE over stan-
In relation to service oers, several cloud
dardization is justied by the additional ben-
computing taxonomies were suggested.
ets brought by this approach. The promises
were conceived under a business perspective
Many
of higher quality and productivity [15] could
[25] and include terms such as Haas (Hardware
leverage cloud adoption at the same time the
as a Service ), PaaS (Platform as a Service ),
Lock-In problem is addressed.
DaaS ([Development, Database, Desktop]
as
a Service), IaaS (Infrastructure as a Service ), This paper presents a simple textual domainspecic language (DSL) that allows the specication of applications at a high abstraction level.
We also present the results of a code
generation prototype, built to support Google's App Engine (GAE) and Microsoft Azure plat-
forms.
The prototype demonstrates that the
developed language, despite being simple, can be used as input to a full code generation process targeting a cloud platform. In the future, we expect to build generators for other platforms from the same language, thus helping to improve the portability for other ones.
Section 2 presents concepts re-
lated to cloud computing.
It also discusses
the Data Lock-In problem and some types of cloud portability identied in the literature; Section 3 presents the methodology followed to develop this work.
Section 4 presents the
development of the model-driven approach for promoting cloud PaaS portability and discusses some characteristics of the cloud providers selected for this research, as well as, the code generation process for each platform.
Section
5 presents two studies performed for evaluate the developed approach. Section 6 presents related work.
Section 7 presents some conclud-
ing remarks and future work. Finally, section 8 presents our acknowledgements ans simplied biographies.
as a Service ) or even the generic XaaS (Everything as a Service ). The denitions behind
those terms are very wide and sometimes misunderstood [3], but there are three categories that seem to be more well established:
(i)Software-as-a-Service - SaaS: refers to applications that are delivered to customers in the form of services over the Internet [3, 18]. A SaaS normally operates over a cloud infrastructure, but this is not necessary. Examples of
1
2
3
SaaS include: Google Drive , Flickr , Picasa ,
4 SkyDrive , among others.
(ii)Platform-as-a-Service - PaaS:
The remainder of the paper is organized as follows:
Baas (Business as a Service ), Faas (Framework
the
idea is to provide a full software development platform as a service, including an execution environment, frameworks and dierent useful integrable services [25, 18]. Normally, the service also includes hosting, testing and a distribution channel or market. Some examples are: Google App Engine
5 and Microsoft Azure6 ,
among others.
(iii)Infrastructure as a Service - IaaS: consists in delivering computational infrastructure as a service [25, 18].
The customer ac-
quires - and pays by demand - services for processing, storage and other fundamental com-
1 Google Drive: http://drive.google.com/ 2 Flickr: http://www.flickr.com/ 3 Picasa: http://picasa.google.com/ 4 SkyDrive: http://skydrive.live.com/ 5 GAE: http://code.google.com/appengine 6 Windows Azure: http://www.windowsazure.com/
puting resources,
making it possible to de-
ity and make applications more dicult to be
ploy and run any software, including operating
reused and/or ported.
systems and applications.
Some examples of
plications needs to be highly specialized with
IaaS include: Amazon , GoGrid , IBM Smart-
respect to a particular type of resource (hard-
7
8
9 Cloud , among others.
In practice, some ap-
ware, platform and/or set of services), yielding
Many technological requirements are needed
the problem of
Data Lock-In.
for these models to operate properly. Virtualization technologies, standards and interfaces allow shared access to virtual servers. In fact,
2.1
Data Lock-In
the concept of cloud did not arise as a new tech-
Data Lock-In is the diculty developers face
nology model, but as the integration of tech-
when having to extract their data and pro-
nologies from the past [6], which resulted in a
grams from one cloud platform to run on an-
new way to use and provide computing power
other [3].
as a service through the Internet.
The main
in the PaaS scenario: in order to take advan-
ideas behind this concept are:
Such problem can be seen mostly
to allow com-
tage of a very exible cloud architecture, the
panies to acquire computing resources by de-
applications have to be specically developed
mand; to enable payment according to the uti-
for the chosen platform.
lization volume; and to make it possible for a
der to oer great elasticity, Google App En-
company to completely ignore the knowledge
gine a PaaS provider imposes a specic pro-
about where these resources come from [3].
gramming style and has its own way to manage
For example, in or-
There is still no widely accepted academic
data, and thus an application developed for it
denition for cloud computing [32, 6]. Vaquero
may not be easily ported to a dierent PaaS
et al.
[30] made a thorough study on various
provider, nor can its data. Even if a developer
denitions found in the literature to achieve a
wanted to host such application in his/her own
more complete denition. Although it is still a
private cloud later, great eort would be nec-
proposal, their denition is consistent and com-
essary to rebuild the code, redeploy it and mi-
plete, and therefore is the one used in this work:
grate all the data.
Clouds are a large pool of easily usable and
This occurs because there is not a standard
accessible virtualized resources (such as hard-
technology for the development of software that
ware, development platforms and/or services).
is portable between dierent cloud providers.
These resources can be dynamically recong-
In other words, it is the lack of portability that
ured to adjust to a variable load (scale), allow-
causes the Lock-In.
ing also for an optimum resource utilization.
too complicated to reuse these applications.
For this reason it is still
This pool of resources is typically exploited by
It is not dicult to see why the Lock-In
a pay-per-use model in which guarantees are of-
problem is hindering the adoption of the cloud
fered by the Infrastructure Provider by means
model [24, 22].
of customized SLAs [30].
locked in on a particular platform, not being
The possibility of becoming
This denition, like others found in litera-
able to choose a dierent one later (customer
ture, cites resources in a generic way, as the
Lock-In), puts the developers in a dicult po-
elements that comprise the cloud infrastruc-
sition. They mostly fear being charged abusive
ture.
fees later, or having their applications unavail-
This is the important point regarding
this study, as it suggests a great heterogene-
able due to lack of service quality [3].
ity in these environments, in the sense that the resources used in the cloud can be of dierent types. The applications that use its technolo-
2.2
Types of Portability
gies must also be diverse and responsible for
The main problem caused by the lack of porta-
dierent details of how to use them. This het-
bility is that the work committed to platform-
erogeneity and diversity increase the complex-
specic tasks can not be reused in a dierent
7 Amazon:http://aws.amazon.com/pt/ec2/ 8 GoGrid: http://www.gogrid.com/ 9 http://www.ibm.com/cloud-computing/
platform. Ideally, software development should be more conceptual and less focused on repetitive tasks [17].
The ISO 9126 standard [14], developed to identify
software
quality
attributes,
12 oers
ample, the Brazilian provider Locaweb
denes
specic plans, and the users has the option to
portability in terms of how easy it is to migrate
buy only the package according to the tech-
software from one environment to another. It
nologies they need. If a user chooses to change
(i) Adaptabil-
the provider, he must check if the destination
ity: the software's ability to adapt to dierent
provider supports the same technologies sup-
environments without the need for additional
ported by the current.
has the following sub-attributes:
(ii) Capacity to be Installed:
(iii)Portability of PaaS applications:
identies the ease with which the system can be
users of the PaaS service model must follow a
actions (settings);
installed into a new environment;
(iii)
Coexis-
specic programming style and make use of li-
tence: measures how easily a software can co-
braries and technologies oered by providers.
exists with other software installed in the same
The migration of applications between two
environment;
(iv)
Ability to replace: the sys-
tem is easily replaced by another.
platforms often requires a total reengineering process [28]. The developer must know the de-
In the context of this research, portability is
tails of each platform and libraries, what makes
a key attribute for the improvement and dis-
migration dicult and costly. This is the sce-
semination of the cloud model.
nario where this paper ts in.
In this sense,
[5, 23, 24, 27], four main types of portability in
(iv)Data providers:
the cloud scenario:
there is not a standard for using traditional
(i)Portability of virtual machines between cloud providers: the IaaS model nor-
database management systems (DBMS) in the
we would like to highlight, from the literature
10 to provide mally uses server virtualization computing resources to customers.
Generally
the virtual machines are managed by the customers themselves.
Just migrating a virtual
machine from one provider to another causes little impact on the systems being virtualized, as all that is needed for them to run is a copy of the virtual disk. Format (OVF
The Open Virtualization
11 ) makes this task even easier,
by providing a standard format so that there is little eort to port a virtual machine from one provider to another, as long as both support this format.
(ii)Portability of applications in the context of IaaS: some providers oer, instead of virtual machines (VM), hosting plans that
portability
between
cloud
similarly to the previous item,
cloud [3]. Therefore, data portability between providers is another item to consider.
In the
IaaS case, the user may choose to install his/her own instance of a DBMS, and use it in a single, virtual machine. If elasticity is necessary, the user is responsible for setting up multiple, interconnected servers and dene some kind of distribution scheme.
Another possibility is
to hire a provider that supports a particular DBMS. Thus, just as with the portability of applications, before signing a contract with the provider it is important to ensure that it supports the DBMS in question. Shirazi et al. [27] present a solution based on design standards to allow data portability among some cloud databases. However, the solution is still in the research phase and more studies are needed.
support only a specic technology. Many have plans for hosting Java, Ruby, PHP, among others. In this case, users have no control over the
3
Methodology
VM, i.e., the provider manages the entire in-
In the introductory section of this paper, we
frastructure.
Once applications are deployed,
cited that the industry is seeking standardiza-
and depending on how much conguration is
tion as a possible solution for the Lock-In prob-
needed, a big eort is necessary to change the
lem. Armbrust et al. [3] have suggested stan-
provider, because each provider oers plans ac-
dardization path as a possible solution.
cording to dierent business goals.
problem with this path is that it requires wide
10 Server
For ex-
Virtualization is the technique of running one or more virtual servers on one physical server [7] 11 OVF: http://www.dmtf.org/standards/ovf
adoption.
The
Some cloud providers may wish to
use specic technologies to create solutions that
12 Locaweb: http://www.locaweb.com.br
are aligned with their business requirements
included. Other platforms may be included in
and choose not to follow the standard. Thus,
future iterations.
until this initiative becomes concrete, it is important that we study alternative approaches, not only to explore a dierent path to portability, but to help improve the cloud model and facilitate its adoption. In this context, we propose the use of MDE as an element that removes the link between the application logic and platform details. This decision is justied by the fact that, in addition to presenting an alternative to solve the lockin problem, a model-driven approach can bring additional benets that would not be achieved simply by adopting standardization.
Besides
portability, MDE provides benets in terms of productivity, ease of communication and soft-
A textual concrete syntax was developed for the specication language, using Xtext
13 . We
initially restricted the language to the domain of CRUD operations (basic database access operations:
Create,
Retrieve,
Update,
Delete ),
which are an important part of most applications.
Although it is a simple domain, it en-
compasses the various concepts needed to develop applications for PaaS. It also serves to exercise dierent ways of implementing the same conceptual model, as even for simple CRUD operations there are signicant dierences in the way GAE and Azure deal with persistence. The developed language is completely plat-
ware maintenance, allowing software engineers
form
to work in a higher abstraction level [17].
not need to include details about the PaaS
To meet this goal, we used the following methodology:
independent,
provider.
so
that
developers
do
Details of the platform were auto-
matically introduced by the transformations,
1. Case studies were performed rst, to identify the main concepts of PaaS. These
which were developed using Xtend Fig.
14 .
1 summarizes this methodology, high-
studies involved the careful analysis of dif-
lighting its steps, the work already done and
ferent providers' documentation and the
the work yet to be performed.
development of sample applications for different platforms; 2. Next these concepts were used to prototype a specication language that captures the essence of PaaS applications. This language serves to support the creation of platform-independent models, which developers use to specify an application's structure and logic. This step involves the development of a domain metamodel and a concrete syntax; 3. Based on the case studies and on the specication language, transformations were built to automatically generate code for cloud platforms; and
Figure 1:
Methodology used to develop an
MDE approach to cloud portability. Numbers
4. Tests were performed to verify the conformance between the generated code and the
in rounded rectangles indicate the steps described in Section 3.
platform's requirements. The idea was to follow an incremental model, repeating these four steps for each dierent platform to be studied.
By the time of the
writing of this paper, only GAE's Java-based and Microsoft's Windows Azure platform were
13 Xtext: http://www.eclipse.org/Xtext/ 14 Xtend: http://www.eclipse.org/Xtend/
4
A
Model-Driven
Ap-
proach for Cloud Applications Portability
platform.
Particularly, we wanted to know if
GAE/Azure could deal with the persistence of object-oriented entities, otherwise the DSL would have to be dierent than we initially conceived. Therefore we performed a study to
The approach is based on a common meta-
identify the main characteristics of GAE and
model that abstracts concepts of cloud plat-
Azure.
forms.
This metamodel is the basis of a
domain-specic language (DSL), which is used to create platform-independent models (PIMs).
4.2
and Windows Azure
Portability, in this context, is made possible by the combination between the domain-specic language and automatic transformations. Together, they allow the same model to be used to generate an application for dierent platforms (Fig. 1). Next we discuss these two elements in more detail.
For practical reasons, we focused on the platforms' support for Java.
A DSL for CRUD Operations in Cloud PaaS
Based on the case
studies, to develop CRUD operations for GAE or Azure, there are three points that need special attention: 1.
4.1
Main Characteristics of GAE
Data Persistence: (i)GAE:
There are two options for data
storage in GAE plataform, App Engine
A DSL is a small, usually declarative, language, focused on a particular problem [8]. DSLs have existed for a long time. Mernik, Heering, and Sloane [19] cite examples of the APT language for numerical control, which dates from 195758, and the most famous BNF, or Backus-Naur Form, a language for specifying grammars, es-
tablished in 1959. Since then, several languages have been developed and used, and the literature in this area is very rich [8, 19]. A domain-
Datastore
(NoSQL)
Google
Cloud
GAE's Java
Datastore allows the use of Java Data Objects - JDO
15 and Java Persistence API -
16 standards to specify entities stored JPA
in its database. These interfaces are implemented using the open source access platform Datanucleus
17 . The developer needs
to learn the syntax and restrictions imposed by the platform;
specic language can be textual (allowing to
(ii)Azure:
specify programs) or visual (allowing to spec-
storage solutions
ify diagrams). To study the viability of the approach pre-
and
SQL (relational database).
(a)
Among the Windows Azure
18 we highlight:
Virtualized SQL Server :
it is the
sented in this paper, a DSL for the CRUD
SQL Server DBMS running on a vir-
domain was implemented.
tual machine in Windows Azure en-
As previously dis-
vironment;
cussed, this domain was selected because it encompasses various concepts needed to develop
(b)
applications for the cloud and yet it is not exCRUD
operations,
the
dio and video; and DSL
would
have to support basic entities, with attributes and relationships.
storage through sets
of non-structured bytes, such as au-
cessively complex to implement. For
Blob Storage:
Specialization/generaliza-
tion between types is also very common in conceptual modeling, so we decided to include it, as well as proper support for dierent attribute and relationship multiplicities. However, since the goal was to generate executable code, we had to nd out if these concepts can indeed be implemented in a cloud
(c)
Table Storage:
Tables oer NoSQL
capabilities for applications that require storage of large amount of unstructured data.
15 https://developers.google.com/appengine/ docs/java/datastore/jdo/
16 https://developers.google.com/appengine/docs/java/datastore/jpa/ 17 Datanucleus: http://www.datanucleus.org/ 18 More information about Windows Azure Storage is
available on its website: www.windowsazure.com
Figure 2: DSL Metamodel.
2.
For this study we selected the table stor-
is cheaper in terms of processing and it can be
age model. The tables are accessible from
managed by the platform itself. So for inten-
virtually anywhere via REST and client
sive processing and elasticity this is normally
APIs.
the option of choice for most developers.
Controller Class:
Both GAE and Azure
support the Java Servlets technology. The environments work with the concept of request / response.
Therefore, the model
must be able to capture elements and generate an implementation considering such particularities of these platforms; and 3.
User interface:
Both GAE and Azure of-
Since GAE has support for JDO and JDA even for its NoSQL solution (App Engine Datastore), there is no problem in making the DSL an intuitive object-oriented language, with persistent entities and relationships, as we wanted. Other details are platform-specic implementation choices that could be left to the transformations. Azure's Table Storage, on the other hand, does not have such direct support for re-
fer support for Java server-generated pages
lationships.
(JSP - Java Server Pages). Thus, support
intuitive as possible, we would have to build
for modeling and code generation on the
a layer to manage entity relationships over a
interface should follow this model.
simpler NoSQL database.
So, in order to keep the DSL as
After some discus-
For the interface, business logic and appli-
sions, we decided to follow this path, as shows
cation control, both platforms oer basic Java
the DSL metamodel that resulted from these
support, which is enough for implementing a
studies (Fig. 2).
typical web-based MVC application. persistence,
For the
we wanted to target a NoSQL
Basically, the metamodel in Fig.
2 denes
persistent entities, their properties, relations
database, because its eciency, high scalabil-
and dierent attributes.
ity and lower operational costs[13]. Besides, it
application properties and a division in tabs,
It also denes basic
which group closely related entities together in the generated interface. We decided to make the DSL's concrete syntax textual, due to simplicity, ease of learning and exibility of tools used in its development. Code 1 presents the main elements of the DSL's EBNF grammar used as input to Xtext.
Code 1: Xtext DSL Grammar
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
DomainModel : ( a p p l i c a t i o n=A p p l i c a t i o n ) ? e l e m e n t s += Type ∗ ; Application : ' a p p l i c a t i o n ' name=ID ' { ' ' v e r s i o n ' v e r s i o n = INT ' t i t l e ' t i t l e = STRING t a b s += Tab ∗ '} ' ; Type : En ti t y | SimpleType ; En ti t y : ' e n t i t y ' name = ID ( ' extends ' superType = [ E nt it y ] ) ? ' { ' key=Key p r o p e r t i e s+=Property ∗ '} ' ; Property : ( a n n o t a t i o n s+=Annotation ∗ ) ? ' property ' name=ID ' : ' type = [ Type ] (many ? = ' [ ] ' ) ? ( ' l i s t ' '= ' l i s t =BoolType ) ? ( ' input ' '= ' inputType=InputType v a l u e=STRING) ? ( ' t i t t l e ' '= ' t i t t l e =STRING) ? ;
4.3
Code Generation
Based on the DSL described in the previous section, transformations were built to produce the dierent software components related to the CRUD domain in the selected platforms, as listed next:
(i)GAE Transformations: 1. One JDO-annotated Java class is generated for each persistent entity, including its properties and relationships. Single inheritance is also supported; 2. As
an
alternative
to
JDO,
one
JPA-
annotated Java class is generated for each persistent entity, including its properties and relationships.
Single inheritance is
also supported; 3. One VRaptor-based class is generated for each
persistent
class,
to
serve
as
con-
troller for responding to interface requests. VRaptor [12] is a MVC framework based on Java that facilitates the development of web applications. Each controller class then
redirects
the request
to a
single,
generic, non-generated data-access object, which is responsible for the actual execution of CRUD commands; and 4. Two JSPs are generated for each persistent entity: one for insert/update operations, and one for listing all instances. The JSPs use JQuery
19 to provide quality re-
sponsiveness to the user.
(ii)Azure Transformations: 1. Since Azure does not implement JDO or
According to the grammar, a model denes
JPA, we built a layer to manage entity
an application and a set of persistent entities
relationships.
(Type ).
An Application consists of the at-
tions produce components that sit on the
tributes: name, version, title and tabs. Name
top of this layer. One class for each persis-
and version are information used to generate
tent entity is generated, but using simple
basic platform congurations normally needed
attributes to serve as references to related
to deploy applications in the cloud. The gram-
entities.
mar also describes other elements needed for
ment layer we built resolves these refer-
the specication of persistent entities.
ences during CRUD operations;
This DSL is obviously platform-independent, so that developers can specify the application's logic (at least for the CRUD domain) without worrying about the platform. Next we describe how a set of transformations introduce most details needed for code generation to succeed.
Therefore, the transforma-
Then, the relationship manage-
2. As in the GAE platform, one VRaptorbased class is generated for each persistent entity to serve as controllers for the application; and
19 JQuery: http://jquery.com/
3. As in the GAE platform, two JSPs are gen-
code (represented between and quotes)
erated for each persistent entity, one for
together. Basically this code represents a meta-
insert/update operations, and one for list-
class.
ing all instances. The JSPs here also use
from domain models are used to ll in the in-
JQuery to provide quality responsiveness
formation needed to generate a complete JDO-
to the user;
annotated class. With automated transforma-
When executed, elements that come
tions such as this, it is possible to free the deCode 2 shows a piece of a Xtend transforma-
velopers from repetitive tasks such as program-
tion that produces code for a JDO-annotated
ming an entity class and its setter/getter func-
Java class.
tions.
Code 2: GAE JDO Transformation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
... d e f compile ( E nt i ty e n t i t y ) ` ` ` package com . g a e a p p l i c a t i o n . model ; // i m p o r t i n g l i b r a r i e s FOR p r o p e r t y : e n t i t y . p r o p e r t i e s compileImports ( p r o p e r t y . type ) ENDFOR @PersistenceCapable ( d e t a c h a b l e="t r u e ") // c l a s s name p u b l i c c l a s s e n t i t y . name // i n h e r i t a n c e IF e n t i t y . superType != n u l l extends e n t i t y . superType . name ENDIF { // g e n e r a t i n g i d e n t i f i e r o f the c l a s s @PrimaryKey compileKey ( e n t i t y . key ) FOR p r o p e r t y : e n t i t y . p r o p e r t i e s IF p r o p e r t y . many==true // g e n e r a t i n g p r o p e r t i e s with // l i s t o f o b j e c t s compileProperties ( property ) ELSE // g e n e r a t i n g s i m p l e p r o p e r t i e s compileProperty ( p r o p e r t y ) ENDIF ENDFOR // g e n e r a t i n g g e t s and s e t s compileKeyGetsAndSets ( e n t i t y . key ) FOR p r o p e r t y : e n t i t y . p r o p e r t i e s IF p r o p e r t y . many==true // i f a p r o p e r t y r e t u r n s a l i s t // o f o b j e c t s compileGetList ( property ) compileSetList ( property ) ELSE // i f a p r o p e r t y r e t u r n s b a s i c // t y p e s or only one o b j e c t compileGets ( p r o p e r t y ) compileSets ( property ) ENDIF ENDFOR } ```
5
Evaluation
The approach developed in this work aims at making portability between cloud platforms easier by means of MDE. It also defends the idea that MDE can bring additional benets to cloud application development. This two fold objective led us to perform the evaluation in two parts: a case study, aiming at identifying the benets that MDE can bring to portability; and a controlled experiment, to test if portability can be achieved in a satisfactory way using our approach. These are described next.
5.1
Case Study
This Case Study empirical strategy is the technique where key factors which can aect the results of a proposed approach are identied and documented [34]. The case studies aim to observe a specic attribute or to stablish the relationship between dierent attributes. In our research, the goals of the case study were:
(i) to compare two applications gener-
ated from the same domain model; and (ii) to evaluate the benets of applying the MDE approach in cloud development. For both goals, code analysis was carried out to characterize the development process and determine the differences between the code generated for the two platforms. To illustrate how the transformations work, consider an application that should provide functionality for registering products in an ecommerce system.
A product has an id, a
name, description and price. Code 3 presents
an example of this entity described using the Code 2 mixes Java code (lines 3 and 11), JDO Annotations (lines 8 and 9) and Xtend
developed DSL.
Code 3: Product Domain Model.
1 2 3 4 5 6
e n t i t y Product { pk{ i d : Key ( s t r a t e g y=IDENTITY) } p r o p e r t y name : S t r i n g property d e s c r i p t i o n : String p r o p e r t y p r i c e : Double l i s t = f a l s e } Code 4 presents a JDO-based implementation class for the product. This class was completely generated by the developed transformations.
It contains information processed from
the model (Code 3) and additional platform details, such as the annotations in lines 1, 3 an 4. transformations process. To build transformations it is necessary knowledge about plat-
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
TableServiceEntity ; // Generated C l a s s p u b l i c c l a s s Product extends TableServiceEntity { // a t r i b u t e s p r i v a t e S t r i n g name ; private String description ; p r i v a t e Double p r i c e ; // c o n s t r u c t o r s p u b l i c Product ( ) { t h i s . p a r t i t i o n K e y = " Product " ; } ... }
// . . . g e t t e r s e s e t t e r s . . .
form and its set of library and technologies supported.
But, since the transformations was
built, the programming team only needs to know the DSL simplied syntax. Code 4:
presents a generated interface for creating and
Generated product entity class for
GAE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
@PersistenceCapable ( d e t a c h a b l e=" true " ) public c l a s s Product { @PrimaryKey @Persistent ( valueStrategy = I d G e n e r a t o r S t r a t e g y . IDENTITY) private Key i d ; @Persistent private S t r i n g name ; @Persistent private S t r i n g d e s c r i p t i o n ; @Persistent private Double p r i c e ; }
Similarly, the transformations produce code for the other parts of the chosen domain. Fig. 3 updating products in the running e-commerce example.
The attributes come directly from
the model (Code 3).
. . . g e t t e r s and s e t t e r s . . . Figure 3: JSP for creating / updating a product From the same model it is also possible to Code 5
The important thing to highlight here is
presents a persistent class for the Windows
that the elements and semantics of the domain
Azure platform. It is easily possible to see the
model were sucient to generate functional ap-
dierences between implementations on each
plication for both Azure and GAE platforms.
platform, despite the fact that both applica-
The developer does not have to worry about de-
tions are implemented using the same language
tails about how GAE and Azure deal with per-
(in this case Java).
Theses dierences occurs
sistence, or how the controller works. The anal-
because of the specic technologies adopted by
ysis performed in the generated code for the
the platforms.
applications found that the applications are the
generate Windows Azure Java code.
Code 5:
Generated product entity class for
Windows Azure
1 2 3 4 5
package com . a z u r e a p p l i c a t i o n . model ; import j a v a . u t i l . ∗ ; import com . m i c r o s o f t . windowsazure . services . table . client .
same besides the dierent details of each platform. We made some complementary analyses by calculating the reason between the specication elements and the generated code(REC). That metric allows to determinate the relationship between the domain elements and the generated code. REC is calculated as follows:
With this in mind, the test planning involved
REC =
X
LOC(Gen. code)/
X
the following phases:
N EE(models) (1)
(i)Context Selection:
the experiment oc-
curred in the academic environment.
It was
Where: LOC(Gen. Code) is the total of gener-
performed at the Software Engineering Labo-
ated code and NEE(Models) is the number of
ratory at Federal University of São Carlos;
(ii)Research Question:
model specication elements.
is it possible to
We performed the calculus on dierent ways:
port, with MDE, an application between cloud
on each generated functionality and on com-
platforms so that the nal users do not per-
plete application. We used two applications for
ceive any dierences between the original and
that calculus.
the ported applications?
We found that for each line of
code of the Textual DSL on average was generated 105 implementation lines of code.
(iii)Selection of subjects:
the subjects
O
were selected through convenience sampling i.e.
course this number can change for more or less
the nearest and most convenient people are se-
depending the size of the studied application.
lected as subjects[33]; and
However, from that observations is possible, at
(iv)Design:
Inspired by other reports from
least to see some benets on reducing repetitive
the literature [29], we dened a set of black
codication tasks.
box test cases to serve as a script for the subjects. The idea was to ensure they would use
5.2
Portability evaluation
both versions in a similar way, and also exercise all functions of the application. These are
In the case study described in the previous
conventional test cases, with a description, pre-
section, we observed that portability between
conditions, a set of steps to be performed, and
cloud providers can be achieved through MDE,
the expected results.A total of eleven test cases
at least for a specic domain and after an ini-
were dened.
tial eort of building a complete infrastructure, including a DSL and dierent transformations. We also observed that the gains in productivity are considerable, given the automation power
5.2.2
Execution
The tests were executed in 2 steps:
Step 1 -Preparation -
of MDE transformations. For this part of the evaluation, the goal was to determine if the results of the approach are
In this step the in-
strumentation elements were elaborated: a.
Guidelines:
The material consisted of
satisfactory, in terms of funcionality as seen by
one document with the description of the tasks
the end user.
For portability to be satisfac-
and instructions the subject should follow and
tory, the user should not perceive any dier-
one document with the application description
ence when an application is moved from one
and support material.
platform to another.
b.
Data Collection Instruments:
Data
We followed the experimental phases sug-
collection was performed in two moments. The
gested by Wohlin et al. [33]. The idea was to
rst moment was during test case execution.
take advantage of the solid empirical elements
After each test case description in the task de-
from that methodology for executing ours tests.
scription document, there was a eld where
So the planning was carried out as follows:
subjects would respond if they considered the test case successful or not.
5.2.1
In a second mo-
ment, a questionnaire was given to each sub-
Planning
ject, where he would inform his/her perception
The main idea of the evaluation was to have
on portability. This questionnaire was based on
two versions of the same application: one run-
ISO standard 9126 [14], which denes porta-
ning on Google App Engine, and the other run-
bility as a set of attributes that bear on the
ning on Windows Azure.
ability of software to be transferred from one
Subjects were then
asked to use both versions, and tell if they could
environment to another.
perceive any dierence.
tributes, which are adaptability, installability,
Among its four at-
co-existence and replaceability, we decided to
From this evaluation, we can conclude that
focus on replaceability, as we believe that it is
it was possible to port, by means of an MDE
the most adequate to the goal of this research.
approach, and in the context of the chosen do-
Step 2 - Execution-
Initially, using the
main, an application between cloud platforms
MDE approach, we generated two version of
in such a way that the nal users do not per-
an application for the two platforms supported
ceive the dierences when using the two ver-
by the approach (GAE and Azure).
The ap-
sions. This is particularly interesting if we con-
plication used in this study was dierent from
sider that the underlying storage mechanisms
the one described in Section 5.1. Here we used
are dierent, as discussed in Section 4.2. This
the laboratory analysis domain. The subjects
eectively puts MDE as a viable alternative to
then executed the test cases.
port application between cloud providers.
This study had
ten participants. The execution took one day, including initial training and the lling of the questionnaire.
5.2.3
Data Analyses
All ten subjects were able to use both versions of the application and perform all test cases successfully. Regarding the questionnaire, the results of each question are discussed next.
Question 1 - Do you consider that in terms of functionality the two versions of the application are equivalent? For two applications A and B to be equivalent, the set of functions implemented in A must be equal to the set of functions implemented in B. In this question all subjects answered that the two versions of the application were equivalent in
5.2.4
Threats to validity
Low number of subjects: participated in the tests.
a small set of users
A larger number of
people using the system can lead to the discovery of more fails and dierences.
Simple domain:
the application built in
the case study is relatively small and represents a small problem domain. These elements may have facilitated the analysis, and it is possible that we did not test all situations.
Statistical treatment:
the collected data
did not allow a formal, complete statistical treatment, which would lead to much more solid results.
But we believe the qualitative
analysis has important insight into the approach.
terms of functionality.
Question 2 - Do you consider that in terms of interface the two versions of the application are equivalent? Two applica-
6
tions can be equivalent in terms of functionality
papers related to the portability of applica-
but have dierent interfaces. In this question
tions in cloud computing. Proposals for devel-
all subjects answered that the two versions of
oping applications for cloud basically revolve
the application were equivalent in terms of in-
around two approaches:
terface.
and MDE.
Question 3 - Do you consider that for the same input on each version of the application, the outputs were equal? This
some initiatives gathering eorts for addressing
question evaluates if the systems are equivalent
tributed Management Task Force), which em-
in terms of input and output. In this question
ploys eorts focused on standardizing interac-
all subjects answered that the two versions of
tions between cloud environments by develop-
the application were equivalent in terms of in-
ing specications that deliver architectural se-
put/output.
mantics and implementation details to achieve
Question 4 - Do you consider that the Azure version can be replaced by the GAE version (and vice-versa)? In this
interoperable cloud management between ser-
question all subjects answered that the two ver-
the OCCI-WG (Open Cloud Computing Inter-
sions could be replaced by each other.
face Working Group), which is a protocol and
Related Work
In the literature it is possible to nd several
API standardization
In the path of standardization, there are the Lock-In problem, such as the DMTF (Dis-
vice providers and their consumers. Also proposing standardization, we can cite
API for all kinds of management tasks, and was
platform were responsible for other tasks nec-
created to develop a remote management API
essary for the correct functionality of system.
for IaaS-based services, allowing development
That is, the platforms would be in charge of
of interoperable tools for common tasks includ-
dealing with the distribution, deployment, ex-
ing deployment, autonomic scaling and moni-
ecution, monitoring, scalability, elasticity, etc.
toring. The current release of the Open Cloud Computing Interface is suitable to serve many other models in addition to IaaS, including e.g. PaaS and SaaS.
20 is responsible for developing
IEEE P2301
a standard that will enable portability.
To
achieve this goal, it will group the dierent options (interfaces, tile formats and operation conventions) of the cloud elements into logi-
21 also follows a simi-
cal proles. IEEE P2302
lar path, but to dene the topology, protocols, functionality and governance required to support cloud-to-cloud interoperability and federated (intercloud) operations [16, 31]. Sharma
and
Sood
[26]
present
a
model-
driven approach for interoperability in SaaS. The authors dene the models at dierent abstraction
levels,
based
on
separation
More research issues and approaches related to the development of systems to the cloud model can be found in Armbrust et al. and Silva and Lucrédio [28].
[3]
Cloud comput-
ing is still evolving, and research opportunities are still being identied. Even in this new scenario, is possible to identify a certain alignment between authors.
This work is in agreement
with most MDE-based proposals, which is focus on the PIM-PSM separation.
But in our
understanding, our research has contributions by proposing a practical approach focused on a commercial PaaS provider.
It also provides
a well-dened methodology for including other platforms as well, serving to guide future research.
of
concerns - Computation Independent Model (CIM),
Platform
Independent
Model
and
Platform Specic Model (PSM) building on MDA
22 . Each level can be composed by one or
more models to specify structural, functional and behavioral system. For PIMs a formal def-
7
Concluding remarks and future work
inition of the operations oered by the service is used, which can be accessed through an in-
The lack of portability between cloud appli-
terface that must later be composed with other
cations raises the Lock-In problem.
services to build a complete system. Business
to solve this problem, this paper presented a
rules are specied through the declaration of
model-driven approach for cloud portability.
restrictions, pre-conditions and post-conditions
The cloud technologies and MDE, together, can
and invariants in Object Constraint Language
provide many benets to system developers,
(OCL). After some transformations the PIM is
such as productivity, improved maintenance
then converted to a WSDL PSM, which con-
and documentation, reuse and more.
In order
sists of a specic model description language for web services. The nal step is the transformation of the WSDL PSM into a WSDL. Other approaches: Esparza and Escoí [9] emphasize the importance of a broad, scalable modeling language, and indicates new lines of research for designing self-manageable cloud platforms.
The authors emphasize that the
We spent 3 months building the DSL and the transformations. Despite the high initial costs of such elements [17], they can be reused in the development of new projects and systems. But a quantitative study related to the costbenet of the approach is not on the scope of this research.
ideal would be the developer to capture aspects
The results of the evaluation have shown that
from the application through models and the
MDE can not only promote portability in a way
20 IEEE P2301: grouper.ieee.org/groups/2301/ 21 IEEE P2302: grouper.ieee.org/groups/2302/ 22 www.omg.org/mda/
that users do not perceive dierences between platforms, but also lead to additional benets, mainly productivity.
8
Acknowledgements
and
terson,
Author Biographies FAPESP processes number 2012/04549-4 and for
partially
funding
this
re-
search. Elias Silva has high experience on developing web systems.
He got his bach.
Ariel
Rabkin,
Ion
Stoica,
and
Matei Zaharia. A view of cloud comput-
The authors would like to thank CAPES and 2012/24487-3
Andy Konwinski, Gunho Lee, David Pat-
in computer
science at State University of Southwest Bahia
ing. 53, 2010. [5] Jean Bozman.
Cloud Computing:
The
Need for Portability and Interoperability. IDC Analyze the Future, Sponsored by Red Hat, Inc, 2010.
[6] Yizeng Chen, Xingui Li, and Fangning
and his Masters at Federal University of São
Chen.
Carlos. Now he is phd candidate at University
computing research and application. 2011.
Overview and analysis of cloud
of São Paulo(USP). Renata P. de M. Fortes received the B.Sc. in
[7] Je Daniels.
Server virtualization archi-
Computer Science from the University of São
tecture and implementation.
Paulo, Brazil, in 1982, and the Ph.D. degree
2009.
in Computational Physics, from University of SãoPaulo,SãoCarlos, Brazil, in 1996.
Renata
serves on the Steering Committee of the ACM SIGDOC conference and is a member of the ACM and the Brazilian Computer Society. Daniel Lucrédio got his computer engineer (2002) and M.Sc. in Computer Science (2005) degrees at the Federal University of São Carlos, Brazil, and his PhD (2009) at Univer-
Crossroads,
[8] Van Deursen, , Arie Klint, and Joost Paul and Visser.
Domain-specic languages:
An annotated bibliography. ACM Sigplan, 35, 2000. [9] Javier Esparza and Munoz Escoí. Towards the next generation of model driven cloud platforms. In CLOSER 2011, 2011.
sity of São Paulo, São Carlos, Brazil. During
[10] I Foster, Yong Zhao, I Raicu, and S Lu.
his PhD He realized two doctoral internships:
Cloud Computing and Grid Computing
in George Mason University (VA, USA) and
360-Degree Compared.
Microsoft Research (WA, USA). He has aca-
2008.
In GCE 2008,
demic and industrial experience in computer science (software engineering) working mainly
[11] Robert
France
and
Bernhard
with software reuse, CASE, Model-Driven De-
Model-driven
velopment, component search and component-
Software:
based development.
Computer Society, 2007.
[1] Distribuited
of
Rumpe. Complex
A Research Roadmap.
[12] Alexandre
References
Development
Freire
and
Paulo
IEEE
Silveira.
Vraptor-simple and quick web framework. In 5th Workshop on free software(WSL Managemente
Task
Force,
2012.
2004), 2004.
[13] Jing Han, E Haihong, Guan Le, and Jian
[2] Open Cloud Computing Interface, 2012.
Du.
Survey on NoSQL database.
In 6th
ICPCA 2011, 2011.
[3] Michael Armbrust, Armando Fox, Rean Grith, Anthony D Joseph, Randy Katz,
[14] ISO/IEC9126.
Software product evalua-
Andy Konwinski, Gunho Lee, David Pat-
tion - Quality characteristics and guide-
terson,
lines for their use. ISO Standard, 1991.
Ariel
Rabkin,
Matei Zaharia.
Ion
Stoica,
Above the clouds:
and A
Berkeley view of cloud computing. 2009.
[15] Anneke Kleppe, Warmer Jos, and Bast Wim. MDA Explained, The Model-Driven
[4] Michael Armbrust, Armando Fox, Rean Grith, Anthony D Joseph, Randy Katz,
Architecture:
Practice
Addison-Wesley, 2003.
and
Promise.
[16] N
Loutas,
E
Kamateri,
F
Bosi,
and
[27] M
N
Shirazi,
K Tarabanis. Cloud Computing Interoper-
H Dolatabadi.
ability: The State of Play. In IEEE Cloud-
able
Com 2011, 2011.
Databases. 2012.
[17] D Lucrédio, E S Almeida, and R P M
Data
Ho
Chin
Kuan,
and
Design Patterns to En-
Portability
between
Clouds'
[28] Elias A N Silva and Daniel Lucrédio. Soft-
Fortes. An investigation on the impact of
ware Engineering for the cloud:
MDE on software reuse. In 6th SBCARS
search Roadmap. SBES Brazilian Sympo-
2012. IEEE, 2012.
sium, 2012.
[18] Peter Mell and Tim Grance.
The NIST
A Re-
[29] Liana Silva and Sérgio Soares. Analyzing structure-based techniques for test cover-
Denition of Cloud Computing . 2009.
age on a J2ME software product line. In [19] M Mernik, J Heering, and A M Sloane.
10th LATW'09. IEEE, 2009.
When and how to develop domain-specic [30] Luis
languages. ACM CSUR, 2005.
M
Vaquero,
Luis
Rodero-Merino,
Juan Caceres, and Maik Lindner. A break [20] P Mohagheghi and T Sæ andther.
Soft-
in the clouds. ACM SIGCOMM, 2008.
ware Engineering Challenges for Migration to the Service Cloud Paradigm: Ongoing Work in the REMICS Project.
In
Services (SERVICES), 2011 IEEE World Congress on, pages 507514, 2011.
A review of expe-
riences from applying MDE in industry. In Model Driven Architecture-Foundations and Applications, pages 432443, 2008.
[22] Balakrishna
Narasimhan
and
Ryan
Nichols. State of Cloud Applications and Platforms:
The Cloud Adopters' View.
2011.
[32] Lizhe Wang, Gregor von Laszewski, AnTao, and Cheng Fu. Cloud Computing: a Perspective Study. New Generation Computing, 28(2):137146, 2010.
[33] C Wohlin, P Runeson, M Host, C Ohlsson, B Regnell, and A Wesslén. Experimentation in software engineering: an introduction. 2000. [34] Robert K Yin. Case study research: Design and methods, volume 5. Sage Publi-
[23] Dana Petcu, Georgiana Macariu, Silviu Panica, and Ciprian Craciun.
the intercloud. ACM SIGACT, 2010.
drew Younge, Xi He, Marcel Kunze, Jie
[21] Parastoo Mohagheghi and Vegard Dehlen. Where is the proof ?
[31] Marko Vukoli¢. The byzantine empire in
Portable
cations, Incorporated, 2008. [35] Shuai Zhang, Xuebin Chen, Shufen Zhang,
Cloud applications - From theory to prac-
and Xiuzhen Huo.
tice. Fut. Gen. Comp. Systems, 2012.
tween cloud computing and grid comput-
[24] A Ranabahu and A Sheth. Semantics Centric Solutions for Application and Data Portability in Cloud Computing. In IEEE CloudCom 2010, 2010.
[25] B P Rimal, Eunmi Choi, and I Lumb. A Taxonomy and Survey of Cloud Computing Systems. In INC, IMS and IDC, 2009. NCM '09. Fifth International Joint Conference on, pages 4451, 2009.
[26] Sood M Sharma D Sharma R. Modeling cloud SaaS with SOA and MDA. 2011.
CCIS,
The comparison be-
ing. In ICCASM 2010, 2010.