SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
An Overview of
ModeShape
                 September 2010


 modeshape.org
Topics

• Why use JCR?
• Why use ModeShape?
• Productization




                        2
What is JCR?
                                  JSR-170 and JSR-283

                • Standard programmatic API: javax.jcr
                • Abstracts where/how the content is stored
                • Best features from databases and file systems




Image credit: David Nuescheler                                   3
Typical uses of JCR

  • Content management systems
  • Portals (e.g., GateIn)
  • Knowledge bases
  • Test management systems
  • Artifact repositories (e.g., BRMS, EDS, ...)




                                                   4
Why use a JCR repository?
      • Flexible data structure
        -   because your data will change

      • Hierarchical graph-based storage
        -   natural organization
        -   flexible schema
        -   handles wide variety of content

      • Search & query
      • Versioning, events, access control,
        referential integrity, locking
      • Standard API
                                              5
Fundamental elements of JCR
                      Repository


              Workspacen           Namespace
                                    Registry

                                   Node Type
                                    Manager

 Sessionm
 Sessionmm
  Session
  Sessionm                          Version
   Sessionm
   Sessionm                Nodes    Manager

                                     Lock
                                    Manager

                                     other
                                    services




                                               6
Why use JCR?

Hierarchical organization
    • Great for natural hierarchies
      - URLs and file systems
      - Dates
      - Composition
      - Catalogs
      - ... many others
    • Examples
      - Files and folders (artifacts)
      - Database schemas
      - Web services
      - XML, YAML, JSON, etc.
                                        7
Why use JCR?

       Flexible schema (part 1)
Each JCR node has:
• Name, path, & identifier
• Properties
   -   name & value(s)                                      Status Report.pdf

   -
                                              jcr:primaryType      nt:file
       property types                         jcr:mixinTypes       [acme:tagged]


• Child nodes
                                              jcr:createdBy        jsmith
                                              jcr:created          2010-07-31T08:10:14

   -   same-name-siblings                     acme:tags            ["status", "projectX"]


   -   may be ordered

• One or more node types
   -   primary type and mixins
   -   dictate whether properties and children can be added/removed
   -   can be changed at any time on each node

                                                                                            8
Why use JCR?

       Flexible schema (part 2)
JCR node types:
 • define the allowed properties
   -   name (or unrestricted with “*”)   LONG, DOUBLE,
                                         DECIMAL, DATE,
   -   type                              BOOLEAN, NAME,
   -   number of values                  PATH, URI,

   -   searchability                     REFERENCE,
                                         WEAK_REFERENCE,
   -   mandatory                         UNDEFINED

 • define the allowed child nodes
   -   name (or unrestricted with “*”)
   -   required node types
   -   same-name-siblings allowed
 • inheritance and mixed together
                                                           9
Why use JCR?

      Query languages

• XPath             From JCR 1.0,
                    deprecated in JCR 2.0
• JCR-SQL
• JCR-SQL2
                    New in JCR 2.0
• JCR-JQOM




                                            10
Why use JCR?

JCR-SQL2 is based upon SQL
              JCR-SQL2                    SQL
              node type                   table
              property                    column
              node                        row


 Nodes appear as rows in those tables that
 correspond to the node’s types
  - a node can appear as a row in multiple tables
  - often a complete picture of a node requires joining multiple tables
  - other joins are possible, such as ancestors, descendants,
     equivalent properties

                                                                          11
Why use JCR?

        JCR-SQL2 features
•    Select
•    Joins (INNER, LEFT/RIGHT OUTER)
•    Property & name criteria
•    Child & descendant node criteria
•    Comparison operators (=,<,<=,>,>=,<>, LIKE)
• Logical operators (AND, OR, NOT)
• Full-text search criteria
• Variables

    ModeShape accepts all valid JCR-SQL2 queries
                                                   12
Why use JCR?

     Sample JCR-SQL2 queries
SELECT * FROM [car:Car] WHERE [car:model] LIKE ‘%Toyota%’ AND [car:year] >= 2006




SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file]
WHERE NAME() LIKE $name




