SlideShare a Scribd company logo
1 of 28
ExSchema
Discovering Schemas from Polyglot
     Persistence Applications

     Juan Castrejón - Université de Grenoble
Objective
  Discover schemas from the source code
    of polyglot persistence applications
                          Source
                           code


    Relational   Graph   Document    Column-    Key-Value
       DB         DB        DB      Family DB      DB
                                                            2
Why?
          Polyglot persistence applications
              are becoming widespread
                                             Schema-less datastores
But for their development and maintenance,
software engineers have to deal with…         Non-standard APIs
                                             Implicit schemas described
                                                 in the source code
                                                                   3
How?                                         ExSchema

                                              MetaLayer
                                            Representation



                   Declarations         Updates        Repositories       Annotations
                    Analyzer            Analyzer        Analyzer           Analyzer

Analyze project structure
 and update operations
                                         Application source code
                             Neo4j API        MongoDB API          HBase API

                              JPA API          Spring Data     CouchDB API
                                                                                  4
MetaLayer
                                         *
                                                      *
                                      Set                      Attribute
                                                          *
                                         *                        *
                                         *
                               *     Struct                   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.
                                                                                                     5
Results
     PDF file



                Spring Roo scripts
                 (JPA, MongoDB, Neo4j)

                                     6
Demonstration
  import org.neo4j.graphdb.Node;
                                                                                 Neo4j
  import org.neo4j.graphdb.Relationship;

  class ActorImpl implements Actor {
    private static final String NAME_PROPERTY = "name”;

      private final Node underlyingNode;                                Declaration
      public void setName( final String name ) {

      }
        underlyingNode.setProperty( NAME_PROPERTY, name );                                        Update
      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 );
  …
  }                                                    https://github.com/neo4j-examples/imdb
                                                                                          7
Demonstration      Neo4j




        PDF file           8
Demonstration             Neo4j




      Spring Roo script
                                  9
Demonstration                                                Spring Data Neo4j
   import org.springframework.data.annotation.Indexed;
   import org.springframework.data.graph.annotation.NodeEntity;
   import org.springframework.data.graph.annotation.RelatedToVia;
   import org.springframework.data.graph.core.Direction;

   @NodeEntity
   public class Actor {              Annotation
       @Indexed(indexName="actor_id")
       private String id;
       private String name;

       @RelatedToVia(type=Participation.RELATIONSHIP_TYPE,
                                                                          Declaration
       direction=Direction.OUTGOING , elementClass=Participation.class)
       Iterable<Participation> participations;
   …
   }
                                               https://github.com/neo4j-examples/cineasts
                                                                                    10
Demonstration      Spring Data Neo4j




        PDF file                11
Demonstration       Spring Data Neo4j




      Spring Roo script          12
Demonstration Spring Data MongoDB
    import javax.persistence.ManyToOne;
    import org.springframework.roo.addon.layers.repository.mongo.RooMongoEntity;

    @RooMongoEntity                      Annotation
    public class Post {
      private String idContact;
      private String postGeoStamp;
      private Date postTimeStamp;
      private String idPost;                    Declaration
        @ManyToOne
        private Content content;
    …
    }


                      http://vargas-solar.imag.fr/academika/cloud-data-management/
                                                                              13
Demonstration Spring Data MongoDB
   import fr.imag.mynet.domain.Post;
   import java.util.List;
   import org.springframework.roo.addon.layers.repository.mongo.RooMongoRepository;

   @RooMongoRepository(domainType = Post.class)
   public interface PostRepository {                               Repository
       List<fr.imag.mynet.domain.Post> findAll();
   }




                          http://vargas-solar.imag.fr/academika/cloud-data-management/
                                                                                  14
Demonstration Spring Data MongoDB



             PDF file
                              15
Demonstration Spring Data MongoDB



         Spring Roo script
