SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

Model Comparison for Delta-Compression
Model Comparison for Delta-CompressionModel Comparison for Delta-Compression
Model Comparison for Delta-CompressionMarkus Scheidgen
 
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
 
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...Raffi Khatchadourian
 
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-13Coen De Roover
 
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_ivNico Ludwig
 
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 ChemistryMarcus Hanwell
 
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 8Raffi Khatchadourian
 
Spring core module
Spring core moduleSpring core module
Spring core moduleRaj Tomar
 
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 JavaMorteza Zakeri
 

La actualidad más candente (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 a Discovering Schemas from Polyglot Persistence Apps

Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBTobias Trelle
 
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 RaceBaruch Sadogursky
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBMongoDB
 
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 @ LinkedInVitaly Gordon
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLsintelliyole
 
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 & MyBatissimonetripodi
 
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 MongoDBTobias Trelle
 
Atlassian Groovy Plugins
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy PluginsPaul King
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworksMD Sayem Ahmed
 
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)Jose Manuel Pereira Garcia
 
Spring Data MongoDB 介紹
Spring Data MongoDB 介紹Spring Data MongoDB 介紹
Spring Data MongoDB 介紹Kuo-Chun Su
 
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 applicationsJeff Durta
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureAlexey Buzdin
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureC.T.Co
 
Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Tobias Trelle
 
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 DataJoachim Van Herwegen
 
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)Woonsan Ko
 

Similar a Discovering Schemas from Polyglot Persistence Apps (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
 

Más de jccastrejon

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 resistenciajccastrejon
 
Model-Driven Cloud Data Storage
Model-Driven Cloud Data StorageModel-Driven Cloud Data Storage
Model-Driven Cloud Data Storagejccastrejon
 
Web2MexADL - CSMR Presentation
Web2MexADL - CSMR PresentationWeb2MexADL - CSMR Presentation
Web2MexADL - CSMR Presentationjccastrejon
 
MexADL - HADAS Presentation
MexADL - HADAS PresentationMexADL - HADAS Presentation
MexADL - HADAS Presentationjccastrejon
 
Presentation of the Instance Model Bus
Presentation of the Instance Model BusPresentation of the Instance Model Bus
Presentation of the Instance Model Busjccastrejon
 

Más de 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
 

Último

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Último (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

Discovering Schemas from Polyglot Persistence Apps

  • 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