SELECT file.*,content.* FROM [nt:file] AS file
JOIN [nt:resource] AS content ON ISCHILDNODE(content,file)
WHERE NAME(file) LIKE 'q*.2.vdb'




                                                                                   13
Why use JCR?

Other benefits
• Versioning
• Notification (events)
• Access control
• Referential integrity
• Locking
• Standard API



                          14
Using JCR 2.0 repositories
       • Uses JCR 2.0 API & Java SE ServiceLoader
       • No implementation dependencies
Java code:
   Properties parameters = new Properties();
   parameters.load(...);          // load from a file
   Repository repository = null;
   for (RepositoryFactory factory : ServiceLoader.load(RepositoryFactory.class)) {
       repository = factory.getRepository(parameters);
       if (repository != null) break;
   }


Properties for ModeShape:
   org.modeshape.jcr.URL = file:path/to/configRepository.xml?repositoryName=MyRepository
                                         or
   org.modeshape.jcr.URL = jndi:/jcr/local?repositoryName=MyRepository
                                                                                           15
Why use ModeShape?
   • Supports JCR 2.0
   • Storage options
   • Access existing content thru JCR
   • Unified repository via federation
   • Automatically derives content
   • Lightweight, embeddable & clusterable
   • Plays well with JBoss AS


                                         16
Why use ModeShape?

                              Storage options
                                     JCR Client
                                     Application                            • Store content where it
                                           JCR API                            makes sense for your
                                                                              application
                                ModeShape
                               JCR Repository                               • Multiple connectors
                                                                              out-of-the-box

                                        ?                                   • Easy enough to write
                                                                              your own
                                                                            ?
 Transient Infinispan      JBoss         JDBC          File      SVN         Other
in-memory data grid      Cache        Database       System   repository   systems
  storage  for storage for storage   for storage


                                                                                                     17
Why use ModeShape?

          Storage examples
• Store in RDBMS using Hibernate
  - Conventional and well-understood
• Store in Infinispan
  - Scalability, fault tolerance and speed of a data grid
• Store artifacts on file system
  - Images, documents, downloads, static pages, etc.
  - Serve files via file system, bypassing JCR altogether
  - Manipulate content through JCR (e.g., CMS)
• Transient in-memory
  - Lightweight and fast for embedded uses
  - Often used with imported data
                                                            18
Why use ModeShape?

       Accessing other data
                    JCR Client
                    Application                          • Use JCR API to
                          JCR API                          access data from
                                                           other systems
                ModeShape
                JCR Repository                           • Leave the data
                                                           where it is

                       ?                                 • Just another
                                                           connector

                                                ?
   JCR         JDBC    File         SVN         Other
repositories Database System      repository   systems
              schema


                                                                              19
Why use ModeShape?

       Access examples

• Access files already stored on file system
  - Use the JCR API within your application
  - Use search and query
• Access database metadata (live)
  - Leverage session-based caching
  - Consistent model
• Access (& manipulate) content in other JCRs
  - Got data already in another JCR system?
  - Makes most sense with federation ...

                                                20
Why use ModeShape?

                                     Federation

                                        JCR Client               • Use JCR API to
                                        Application
                                                                   access a virtual,
                                              JCR API              unified repository

                                    ModeShape                    • Leave the data
                                       Federated                   where it is
                                       Repository




                                                                             ?
 Transient      JBoss     Infinispan     JDBC      JDBC     File    SVN       Other
in-memory      Cache       data grid  Database Database   System repository systems
  storage    for storage for storage for storage schema



                                                                                       21
Why use ModeShape?

      Federation examples
• Own some content, access other data
  - Use the JCR API consistently throughout your application
  - Single virtual and unified repository
  - Leverage JCR’s flexible schema
  - Use search and query across all data
  - Leave existing data where it lives
• Use the best data store for each kind of data
  - Use the JCR API consistently throughout your application
  - Single virtual and unified repository
  - Match access and capabilities with requirements

                                                               22
Why use ModeShape?

        Query languages

• XPath                        From JCR 1.0,
                               deprecated in JCR 2.0
• JCR-SQL
• JCR-SQL2
                               New in JCR 2.0