Demonstration                                                                 HBase
   import org.apache.hadoop.hbase.client.HTable;
   import org.apache.hadoop.hbase.client.Put;
   import org.apache.hadoop.hbase.util.Bytes;

   public class PutExample {
     public static void main(String[] args) throws IOException {
     HTable table = new HTable(conf, "testtable");
     Put put = new Put(Bytes.toBytes("row1"));                       Declaration
       put.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"), Bytes.toBytes("val1"));
       put.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual2"), Bytes.toBytes("val2"));   Update
       table.put(put);
   …
   }


                        https://github.com/larsgeorge/hbase-book/tree/master/ch03
                                                                             17
Demonstration   HBase


 PDF file


                        18
Demonstration                                                CouchDB
   import com.fourspaces.couchdb.Database;
   import com.fourspaces.couchdb.Document;
   import com.fourspaces.couchdb.Update;

   public class UpdateTest {
     Database foo;                                 Declaration
       public void createTestDB() {
         Document testDoc = new Document();

        testDoc.put("_id", "test_data");
        testDoc.put("Field1", "Default");
        testDoc.put("Field2", "Default");                  Update
        foo.saveDocument(testDoc);
   …
   }
                                            https://github.com/mbreese/couchdb4j   19
Demonstration   CouchDB


 PDF file


                      20
Demonstration                                              MongoDB+JPA
    import javax.persistence.Entity;
    import org.springframework.data.mongodb.crossstore.RelatedDocument;

    @Entity
    public class Customer {                Annotation
      @Id private Long id;
      private String firstName;
      private String lastName;
                                           Declaration
      @RelatedDocument
      private SurveyInfo surveyInfo;
    …
    }


  https://github.com/SpringSource/cloudfoundry-samples/tree/master/cross-store
                                                                          21
Demonstration      MongoDB+JPA




        PDF file
                            22
Demonstration        MongoDB+JPA




      Spring Roo script
                              23
Test applications
  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.git
  HBase:
    - 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.git
  Relational:
    - 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/)          Industrial application
    - 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:   24
  the SOS platform. In CAiSE’12, volume 7328 of LNCS, pages 160–174. Springer, 2012)
Limitations
Based on project structure and update operations
      (Queries and get operations not considered)

 Based on programming styles of test applications
           (Heavily relies on local variables)

       Limited associations between entities
(Besides Neo4j’s relationships and MongoDB cross-store)
                                                    25
Future work
     Analysis of queries and get operations

   Support additional languages besides Java

Increase support for different programming styles
                                               26
Implementation
  https://code.google.com/p/exschema/



                  Eclipse JDT
                  Eclipse AST



                                Spring Data
                                              27
Contact

    Juan.Castrejon@imag.fr


                             28

More Related Content

What's hot

Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Raffi Khatchadourian
 

What's hot (10)

Model Comparison for Delta-Compression
Model Comparison for Delta-CompressionModel Comparison for Delta-Compression
Model Comparison for Delta-Compression
 
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
 
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
 
Resume
ResumeResume
Resume
 
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
 
New c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_ivNew c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_iv
 
Avogadro: Open Source Libraries and Application for Computational Chemistry
Avogadro: Open Source Libraries and Application for Computational ChemistryAvogadro: Open Source Libraries and Application for Computational Chemistry
Avogadro: Open Source Libraries and Application for Computational Chemistry
 
Introduction to new features in java 8
Introduction to new features in java 8Introduction to new features in java 8
Introduction to new features in java 8
 
Spring core module
Spring core moduleSpring core module
Spring core module
 
SQLite and object-relational mapping in Java
SQLite and object-relational mapping in JavaSQLite and object-relational mapping in Java
SQLite and object-relational mapping in Java
 

Similar to ExSchema

Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
MongoDB
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
intelliyole
 
