ExSchema - ICSM'13
-
Upload
jccastrejon -
Category
Technology
-
view
256 -
download
0
description
Transcript of ExSchema - ICSM'13
ExSchemaDiscovering and Maintaining
Schemas from Polyglot Persistence Applications
Juan Castrejón, Genoveva Vargas-Solar, Christine Collet, Rafael LozanoUniversité de Grenoble, LIG-LAFMIA, CNRS, Grenoble INP, Tecnológico de Monterrey
2
ObjectiveDiscover external schemas from the
source code of polyglot persistence applications
3
ObjectiveDiscover external schemas from the
source code of polyglot persistence applications
High-level view of the data entitiesmanaged by a program
(Developer’s point of view)
4
ObjectiveDiscover external schemas from the
source code of polyglot persistence applications
Document DB
Column-Family DB
GraphDB
Source code
RelationalDB
Key-Value DB
5
Why?Polyglot persistence applications
are becoming widespread
Schema-less datastores
Non-standard APIs
Implicit schemas describedin the source code
But for their development and maintenance,software engineers have to deal with…
M. Fowler and P. Sadalage, NoSQL Distilled: A Brief Guide to the Emerging World of Polyglot Persistence. Pearson Education, 2012.
6
https://github.com/neo4j-examples/imdb
Exampleimport org.neo4j.graphdb.Node;import org.neo4j.graphdb.Relationship;
class ActorImpl implements Actor { private static final String NAME_PROPERTY = "name”;
private final Node underlyingNode;
public void setName( final String name ) { underlyingNode.setProperty( NAME_PROPERTY, name ); }
public Role createRole( final Actor actor, final Movie movie, final String roleName ) final Node actorNode = ((ActorImpl) actor).getUnderlyingNode(); final Node movieNode = ((MovieImpl) movie).getUnderlyingNode(); final Relationship rel = actorNode.createRelationshipTo( movieNode, RelTypes.ACTS_IN );…}
Neo4j(Graph data store)
Declaration
Update
7
How?
Declarations Analyzer
Updates Analyzer
Repositories Analyzer
MetaLayer Representation
ExSchema
Neo4j API MongoDB API HBase API
JPA API Spring Data CouchDB API
Application source code
Annotations Analyzer
Analyze project structure and update operations
8
MetaLayer
Set
Struct
Attribute
Relationship
*
*
*
*
*
**
**
Based on: P. Atzeni, F. Bugiotti, and L. Rossi. Uniform access to non-relational database systems: the SOS platform. In CAiSE’12, volume 7328 of LNCS, pages 160–174. Springer, 2012.
9
MetaLayer
10
ResultsPDF file
Spring Roo scripts(JPA, MongoDB, Neo4j)
11
ResultsGit repository analysis for schema evolution
(Tags and Branches)
12
Demonstration• Detailed demonstration (12min)
• Brief demonstration (3min)
13
Neo4j: - https://github.com/neo4j-examples/cineasts.git - https://github.com/neo4j-examples/imdb.git - https://github.com/neo4j-examples/java-astar-routing.git - https://github.com/neo4j-examples/java-dijkstra.git - https://github.com/neo4j-examples/java-tree-traverse.git - MyNetContacts (http://vargas-solar.imag.fr/academika/cloud-data-management/)MongoDB: - https://github.com/mongolab/mongodb-driver-examples.gitHBase: - https://github.com/larsgeorge/hbase-book.git (ch03) - https://github.com/SpringSource/spring-hadoop-samples.git (original-samples/hbase-crud)CouchDB: - https://github.com/mbreese/couchdb4j.gitRelational: - Indvalid-core (http://www.indvalid.com/)Relational + MongoDB: - https://github.com/SpringSource/cloudfoundry-samples.git (cross-store) - MyNet (http://vargas-solar.imag.fr/academika/cloud-data-management/) - Indvalid-dao (http://www.indvalid.com/) Neo4j + MongoDB + Relational: - twitter-spring - twitter-polyglot(Based on: P. Atzeni, F. Bugiotti, and L. Rossi. Uniform access to non-relational database systems: the SOS platform. In CAiSE’12, volume 7328 of LNCS, pages 160–174. Springer, 2012)
Industrial application
Test applications
14
LimitationsBased on project structure and update operations
Based on programming styles of test applications
(Queries and get operations not considered)
(Heavily relies on local variables)
Limited associations between entities(Besides Neo4j’s relationships and MongoDB cross-store)
15
Future work
Analysis of queries and get operations
Support additional languages besides Java
Increase support for different programming styles
16
Implementation
Eclipse JDTEclipse AST
Spring Data
https://code.google.com/p/exschema/