• JCR-JQOM
• Full-text search           Like web search engines, based on
                             JCR-SQL2’s full-text search
                             expression grammar


         Separate parsers, but all use the same
     canonical AST, planner, optimizer, and processor
                                                                 23
Why use ModeShape?

           Enhanced JCR-SQL2
ModeShape accepts all valid JCR-SQL2 queries, plus:
  •   Additional joins (FULL OUTER, CROSS)
  •   Subqueries in criteria
  •   SELECT [DISTINCT]
  •   UNION/INTERSECT/EXCEPT [ALL]
  •   LIMIT and OFFSET
  •   DEPTH and PATH criteria
  •   REFERENCE criteria
  •   IN and NOT IN
  •   BETWEEN val1 [EXCLUSIVE] AND val2 [EXCLUSIVE]
  •   Arithmetic expressions in criteria

                                                      24
Why use ModeShape?

Sample enhanced JCR-SQL2 queries
 SELECT * FROM [car:Car] WHERE [car:model] LIKE ‘%Toyota%’ AND [car:year] >= 2006


 SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file]
 WHERE PATH() LIKE $path


 SELECT file.*,content.* FROM [nt:file] AS file
 JOIN [nt:resource] AS content ON ISCHILDNODE(content,file)
 WHERE PATH(file) LIKE '/files/q*.2.vdb'


 SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file]
 WHERE PATH() IN (
     SELECT [vdb:originalFile] FROM [vdb:virtualDatabase]
     WHERE [vdb:version] <= $maxVersion
     AND CONTAINS([vdb:description],'xml OR xml maybe')
 )


                                                                                    25
Why use ModeShape?

Use the data you already have
• Repositories frequently store files
  - Many of those files contain structured information
• How do you use what’s inside those files?
  - Download and parse in your application?
  - Rely upon full-text search?
  - Do it whenever the files change?
• ModeShape sequencers get at that info
  - Parsers for various file formats
  - Extract the information and place into graph form using node types
  - Store derived information inside the repository
  - Access, navigate,and query
                                                                    26
Why use ModeShape?

      Sequencer examples

• Web service artifacts
  - WSDL, XSD, WS Policy, ...
• Data management artifacts
  - DDL, Teiid models & VDBs, services, data sources, ...
• Software artifacts
  - JAR, WAR, EAR, POM, manifests, Java source/classfiles, ...
• Rule and process artifacts
  - Business/technical rules, functions, flows, DSLs, ...


                                                                27
Why use ModeShape?

Automatically extract content
                                      5) access


                                              4) store


     1) upload




            2) notify




                          3) derive


             Sequencers



                                                         28
Why use ModeShape?

  ModeShape sequencers
                  (out-of-the-box)

• ZIP, JAR, EAR, and WAR files
• Java class and source files
• DDL files
• Teiid Relational models and VDBs
• Text files (CSV and delimited)
                                     Sequencer API
• JCR Compact Node Definition files      sequencer
                                     implementation
• XML documents
• Microsoft Office® documents
• Image metadata

                                                      29
Why use ModeShape?

 ModeShape components

• JCR engine
• RESTful service
• WebDAV service
• JDBC driver
• JBoss AS 5.1 kit
• Eclipse plugin

                               30
Why use ModeShape?

         RESTful service

• Remote access to repository
• Standard HTTP methods
  - GET repositories
  - GET workspaces
  - GET, PUT, POST, DELETE nodes
  - POST queries
• JSON responses (HTML, XML planned)
• Uses RESTEasy
• Deployed as a WAR
                                       31
Why use ModeShape?

            WebDAV service

• Remote access to repository
• Can mount as network share
• Download, upload, create or delete files
• Navigate, create and delete folders
• Deployed as a WAR



                                            32
Why use ModeShape?

                   JDBC driver

• Query repository via JDBC using JCR-SQL2
• Connects to one workspace
• Can be used in same VM as ModeShape
   jdbc:jcr:jndi:{path/in/jndi}?repositoryName={name}&user=...

• Or in remote VM
   jdbc:jcr:http://{hostname}:{port}/modeshape-rest/?repositoryName={name}&user=...