Powerful persistence layer with Google Guice & MyBatis
Powerful persistence layer with Google Guice & MyBatisPowerful persistence layer with Google Guice & MyBatis
Powerful persistence layer with Google Guice & MyBatis
simonetripodi
 
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBBedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
Tobias Trelle
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
Alexey Buzdin
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
C.T.Co
 

Similar to ExSchema (20)

Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
Pure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RacePure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools Race
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
Scalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedInScalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedIn
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
 
Powerful persistence layer with Google Guice & MyBatis
Powerful persistence layer with Google Guice & MyBatisPowerful persistence layer with Google Guice & MyBatis
Powerful persistence layer with Google Guice & MyBatis
 
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBBedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
 
Atlassian Groovy Plugins
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy Plugins
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworks
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)
 
Spring Data MongoDB 介紹
Spring Data MongoDB 介紹Spring Data MongoDB 介紹
Spring Data MongoDB 介紹
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Morphia, Spring Data & Co.
Morphia, Spring Data & Co.
 
Describing configurations of software experiments as Linked Data
Describing configurations of software experiments as Linked DataDescribing configurations of software experiments as Linked Data
Describing configurations of software experiments as Linked Data
 
Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
 
Relevance trilogy may dream be with you! (dec17)
Relevance trilogy  may dream be with you! (dec17)Relevance trilogy  may dream be with you! (dec17)
Relevance trilogy may dream be with you! (dec17)
 
Green dao
Green daoGreen dao
Green dao
 
Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
 

More from jccastrejon (6)

Lengua y sueños mesoamericanos-Armas de resistencia
Lengua y sueños mesoamericanos-Armas de resistenciaLengua y sueños mesoamericanos-Armas de resistencia
Lengua y sueños mesoamericanos-Armas de resistencia
 
Model-Driven Cloud Data Storage
Model-Driven Cloud Data StorageModel-Driven Cloud Data Storage
Model-Driven Cloud Data Storage
 
Web2MexADL - CSMR Presentation
Web2MexADL - CSMR PresentationWeb2MexADL - CSMR Presentation
Web2MexADL - CSMR Presentation
 
MexADL - HADAS Presentation
MexADL - HADAS PresentationMexADL - HADAS Presentation
MexADL - HADAS Presentation
 
Presentation of the Instance Model Bus
Presentation of the Instance Model BusPresentation of the Instance Model Bus
Presentation of the Instance Model Bus
 
MexADL
MexADLMexADL
MexADL
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

