SlideShare a Scribd company logo
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

Model Comparison for Delta-Compression
Model Comparison for Delta-CompressionModel Comparison for Delta-Compression
Model Comparison for Delta-Compression
Markus 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
 
Resume
ResumeResume
Resume
muddanas
 
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
Coen 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_iv
Nico 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 Chemistry
Marcus 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 8
Raffi Khatchadourian
 
Spring core module
Spring core moduleSpring core module
Spring core module
Raj 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 Java
Morteza Zakeri
 

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
Tobias 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 Race
Baruch Sadogursky
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
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
Vitaly Gordon
 
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
 
Atlassian Groovy Plugins
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy Plugins
Paul King
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworks
MD 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 applications
Jeff Durta
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
C.T.Co
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
Alexey Buzdin
 
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 Data
Joachim Van Herwegen
 
Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
Heiko Behrens
 
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
 
Green dao
Green daoGreen dao
Green dao
Droidcon Berlin
 
Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
Sven Efftinge
 

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

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

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

Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
marufrahmanstratejm
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 

Recently uploaded (20)

Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 

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