• Supports result set metadata
• Supports database metadata

                                                                                33
Why use ModeShape?

             JBoss AS kit
•   JCR service (the engine)
•   JOPR plugin for management & monitoring
•   REST service (WAR)
•   WebDAV service (WAR)
•   JAAS authentication & authorization
•   JDBC data source (1 per workspace)
•   JCR API on classpath
•   Sequencers
•   Disk-based storage by default (HSQLDB & Lucene)
•   Packaged as ZIP
•   Script to install into a profile
                                                      34
Why use ModeShape?

JOPR plugin




                     35
Productization

             SOA-P 5.1 EDS
• Includes Teiid & ModeShape
• Slightly customized ModeShape JBoss AS kit
  - modified configuration and select connectors, sequencers
• Repository for data service artifacts
  - relational model files
  - virtual database (VDB) files
• Other files can be managed (but not sequenced)
  - XSD, WSDL, CSV, docs, etc.
• Publish and unpublish from JBoss Dev Studio
• Can access repository content from within VDBs
                                                             36
Productization

                       BRMS 5.1

• Offer ModeShape as an option (in place of Jackrabbit)
• Same binaries as in SOA-P 5.1
• Enable future enhancements (if desired):
  -   sequencers for rules, flows, DSLs, etc.
  -   query via JDBC
  -   connectors & federation
  -   RESTful access




                                                      37
Questions?

Más contenido relacionado

La actualidad más candente

plProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerplProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancer
elliando dias
 
Introduction to storage
Introduction to storageIntroduction to storage
Introduction to storage
sagaroceanic11
 
AIXpert - AIX Security expert
AIXpert - AIX Security expertAIXpert - AIX Security expert
AIXpert - AIX Security expert
dlfrench
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Jignesh Shah
 
Cassandra background-and-architecture
Cassandra background-and-architectureCassandra background-and-architecture
Cassandra background-and-architecture
Markus Klems
 

La actualidad más candente (20)

LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...
LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...
LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...
 
Parquet Hadoop Summit 2013
Parquet Hadoop Summit 2013Parquet Hadoop Summit 2013
Parquet Hadoop Summit 2013
 
Persistent Memory Development Kit (PMDK) Essentials: Part 1
Persistent Memory Development Kit (PMDK) Essentials: Part 1Persistent Memory Development Kit (PMDK) Essentials: Part 1
Persistent Memory Development Kit (PMDK) Essentials: Part 1
 
plProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerplProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancer
 
Introduction to storage
Introduction to storageIntroduction to storage
Introduction to storage
 
InfiniFlux vs influxdb 비교 테스트 결과 2016 12월-v2
InfiniFlux vs influxdb 비교 테스트 결과 2016 12월-v2InfiniFlux vs influxdb 비교 테스트 결과 2016 12월-v2
InfiniFlux vs influxdb 비교 테스트 결과 2016 12월-v2
 
Looking towards an official cassandra sidecar netflix
Looking towards an official cassandra sidecar   netflixLooking towards an official cassandra sidecar   netflix
Looking towards an official cassandra sidecar netflix
 
AIXpert - AIX Security expert
AIXpert - AIX Security expertAIXpert - AIX Security expert
AIXpert - AIX Security expert
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
 
Exploring MongoDB & Elasticsearch: Better Together
Exploring MongoDB & Elasticsearch: Better TogetherExploring MongoDB & Elasticsearch: Better Together
Exploring MongoDB & Elasticsearch: Better Together
 
Oracle Cloud is Best for Oracle Database - High Availability
Oracle Cloud is Best for Oracle Database - High AvailabilityOracle Cloud is Best for Oracle Database - High Availability
Oracle Cloud is Best for Oracle Database - High Availability
 
Why you should care about data layout in the file system with Cheng Lian and ...
Why you should care about data layout in the file system with Cheng Lian and ...Why you should care about data layout in the file system with Cheng Lian and ...
Why you should care about data layout in the file system with Cheng Lian and ...
 
JCR - Java Content Repositories
JCR - Java Content RepositoriesJCR - Java Content Repositories
JCR - Java Content Repositories
 