ExSchema

  • 1. ExSchema Discovering Schemas from Polyglot Persistence Applications Juan Castrejón - Université de Grenoble
  • 2. Objective Discover schemas from the source code of polyglot persistence applications Source code Relational Graph Document Column- Key-Value DB DB DB Family DB DB 2
  • 3. Why? Polyglot persistence applications are becoming widespread Schema-less datastores But for their development and maintenance, software engineers have to deal with… Non-standard APIs Implicit schemas described in the source code 3
  • 4. How? ExSchema MetaLayer Representation Declarations Updates Repositories Annotations Analyzer Analyzer Analyzer Analyzer Analyze project structure and update operations Application source code Neo4j API MongoDB API HBase API JPA API Spring Data CouchDB API 4
  • 5. MetaLayer * * Set Attribute * * * * * Struct 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. 5
  • 6. Results PDF file Spring Roo scripts (JPA, MongoDB, Neo4j) 6
  • 7. Demonstration import org.neo4j.graphdb.Node; Neo4j import org.neo4j.graphdb.Relationship; class ActorImpl implements Actor { private static final String NAME_PROPERTY = "name”; private final Node underlyingNode; Declaration public void setName( final String name ) { } underlyingNode.setProperty( NAME_PROPERTY, name ); Update 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 ); … } https://github.com/neo4j-examples/imdb 7
  • 8. Demonstration Neo4j PDF file 8
  • 9. Demonstration Neo4j Spring Roo script 9
  • 10. Demonstration Spring Data Neo4j import org.springframework.data.annotation.Indexed; import org.springframework.data.graph.annotation.NodeEntity; import org.springframework.data.graph.annotation.RelatedToVia; import org.springframework.data.graph.core.Direction; @NodeEntity public class Actor { Annotation @Indexed(indexName="actor_id") private String id; private String name; @RelatedToVia(type=Participation.RELATIONSHIP_TYPE, Declaration direction=Direction.OUTGOING , elementClass=Participation.class) Iterable<Participation> participations; … } https://github.com/neo4j-examples/cineasts 10
  • 11. Demonstration Spring Data Neo4j PDF file 11
  • 12. Demonstration Spring Data Neo4j Spring Roo script 12
  • 13. Demonstration Spring Data MongoDB import javax.persistence.ManyToOne; import org.springframework.roo.addon.layers.repository.mongo.RooMongoEntity; @RooMongoEntity Annotation public class Post { private String idContact; private String postGeoStamp; private Date postTimeStamp; private String idPost; Declaration @ManyToOne private Content content; … } http://vargas-solar.imag.fr/academika/cloud-data-management/ 13
  • 14. Demonstration Spring Data MongoDB import fr.imag.mynet.domain.Post; import java.util.List; import org.springframework.roo.addon.layers.repository.mongo.RooMongoRepository; @RooMongoRepository(domainType = Post.class) public interface PostRepository { Repository List<fr.imag.mynet.domain.Post> findAll(); } http://vargas-solar.imag.fr/academika/cloud-data-management/ 14
  • 15. Demonstration Spring Data MongoDB PDF file 15
  • 16. Demonstration Spring Data MongoDB Spring Roo script
  • 17. Demonstration HBase import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.util.Bytes; public class PutExample { public static void main(String[] args) throws IOException { HTable table = new HTable(conf, "testtable"); Put put = new Put(Bytes.toBytes("row1")); Declaration put.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"), Bytes.toBytes("val1")); put.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual2"), Bytes.toBytes("val2")); Update table.put(put); … } https://github.com/larsgeorge/hbase-book/tree/master/ch03 17
  • 18. Demonstration HBase PDF file 18
  • 19. Demonstration CouchDB import com.fourspaces.couchdb.Database; import com.fourspaces.couchdb.Document; import com.fourspaces.couchdb.Update; public class UpdateTest { Database foo; Declaration public void createTestDB() { Document testDoc = new Document(); testDoc.put("_id", "test_data"); testDoc.put("Field1", "Default"); testDoc.put("Field2", "Default"); Update foo.saveDocument(testDoc); … } https://github.com/mbreese/couchdb4j 19
  • 20. Demonstration CouchDB PDF file 20
  • 21. Demonstration MongoDB+JPA import javax.persistence.Entity; import org.springframework.data.mongodb.crossstore.RelatedDocument; @Entity public class Customer { Annotation @Id private Long id; private String firstName; private String lastName; Declaration @RelatedDocument private SurveyInfo surveyInfo; … } https://github.com/SpringSource/cloudfoundry-samples/tree/master/cross-store 21
  • 22. Demonstration MongoDB+JPA PDF file 22
  • 23. Demonstration MongoDB+JPA Spring Roo script 23
  • 24. Test applications 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.git HBase: - 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.git Relational: - 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/) Industrial application - 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: 24 the SOS platform. In CAiSE’12, volume 7328 of LNCS, pages 160–174. Springer, 2012)
  • 25. Limitations Based on project structure and update operations (Queries and get operations not considered) Based on programming styles of test applications (Heavily relies on local variables) Limited associations between entities (Besides Neo4j’s relationships and MongoDB cross-store) 25
  • 26. Future work Analysis of queries and get operations Support additional languages besides Java Increase support for different programming styles 26
  • 27. Implementation https://code.google.com/p/exschema/ Eclipse JDT Eclipse AST Spring Data 27
  • 28. Contact Juan.Castrejon@imag.fr 28