The Tofu Interconnect D for the Post K Supercomputer
The Tofu Interconnect D for the Post K SupercomputerThe Tofu Interconnect D for the Post K Supercomputer
The Tofu Interconnect D for the Post K Supercomputer
 
엑셜 보안 설정과 Node xl 오류 고치기
엑셜 보안 설정과 Node xl 오류 고치기엑셜 보안 설정과 Node xl 오류 고치기
엑셜 보안 설정과 Node xl 오류 고치기
 
/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repository/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repository
 
Cassandra background-and-architecture
Cassandra background-and-architectureCassandra background-and-architecture
Cassandra background-and-architecture
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldPostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized World
 
Managing Millions of Tests Using Databricks
Managing Millions of Tests Using DatabricksManaging Millions of Tests Using Databricks
Managing Millions of Tests Using Databricks
 
Oracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAsOracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAs
 

Destacado

Introduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache JackrabbiIntroduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache Jackrabbi
Jukka Zitting
 
ModeShape 3 overview
ModeShape 3 overviewModeShape 3 overview
ModeShape 3 overview
Randall Hauch
 
Aem hub oak 0.2 full
Aem hub oak 0.2 fullAem hub oak 0.2 full
Aem hub oak 0.2 full
Michael Marth
 
JPA avec Cassandra, grâce à Achilles
JPA avec Cassandra, grâce à AchillesJPA avec Cassandra, grâce à Achilles
JPA avec Cassandra, grâce à Achilles
Ippon
 

Destacado (10)

Introduction to JCR
Introduction to JCR Introduction to JCR
Introduction to JCR
 
Introduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache JackrabbiIntroduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache Jackrabbi
 
ModeShape 3 overview
ModeShape 3 overviewModeShape 3 overview
ModeShape 3 overview
 
JCR In 10 Minutes
JCR In 10 MinutesJCR In 10 Minutes
JCR In 10 Minutes
 
SharePoint Connector – Setup and Configuration
SharePoint Connector – Setup and ConfigurationSharePoint Connector – Setup and Configuration
SharePoint Connector – Setup and Configuration
 
Aem hub oak 0.2 full
Aem hub oak 0.2 fullAem hub oak 0.2 full
Aem hub oak 0.2 full
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGi
 
Hosting huge amount of binaries in JCR
Hosting huge amount of binaries in JCRHosting huge amount of binaries in JCR
Hosting huge amount of binaries in JCR
 
JPA avec Cassandra, grâce à Achilles
JPA avec Cassandra, grâce à AchillesJPA avec Cassandra, grâce à Achilles
JPA avec Cassandra, grâce à Achilles
 
AgilePM® - Agile Project Management - Foundation
AgilePM® - Agile Project Management - FoundationAgilePM® - Agile Project Management - Foundation
AgilePM® - Agile Project Management - Foundation
 

Similar a An Overview of ModeShape

Scotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloScotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao Pablo
Julian Arocena
 
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
James Chen
 
Hadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 MarchHadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 March
MapR Technologies
 
Understanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache DrillUnderstanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache Drill
DataWorks Summit
 
Serialization and performance by Sergey Morenets
Serialization and performance by Sergey MorenetsSerialization and performance by Sergey Morenets
Serialization and performance by Sergey Morenets
Alex Tumanoff
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Software Guru
 

Similar a An Overview of ModeShape (20)

Introduction to CQ5
Introduction to CQ5Introduction to CQ5
Introduction to CQ5
 
Scotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloScotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao Pablo
 
What is persistence in java
What is persistence in javaWhat is persistence in java
What is persistence in java
 
J2EE Online Training
J2EE Online TrainingJ2EE Online Training
J2EE Online Training
 
JSON in der Oracle Datenbank
JSON in der Oracle DatenbankJSON in der Oracle Datenbank
JSON in der Oracle Datenbank
 
Java Classroom Training
Java Classroom TrainingJava Classroom Training
Java Classroom Training
 
Java Online Training
Java Online TrainingJava Online Training
Java Online Training
 
Java online training from hyderabad
Java online training from hyderabadJava online training from hyderabad
Java online training from hyderabad
 
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
 
Hadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 MarchHadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 March
 
Understanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache DrillUnderstanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache Drill
 
Introduction to Apache Drill
Introduction to Apache DrillIntroduction to Apache Drill
Introduction to Apache Drill
 
Serialization and performance by Sergey Morenets
Serialization and performance by Sergey MorenetsSerialization and performance by Sergey Morenets
Serialization and performance by Sergey Morenets
 
Best Java Online Training in India
Best Java Online Training in IndiaBest Java Online Training in India
Best Java Online Training in India
 
Java Online Training
Java Online TrainingJava Online Training
Java Online Training
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
 
Hibernate
HibernateHibernate
Hibernate
 

Último

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General 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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

An Overview of ModeShape

  • 1. An Overview of ModeShape September 2010 modeshape.org
  • 2. Topics • Why use JCR? • Why use ModeShape? • Productization 2
  • 3. What is JCR? JSR-170 and JSR-283 • Standard programmatic API: javax.jcr • Abstracts where/how the content is stored • Best features from databases and file systems Image credit: David Nuescheler 3
  • 4. Typical uses of JCR • Content management systems • Portals (e.g., GateIn) • Knowledge bases • Test management systems • Artifact repositories (e.g., BRMS, EDS, ...) 4
  • 5. Why use a JCR repository? • Flexible data structure - because your data will change • Hierarchical graph-based storage - natural organization - flexible schema - handles wide variety of content • Search & query • Versioning, events, access control, referential integrity, locking • Standard API 5
  • 6. Fundamental elements of JCR Repository Workspacen Namespace Registry Node Type Manager Sessionm Sessionmm Session Sessionm Version Sessionm Sessionm Nodes Manager Lock Manager other services 6
  • 7. Why use JCR? Hierarchical organization • Great for natural hierarchies - URLs and file systems - Dates - Composition - Catalogs - ... many others • Examples - Files and folders (artifacts) - Database schemas - Web services - XML, YAML, JSON, etc. 7
  • 8. Why use JCR? Flexible schema (part 1) Each JCR node has: • Name, path, & identifier • Properties - name & value(s) Status Report.pdf - jcr:primaryType nt:file property types jcr:mixinTypes [acme:tagged] • Child nodes jcr:createdBy jsmith jcr:created 2010-07-31T08:10:14 - same-name-siblings acme:tags ["status", "projectX"] - may be ordered • One or more node types - primary type and mixins - dictate whether properties and children can be added/removed - can be changed at any time on each node 8
  • 9. Why use JCR? Flexible schema (part 2) JCR node types: • define the allowed properties - name (or unrestricted with “*”) LONG, DOUBLE, DECIMAL, DATE, - type BOOLEAN, NAME, - number of values PATH, URI, - searchability REFERENCE, WEAK_REFERENCE, - mandatory UNDEFINED • define the allowed child nodes - name (or unrestricted with “*”) - required node types - same-name-siblings allowed • inheritance and mixed together 9
  • 10. Why use JCR? Query languages • XPath From JCR 1.0, deprecated in JCR 2.0 • JCR-SQL • JCR-SQL2 New in JCR 2.0 • JCR-JQOM 10
  • 11. Why use JCR? JCR-SQL2 is based upon SQL JCR-SQL2 SQL node type table property column node row Nodes appear as rows in those tables that correspond to the node’s types - a node can appear as a row in multiple tables - often a complete picture of a node requires joining multiple tables - other joins are possible, such as ancestors, descendants, equivalent properties 11
  • 12. Why use JCR? JCR-SQL2 features • Select • Joins (INNER, LEFT/RIGHT OUTER) • Property & name criteria • Child & descendant node criteria • Comparison operators (=,<,<=,>,>=,<>, LIKE) • Logical operators (AND, OR, NOT) • Full-text search criteria • Variables ModeShape accepts all valid JCR-SQL2 queries 12
  • 13. Why use JCR? Sample JCR-SQL2 queries SELECT * FROM [car:Car] WHERE [car:model] LIKE ‘%Toyota%’ AND [car:year] >= 2006 SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file] WHERE NAME() LIKE $name SELECT file.*,content.* FROM [nt:file] AS file JOIN [nt:resource] AS content ON ISCHILDNODE(content,file) WHERE NAME(file) LIKE 'q*.2.vdb' 13
  • 14. Why use JCR? Other benefits • Versioning • Notification (events) • Access control • Referential integrity • Locking • Standard API 14
  • 15. Using JCR 2.0 repositories • Uses JCR 2.0 API & Java SE ServiceLoader • No implementation dependencies Java code: Properties parameters = new Properties(); parameters.load(...); // load from a file Repository repository = null; for (RepositoryFactory factory : ServiceLoader.load(RepositoryFactory.class)) { repository = factory.getRepository(parameters); if (repository != null) break; } Properties for ModeShape: org.modeshape.jcr.URL = file:path/to/configRepository.xml?repositoryName=MyRepository or org.modeshape.jcr.URL = jndi:/jcr/local?repositoryName=MyRepository 15
  • 16. Why use ModeShape? • Supports JCR 2.0 • Storage options • Access existing content thru JCR • Unified repository via federation • Automatically derives content • Lightweight, embeddable & clusterable • Plays well with JBoss AS 16
  • 17. Why use ModeShape? Storage options JCR Client Application • Store content where it JCR API makes sense for your application ModeShape JCR Repository • Multiple connectors out-of-the-box ? • Easy enough to write your own ? Transient Infinispan JBoss JDBC File SVN Other in-memory data grid Cache Database System repository systems storage for storage for storage for storage 17
  • 18. Why use ModeShape? Storage examples • Store in RDBMS using Hibernate - Conventional and well-understood • Store in Infinispan - Scalability, fault tolerance and speed of a data grid • Store artifacts on file system - Images, documents, downloads, static pages, etc. - Serve files via file system, bypassing JCR altogether - Manipulate content through JCR (e.g., CMS) • Transient in-memory - Lightweight and fast for embedded uses - Often used with imported data 18
  • 19. Why use ModeShape? Accessing other data JCR Client Application • Use JCR API to JCR API access data from other systems ModeShape JCR Repository • Leave the data where it is ? • Just another connector ? JCR JDBC File SVN Other repositories Database System repository systems schema 19
  • 20. Why use ModeShape? Access examples • Access files already stored on file system - Use the JCR API within your application - Use search and query • Access database metadata (live) - Leverage session-based caching - Consistent model • Access (& manipulate) content in other JCRs - Got data already in another JCR system? - Makes most sense with federation ... 20
  • 21. Why use ModeShape? Federation JCR Client • Use JCR API to Application access a virtual, JCR API unified repository ModeShape • Leave the data Federated where it is Repository ? Transient JBoss Infinispan JDBC JDBC File SVN Other in-memory Cache data grid Database Database System repository systems storage for storage for storage for storage schema 21
  • 22. Why use ModeShape? Federation examples • Own some content, access other data - Use the JCR API consistently throughout your application - Single virtual and unified repository - Leverage JCR’s flexible schema - Use search and query across all data - Leave existing data where it lives • Use the best data store for each kind of data - Use the JCR API consistently throughout your application - Single virtual and unified repository - Match access and capabilities with requirements 22
  • 23. Why use ModeShape? Query languages • XPath From JCR 1.0, deprecated in JCR 2.0 • JCR-SQL • JCR-SQL2 New in JCR 2.0 • JCR-JQOM • Full-text search Like web search engines, based on JCR-SQL2’s full-text search expression grammar Separate parsers, but all use the same canonical AST, planner, optimizer, and processor 23
  • 24. Why use ModeShape? Enhanced JCR-SQL2 ModeShape accepts all valid JCR-SQL2 queries, plus: • Additional joins (FULL OUTER, CROSS) • Subqueries in criteria • SELECT [DISTINCT] • UNION/INTERSECT/EXCEPT [ALL] • LIMIT and OFFSET • DEPTH and PATH criteria • REFERENCE criteria • IN and NOT IN • BETWEEN val1 [EXCLUSIVE] AND val2 [EXCLUSIVE] • Arithmetic expressions in criteria 24
  • 25. Why use ModeShape? Sample enhanced JCR-SQL2 queries SELECT * FROM [car:Car] WHERE [car:model] LIKE ‘%Toyota%’ AND [car:year] >= 2006 SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file] WHERE PATH() LIKE $path SELECT file.*,content.* FROM [nt:file] AS file JOIN [nt:resource] AS content ON ISCHILDNODE(content,file) WHERE PATH(file) LIKE '/files/q*.2.vdb' SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file] WHERE PATH() IN ( SELECT [vdb:originalFile] FROM [vdb:virtualDatabase] WHERE [vdb:version] <= $maxVersion AND CONTAINS([vdb:description],'xml OR xml maybe') ) 25
  • 26. Why use ModeShape? Use the data you already have • Repositories frequently store files - Many of those files contain structured information • How do you use what’s inside those files? - Download and parse in your application? - Rely upon full-text search? - Do it whenever the files change? • ModeShape sequencers get at that info - Parsers for various file formats - Extract the information and place into graph form using node types - Store derived information inside the repository - Access, navigate,and query 26
  • 27. Why use ModeShape? Sequencer examples • Web service artifacts - WSDL, XSD, WS Policy, ... • Data management artifacts - DDL, Teiid models & VDBs, services, data sources, ... • Software artifacts - JAR, WAR, EAR, POM, manifests, Java source/classfiles, ... • Rule and process artifacts - Business/technical rules, functions, flows, DSLs, ... 27
  • 28. Why use ModeShape? Automatically extract content 5) access 4) store 1) upload 2) notify 3) derive Sequencers 28
  • 29. Why use ModeShape? ModeShape sequencers (out-of-the-box) • ZIP, JAR, EAR, and WAR files • Java class and source files • DDL files • Teiid Relational models and VDBs • Text files (CSV and delimited) Sequencer API • JCR Compact Node Definition files sequencer implementation • XML documents • Microsoft Office® documents • Image metadata 29
  • 30. Why use ModeShape? ModeShape components • JCR engine • RESTful service • WebDAV service • JDBC driver • JBoss AS 5.1 kit • Eclipse plugin 30
  • 31. Why use ModeShape? RESTful service • Remote access to repository • Standard HTTP methods - GET repositories - GET workspaces - GET, PUT, POST, DELETE nodes - POST queries • JSON responses (HTML, XML planned) • Uses RESTEasy • Deployed as a WAR 31
  • 32. Why use ModeShape? WebDAV service • Remote access to repository • Can mount as network share • Download, upload, create or delete files • Navigate, create and delete folders • Deployed as a WAR 32
  • 33. Why use ModeShape? JDBC driver • Query repository via JDBC using JCR-SQL2 • Connects to one workspace • Can be used in same VM as ModeShape jdbc:jcr:jndi:{path/in/jndi}?repositoryName={name}&user=... • Or in remote VM jdbc:jcr:http://{hostname}:{port}/modeshape-rest/?repositoryName={name}&user=... • Supports result set metadata • Supports database metadata 33
  • 34. Why use ModeShape? JBoss AS kit • JCR service (the engine) • JOPR plugin for management & monitoring • REST service (WAR) • WebDAV service (WAR) • JAAS authentication & authorization • JDBC data source (1 per workspace) • JCR API on classpath • Sequencers • Disk-based storage by default (HSQLDB & Lucene) • Packaged as ZIP • Script to install into a profile 34
  • 36. Productization SOA-P 5.1 EDS • Includes Teiid & ModeShape • Slightly customized ModeShape JBoss AS kit - modified configuration and select connectors, sequencers • Repository for data service artifacts - relational model files - virtual database (VDB) files • Other files can be managed (but not sequenced) - XSD, WSDL, CSV, docs, etc. • Publish and unpublish from JBoss Dev Studio • Can access repository content from within VDBs 36
  • 37. Productization BRMS 5.1 • Offer ModeShape as an option (in place of Jackrabbit) • Same binaries as in SOA-P 5.1 • Enable future enhancements (if desired): - sequencers for rules, flows, DSLs, etc. - query via JDBC - connectors & federation - RESTful access 37