SlideShare a Scribd company logo
Data Access Layer
and Schema Definitions
Luciano Resende
lresende@shutterfly.com
lresende@apache.org
http://lresende.blogspot.com/
About

 Luciano Resende
          •  Staff Software Engineer – Shutterfly, Inc.
          •  Member – Apache Software Foundation
          •  Committer: Apache Tuscany, Wink, Nuvem, PhotoArk




December 8, 2011                                                MongoSV 2011   2
MongoDB Characteristics

 •      Scalability
 •      Simplicity
 •      Flexible Schema
 •      Low TCO




December 8, 2011           MongoSV 2011   3
MongoDB initial POCs


                                                                                    .NET	
  
                                                                                    Component	
  
                                                                                    	
  
                                                                                    	
  




                                                                                               firstName	
  
                                            first_name	
  
                                                                                                              MongoDB	
  



                                                                                              firstname	
  

                                   Java	
                                           Java	
  
                                   Component	
                                      Component	
  
                                   	
                                               	
  
                                   	
                                               	
  




Floor	
  plan	
  image	
  from	
  :	
  h3p://benchmarkoffices.com/floorplans.htm	
  
December 8, 2011                                                                                         MongoSV 2011       4
The Platform

 •  Applications will interact with
    MongoDB persistence via
    services
          •  Enforce a consistent schema
             across multiple applications
             and cross-platform                       Services	
  
 •  Data Access Layer
          •  Data Access Layer that in         Data	
  Access	
  Layer	
  
             conjunction with UDDL
             abstracts the persistence layer
             allowing for more flexible and
                                                        UDDL	
  
             clean code
 •  A cross platform data schema
    definition (text DSL)
          •  Simple human (& machine)
             readable language to describe
             our domain model entities


December 8, 2011                                                      MongoSV 2011   5
Schema Definition
Schema Definition – Why using Text DSL

 •  Platform independent data definition.
 •  (Annotated) POJO (JAXB, JPA, Morphia) has too much noises and
    is abuse-prone. We want to enforce the patterns.
 •  XSD is too complicated and it doesn’t fit all for web 2.0
 •  We need a simple human (& machine) readable language to
    describe our domain model to provide/promote:
          •  Service-friendly DTO, Persistence (RDB and NoSQL), Governance,
             Reuse, Validation, MVC, Best Practice, Documentation
 •  We call the DSL as Universal Data Definition Language (UDDL).
          •  Unify Data Definition across different platform application domains




December 8, 2011                                                          MongoSV 2011   7
Our decision: Textual DSL

 •      Derived from an Apache licensed open source project Sculptor
          •  http://fornax.itemis.de/confluence/display/fornax/Sculptor+%28CSC%29
 •      Easy to learn, intuitive syntax of the textual DSL, based on the concepts
        from DDD.
 •      Textual DSL has a lot of productivity benefits over graphical tools
 •      Quick development round trip, short feedback loop
 •      Generation of complete application from a single model, not only fragments
        that are hard to fit in to the overall design
 •      Supports JPA (oracle/mysql/postgresql)/MongoDB/JAXB/Spring/SpringMVC
 •      Great extensibility and customization
 •      Based on Eclipse Xtext/Xtend/Xpand code generation framework
 •      Can be used with text editor or any IDE, but DSL editor with error highlight,
        code completion, and outline is provided for Eclipse users
 •      Documentation w/ diagrams for domain model
 •      No runtime magic is built into the tools (generated code can be used without
        the tooling)

December 8, 2011                                                              MongoSV 2011   8
Schema Definition - The idea

                                                                                                 4

                                                                                                                             metadata	
  
                        POJO	
                    XSD	
                 Protocol	
  
                                                                                                                Domain	
                                            1.    Persistence	
  
                                                                      Buffer/ThriT	
  
                                                                                                                                                                    2.    DTO	
  
                                                                                                                Model	
  
                       JSON	
                 Textual	
  DSL	
                                                                                                      3.    Mapping	
  
                      Schema	
                 (such	
  as	
  
                                                                            DDL	
                                                                                   4.    IntrospecFon	
  
                                               Sculptor)	
  
                                                                                                                                                                    5.    ValidaFon	
  
                                                                                                                                                                    6.    MVC/UI	
  
                                                                                                            2
                                                                                                                                        1

                                     CRUD	
                                             DTO	
  
                                                                                         DTO	
  
                                                                                           DTO	
  
                     REST	
  
                     Root	
          Locate	
  
                                                                                                                       3                                                          RDB	
  
                                                               REST	
                                                                EnFty	
  
                   Resource	
                                  Sub-­‐                 CRUD	
                                           EnFty	
  
                                                             Resource	
                                                                  EnFty	
  
                                                               REST	
  
                                                               Sub-­‐                            CRUD	
                                                                        MongoDB	
  
                                                             Resource	
  



                                                                                                                                 Generated	
  arFfacts	
  

                                                                                                                                                 Java	
  code	
  



                                                                                            Code	
  
                                   uddl	
                                                 generaFon	
  
                                                                                                                                            ConfiguraFon	
  files	
  

                                                                                          templates	
  
                                                                                                                                            Documents	
  
                                                                                                                                        (UML	
  diagrams,	
  HTML	
  
December 8, 2011                                                                                                                                  docs)	
                     MongoSV 2011   9
Schema Definition - Sample
 Application AddressBook {
        basePackage=com.shutterfly.model
                                                                                                                   Persistence	
  in	
  
        Module addressbook {
          hint="store=mongodb”                                                                                         use…	
  
          Entity Contact {
                   dto
                   mappedName="contact"
                   String id key;
                   String userId ! nullable indexed;
                                                                                                                            EnFty	
  
                   String prefix;
                   String firstName;
                   String middleName;
                   String lastName;                                                                                       Required	
  
                   String company;
                                                                                                                           Indexes	
  
                   - @ContactType type;
                   - @Gender gender;
                   List<String> groups; //group names
                   - List<@ContactEmail> emails;                                                                       Embedded	
  and	
  
                   - List<@ContactAddress> addresses;                                                                   References	
  
                   @'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(com.shutterfly.model.common.jaxb.adapter.UTCDateXmlAdapter.class)'
                   Timestamp created mappedName="updtime";
                   @'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(com.shutterfly.model.common.jaxb.adapter.UTCDateXmlAdapter.class)'
                   Timestamp lastUpdated mappedName="instime";
          }
          BasicType ContactEmail {
                   String label;
                   Boolean isPrimary;
                   String emailAddress ! nullable indexed;                                                             Embedded	
  and	
  
          }
 }                                                                                                                      References	
  




December 8, 2011                                                                                                                                MongoSV 2011   10
Schema Definition – Generated Java Code
 @Generated("uddl:AddressBook/addressbook/Contact")
 @XmlRootElement
 @XmlAccessorType(javax.xml.bind.annotation.XmlAccessType.FIELD)
 @Entity(value = "contact", noClassnameStored = true)
 public class Contact implements Serializable, Cloneable {
   @Id
   private String id;
   @XmlElement()
   private String userId;
   @XmlElement()
   private String prefix;
   @XmlElement()
   private String firstName;
   @XmlElement()
   private String middleName;
   @XmlElement()
   private String lastName;
   @XmlElement()
   private String company;
   @XmlElement()
   private List<String> groups = new ArrayList<String>();
   @XmlJavaTypeAdapter(com.shutterfly.model.common.jaxb.adapter.UTCDateXmlAdapter.class)
   @XmlElement(name = "updtime")
   @Property("updtime")
   private Date created;
   @XmlJavaTypeAdapter(com.shutterfly.model.common.jaxb.adapter.UTCDateXmlAdapter.class)
   @XmlElement(name = "instime")
   @Property("instime")
   private Date lastUpdated;
   @XmlElement()
   private ContactType type;
   @XmlElement()
   private Gender gender;
  @XmlElementWrapper(name = "emails")
   @XmlElement(name = "email")
   @Embedded
   private List<ContactEmail> emails = new ArrayList<ContactEmail>();
   @XmlElementWrapper(name = "addresses")
   @XmlElement(name = "address")
   @Embedded
   private List<ContactAddress> addresses = new ArrayList<ContactAddress>();

     …
 }




December 8, 2011                                                                           MongoSV 2011   11
Schema Definition - Documentation




December 8, 2011                     MongoSV 2011   12
DSL language development

                                                SemanFc	
  
                                                 model	
                                                                            Generated	
  arFfacts	
  
                                        	
  
                                  Grammar	
  
                                  Language	
                                                    Eclipse	
  Model	
  
  Load/save	
  
                                    (DSL)	
                                                    Workflow	
  Engine	
                       Java	
  code	
  
                                      	
                                                            (MWE)	
  
Parse/validate	
  

                                                                            Eclipse	
  
                                     Xtext	
                                  UI	
  
                                                                                                                                       ConfiguraFon	
  
                                                                                                                                           files	
  


                                                                                                           Xpand	
                      Documents	
  
                            Parse	
  tree	
                   Grammar	
  
                              model	
                          model	
                                                                     (UML	
  
                                                                                                                                         diagrams,	
  
                                                                                                                                        HTML	
  docs)	
  
                                       EMF	
  Ecore	
  model	
                     Xtend/
                                                                                   Check	
  
                                                                                                        EMF	
  Ecore	
  model	
  
           	
  
   Other	
  DSLs	
  
  (such	
  as	
  XSD,	
  
  GPB,	
  ThriT	
  or	
                                 Extend/
      Avro)	
  	
                                     transform/
                                                        validate	
  
December 8, 2011                                                                                                                         MongoSV 2011           13
Schema Definition - Open source tools

 Sculptor:
          •  http://fornax.itemis.de/confluence/display/fornax/Sculptor+%28CSC%29


 Eclipse Xtext:
          •  http://www.eclipse.org/Xtext/




December 8, 2011                                                              MongoSV 2011   14
Data Access Layer
Data Access Layer

 •  Provides an Abstraction layer to Persistence API and storage
          •  Also facilitating migration from one Persistence storage to another
                   >  Or even Y adaptor pattern to write to multiple Persistence storages
          •  Promote rapidly adoption of new technologies

 •  Provides different concrete APIs
          •  Query based APIs
          •  Entity based APIs
          •  Binary APIs (GridFS)

 •      Cache
 •      Query Abstraction
 •      Ability to plug key generators
 •      Promotes best practices across all applications

December 8, 2011                                                                      MongoSV 2011   16
Data Access Layer


                                           Services	
  



                                    Data	
  Access	
  Layer	
  


                   Query	
                                              Persistence	
  
                                 ORM	
                      Cache	
  
                   Builder	
                                              Driver	
  




                                             UDDL	
  




December 8, 2011                                                             MongoSV 2011   17
Data Access Layer – Query Builder

 •  Abstract how application developers define queries
          •  Agnostic of Persistence Storage
 •  Support the following Operators
          •  EQUAL, NOTEQUAL, HASTHISONE, HASALLOF, HASANYOF, HASNONEOF,
             HASTHISELEMENT,GREATERTHAN,GREATERHANOREQ,LESSTHAN,LESST
             HANOREQ,WHERE,EXISTS,SIZEEQ,MOD,PATTERN
 •  Support AND and OR compound operators

 •  Syntax originally based on the Morphia ‘Query’

 	
  QueryBuilder	
  query	
  =	
  
 	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  dal.createQueryBuilder().filter(Group.USERID,	
  QueryOperator.EQUAL,	
  userId)	
  
 	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .filter(Group.ID,	
  QueryOperator.HASANYOF,	
  groupNames);	
  
 	
  
 	
  QueryBuilder	
  query	
  =	
  
 	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  dal.createQueryBuilder().orFilter("_id",	
  QueryOperator.EQUAL,	
  contactId)	
  
 	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .orFilter(Contact.LEGACYID,	
  QueryOperator.EQUAL,	
  contactId);	
  



December 8, 2011                                                                                                                  MongoSV 2011        18
Data Access Layer - Cache

 •  Provides out-of-the-box support for cache annotations for
    Queries and entities




 @Cacheable(cacheName	
  =	
  ”contacts")	
  
 public	
  final	
  List<Contact>	
  getContacts(QueryBuilder	
  query)	
  throws	
  ExcepFon	
  




December 8, 2011                                                                            MongoSV 2011   19
Data Access Layer - ORM

 •  Morphia is a lightweight type-safe library for mapping Java
    objects to/from MongoDB

 •  Morphia provides easy support for a strongly-typed
    programming model




December 8, 2011                                         MongoSV 2011   20
Data Access Layer – ORM & Partial Updates

 •  Scenario : Allow client applications to send partial documents
    and merge these changes on current document.

 •  Regular behavior :

                   update({"_id":ObjectId(”…")},	
  
                   {lastName:"Updated"},	
  false)	
  


                                                                                           MongoDB	
  
                                                         {	
  
                                                         	
  	
  	
  "_id"	
  :	
  ObjectId
                                                         ("4ee1b6ac5c31a483c62d2b15"),	
  
                                                         	
  	
  	
  "firstName"	
  :	
  "Luciano",	
  
                                                         	
  	
  	
  "lastName"	
  :	
  "Resende",	
  
                                                         	
  	
  	
  "email"	
  :	
  {	
  
                                                                           	
  "isPrimary"	
  :	
  true,	
  
                                                                           	
  "emailAddress"	
  :	
  	
  “lresende@...”	
  
                                                         	
  	
  	
  }	
  
                                                         }	
  

 See	
  :	
  git://gist.github.com/1450628.git	
  
December 8, 2011                                                                                               MongoSV 2011    21
Data Access Layer – ORM & Partial Updates

 •  Scenario : Allow client applications to send partial documents
    and merge these changes on current document.

 •  Regular behavior :

                   update({"_id":ObjectId(”…")},	
  
                   {lastName:"Updated"},	
  false)	
  


                                                                                           MongoDB	
  
                                                         {	
  
                                                         	
  	
  	
  "_id"	
  :	
  ObjectId
                                                         ("4ee1b6ac5c31a483c62d2b15"),	
  
                                                         	
  	
  	
  "firstName"	
  :	
  "Luciano",	
  
                                                         }	
  




 See	
  :	
  git://gist.github.com/1450628.git	
  
December 8, 2011                                                                                    MongoSV 2011   22
Data Access Layer – ORM & Partial Updates

     •  Supporting Partial Updates
              •  Provides specific operations for explicitly applying partial
                 updates
              •  Internally, flatten the update structure into various $set
                 operations




                                                                                                 MongoDB	
  
                                                               {	
  
update({"_id":ObjectId(”…")},	
  	
                            	
  	
  	
  "_id"	
  :	
  ObjectId
{"$set":	
  {"lastName":	
  "Updated","email.isPrimary":	
     ("4ee1b6ac5c31a483c62d2b15"),	
  
                                                               	
  	
  	
  "firstName"	
  :	
  "Luciano",	
  
false}},	
  false)	
                                           	
  	
  	
  "lastName"	
  :	
  ”Resende",	
  
                                                               	
  	
  	
  "email"	
  :	
  {	
  
                                                                                 	
  "isPrimary"	
  :	
  false,	
  
                                                                                 	
  "emailAddress"	
  :	
  	
  “lresende@...”	
  
                                                               	
  	
  	
  }	
  
                                                               }	
  

     See	
  :	
  git://gist.github.com/1450628.git	
  
    December 8, 2011                                                                                                 MongoSV 2011    23
Data Access Layer – ORM & Partial Updates

     •  Supporting Partial Updates
              •  Provides specific operations for explicitly applying partial
                 updates
              •  Internally, flatten the update structure into various $set
                 operations




                                                                                                 MongoDB	
  
                                                               {	
  
update({"_id":ObjectId(”…")},	
  	
                            	
  	
  	
  "_id"	
  :	
  ObjectId
{"$set":	
  {"lastName":	
  "Updated","email.isPrimary":	
     ("4ee1b6ac5c31a483c62d2b15"),	
  
                                                               	
  	
  	
  "firstName"	
  :	
  "Luciano",	
  
false}},	
  false)	
                                           	
  	
  	
  "lastName"	
  :	
  ”Updated",	
  
                                                               	
  	
  	
  "email"	
  :	
  {	
  
                                                                                 	
  "isPrimary"	
  :	
  false,	
  
                                                                                 	
  "emailAddress"	
  :	
  	
  “lresende@...”	
  
                                                               	
  	
  	
  }	
  
                                                               }	
  

     See	
  :	
  git://gist.github.com/1450628.git	
  
    December 9, 2011                                                                                                 MongoSV 2011    24
Data Access Layer - Open source tools

 •  Spring Data - MongoDB:
          •  http://www.springsource.org/spring-data/mongodb
 •  Morphia
          •  http://code.google.com/p/morphia/




December 9, 2011                                               MongoSV 2011   25
Summary
Summary

 •  Schema Definition
          •  Cross Platform, Simple human (& machine) readable language
             to describe our domain model entities


 •  Data Access Layer
          •  Data Access Layer that in conjunction with UDDL abstracts the
             persistence layer allowing for more flexible and clean code
          •  Promote rapidly adoption of new technologies




December 8, 2011                                                  MongoSV 2011   27
Q&A
Ad

More Related Content

Similar to Data access layer and schema definitions (20)

IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easyIEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEEFINALYEARSTUDENTPROJECTS
 
2014 IEEE JAVA DATA MINING PROJECT Xs path navigation on xml schemas made easy
2014 IEEE JAVA DATA MINING PROJECT Xs path navigation on xml schemas made easy2014 IEEE JAVA DATA MINING PROJECT Xs path navigation on xml schemas made easy
2014 IEEE JAVA DATA MINING PROJECT Xs path navigation on xml schemas made easy
IEEEMEMTECHSTUDENTSPROJECTS
 
RomaFramework Tutorial Basics
RomaFramework Tutorial BasicsRomaFramework Tutorial Basics
RomaFramework Tutorial Basics
Luca Garulli
 
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case StudyLeveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Luca Berardinelli
 
[Nuxeo World 2013] Nuxeo Studio
[Nuxeo World 2013] Nuxeo Studio[Nuxeo World 2013] Nuxeo Studio
[Nuxeo World 2013] Nuxeo Studio
Nuxeo
 
Elements for an iOS Backend
Elements for an iOS BackendElements for an iOS Backend
Elements for an iOS Backend
Laurent Cerveau
 
Mozilla In Malaysia
Mozilla In MalaysiaMozilla In Malaysia
Mozilla In Malaysia
Gen Kanai
 
Q con london2011-matthewwall-whyichosemongodbforguardiancouk
Q con london2011-matthewwall-whyichosemongodbforguardiancoukQ con london2011-matthewwall-whyichosemongodbforguardiancouk
Q con london2011-matthewwall-whyichosemongodbforguardiancouk
Roger Xia
 
Spring Mvc
Spring MvcSpring Mvc
Spring Mvc
ifnu bima
 
speach
speachspeach
speach
Nikita Kurpas
 
Understanding Dom
Understanding DomUnderstanding Dom
Understanding Dom
LiquidHub
 
Querying Mongo Without Programming Using Funql
Querying Mongo Without Programming Using FunqlQuerying Mongo Without Programming Using Funql
Querying Mongo Without Programming Using Funql
MongoDB
 
Open source Technology
Open source TechnologyOpen source Technology
Open source Technology
Amardeep Vishwakarma
 
Parsing XML in J2ME
Parsing XML in J2MEParsing XML in J2ME
Parsing XML in J2ME
Rohan Chandane
 
43
4343
43
srimoorthi
 
2011 famoosr
2011 famoosr2011 famoosr
2011 famoosr
bergel
 
FAMOOSr 2011
FAMOOSr 2011FAMOOSr 2011
FAMOOSr 2011
ESUG
 
Data FAIRport Skunkworks: Common Repository Access Via Meta-Metadata Descript...
Data FAIRport Skunkworks: Common Repository Access Via Meta-Metadata Descript...Data FAIRport Skunkworks: Common Repository Access Via Meta-Metadata Descript...
Data FAIRport Skunkworks: Common Repository Access Via Meta-Metadata Descript...
datascienceiqss
 
Model2Roo - ACME
Model2Roo - ACMEModel2Roo - ACME
Model2Roo - ACME
jccastrejon
 
Managing Data in Jakarta EE Applications
Managing Data in Jakarta EE ApplicationsManaging Data in Jakarta EE Applications
Managing Data in Jakarta EE Applications
Buhake Sindi
 
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easyIEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEEFINALYEARSTUDENTPROJECTS
 
2014 IEEE JAVA DATA MINING PROJECT Xs path navigation on xml schemas made easy
2014 IEEE JAVA DATA MINING PROJECT Xs path navigation on xml schemas made easy2014 IEEE JAVA DATA MINING PROJECT Xs path navigation on xml schemas made easy
2014 IEEE JAVA DATA MINING PROJECT Xs path navigation on xml schemas made easy
IEEEMEMTECHSTUDENTSPROJECTS
 
RomaFramework Tutorial Basics
RomaFramework Tutorial BasicsRomaFramework Tutorial Basics
RomaFramework Tutorial Basics
Luca Garulli
 
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case StudyLeveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Luca Berardinelli
 
[Nuxeo World 2013] Nuxeo Studio
[Nuxeo World 2013] Nuxeo Studio[Nuxeo World 2013] Nuxeo Studio
[Nuxeo World 2013] Nuxeo Studio
Nuxeo
 
Elements for an iOS Backend
Elements for an iOS BackendElements for an iOS Backend
Elements for an iOS Backend
Laurent Cerveau
 
Mozilla In Malaysia
Mozilla In MalaysiaMozilla In Malaysia
Mozilla In Malaysia
Gen Kanai
 
Q con london2011-matthewwall-whyichosemongodbforguardiancouk
Q con london2011-matthewwall-whyichosemongodbforguardiancoukQ con london2011-matthewwall-whyichosemongodbforguardiancouk
Q con london2011-matthewwall-whyichosemongodbforguardiancouk
Roger Xia
 
Understanding Dom
Understanding DomUnderstanding Dom
Understanding Dom
LiquidHub
 
Querying Mongo Without Programming Using Funql
Querying Mongo Without Programming Using FunqlQuerying Mongo Without Programming Using Funql
Querying Mongo Without Programming Using Funql
MongoDB
 
2011 famoosr
2011 famoosr2011 famoosr
2011 famoosr
bergel
 
FAMOOSr 2011
FAMOOSr 2011FAMOOSr 2011
FAMOOSr 2011
ESUG
 
Data FAIRport Skunkworks: Common Repository Access Via Meta-Metadata Descript...
Data FAIRport Skunkworks: Common Repository Access Via Meta-Metadata Descript...Data FAIRport Skunkworks: Common Repository Access Via Meta-Metadata Descript...
Data FAIRport Skunkworks: Common Repository Access Via Meta-Metadata Descript...
datascienceiqss
 
Model2Roo - ACME
Model2Roo - ACMEModel2Roo - ACME
Model2Roo - ACME
jccastrejon
 
Managing Data in Jakarta EE Applications
Managing Data in Jakarta EE ApplicationsManaging Data in Jakarta EE Applications
Managing Data in Jakarta EE Applications
Buhake Sindi
 

More from Luciano Resende (20)

A Jupyter kernel for Scala and Apache Spark.pdf
A Jupyter kernel for Scala and Apache Spark.pdfA Jupyter kernel for Scala and Apache Spark.pdf
A Jupyter kernel for Scala and Apache Spark.pdf
Luciano Resende
 
Using Elyra for COVID-19 Analytics
Using Elyra for COVID-19 AnalyticsUsing Elyra for COVID-19 Analytics
Using Elyra for COVID-19 Analytics
Luciano Resende
 
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Luciano Resende
 
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...
Luciano Resende
 
Ai pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooksAi pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooks
Luciano Resende
 
Strata - Scaling Jupyter with Jupyter Enterprise Gateway
Strata - Scaling Jupyter with Jupyter Enterprise GatewayStrata - Scaling Jupyter with Jupyter Enterprise Gateway
Strata - Scaling Jupyter with Jupyter Enterprise Gateway
Luciano Resende
 
Scaling notebooks for Deep Learning workloads
Scaling notebooks for Deep Learning workloadsScaling notebooks for Deep Learning workloads
Scaling notebooks for Deep Learning workloads
Luciano Resende
 
Jupyter Enterprise Gateway Overview
Jupyter Enterprise Gateway OverviewJupyter Enterprise Gateway Overview
Jupyter Enterprise Gateway Overview
Luciano Resende
 
Inteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for CodeInteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for Code
Luciano Resende
 
IoT Applications and Patterns using Apache Spark & Apache Bahir
IoT Applications and Patterns using Apache Spark & Apache BahirIoT Applications and Patterns using Apache Spark & Apache Bahir
IoT Applications and Patterns using Apache Spark & Apache Bahir
Luciano Resende
 
Getting insights from IoT data with Apache Spark and Apache Bahir
Getting insights from IoT data with Apache Spark and Apache BahirGetting insights from IoT data with Apache Spark and Apache Bahir
Getting insights from IoT data with Apache Spark and Apache Bahir
Luciano Resende
 
Open Source AI - News and examples
Open Source AI - News and examplesOpen Source AI - News and examples
Open Source AI - News and examples
Luciano Resende
 
Building analytical microservices powered by jupyter kernels
Building analytical microservices powered by jupyter kernelsBuilding analytical microservices powered by jupyter kernels
Building analytical microservices powered by jupyter kernels
Luciano Resende
 
Building iot applications with Apache Spark and Apache Bahir
Building iot applications with Apache Spark and Apache BahirBuilding iot applications with Apache Spark and Apache Bahir
Building iot applications with Apache Spark and Apache Bahir
Luciano Resende
 
An Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
An Enterprise Analytics Platform with Jupyter Notebooks and Apache SparkAn Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
An Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
Luciano Resende
 
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
Luciano Resende
 
What's new in Apache SystemML - Declarative Machine Learning
What's new in Apache SystemML  - Declarative Machine LearningWhat's new in Apache SystemML  - Declarative Machine Learning
What's new in Apache SystemML - Declarative Machine Learning
Luciano Resende
 
Big analytics meetup - Extended Jupyter Kernel Gateway
Big analytics meetup - Extended Jupyter Kernel GatewayBig analytics meetup - Extended Jupyter Kernel Gateway
Big analytics meetup - Extended Jupyter Kernel Gateway
Luciano Resende
 
Jupyter con meetup extended jupyter kernel gateway
Jupyter con meetup   extended jupyter kernel gatewayJupyter con meetup   extended jupyter kernel gateway
Jupyter con meetup extended jupyter kernel gateway
Luciano Resende
 
Writing Apache Spark and Apache Flink Applications Using Apache Bahir
Writing Apache Spark and Apache Flink Applications Using Apache BahirWriting Apache Spark and Apache Flink Applications Using Apache Bahir
Writing Apache Spark and Apache Flink Applications Using Apache Bahir
Luciano Resende
 
A Jupyter kernel for Scala and Apache Spark.pdf
A Jupyter kernel for Scala and Apache Spark.pdfA Jupyter kernel for Scala and Apache Spark.pdf
A Jupyter kernel for Scala and Apache Spark.pdf
Luciano Resende
 
Using Elyra for COVID-19 Analytics
Using Elyra for COVID-19 AnalyticsUsing Elyra for COVID-19 Analytics
Using Elyra for COVID-19 Analytics
Luciano Resende
 
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Luciano Resende
 
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...
From Data to AI - Silicon Valley Open Source projects come to you - Madrid me...
Luciano Resende
 
Ai pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooksAi pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooks
Luciano Resende
 
Strata - Scaling Jupyter with Jupyter Enterprise Gateway
Strata - Scaling Jupyter with Jupyter Enterprise GatewayStrata - Scaling Jupyter with Jupyter Enterprise Gateway
Strata - Scaling Jupyter with Jupyter Enterprise Gateway
Luciano Resende
 
Scaling notebooks for Deep Learning workloads
Scaling notebooks for Deep Learning workloadsScaling notebooks for Deep Learning workloads
Scaling notebooks for Deep Learning workloads
Luciano Resende
 
Jupyter Enterprise Gateway Overview
Jupyter Enterprise Gateway OverviewJupyter Enterprise Gateway Overview
Jupyter Enterprise Gateway Overview
Luciano Resende
 
Inteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for CodeInteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for Code
Luciano Resende
 
IoT Applications and Patterns using Apache Spark & Apache Bahir
IoT Applications and Patterns using Apache Spark & Apache BahirIoT Applications and Patterns using Apache Spark & Apache Bahir
IoT Applications and Patterns using Apache Spark & Apache Bahir
Luciano Resende
 
Getting insights from IoT data with Apache Spark and Apache Bahir
Getting insights from IoT data with Apache Spark and Apache BahirGetting insights from IoT data with Apache Spark and Apache Bahir
Getting insights from IoT data with Apache Spark and Apache Bahir
Luciano Resende
 
Open Source AI - News and examples
Open Source AI - News and examplesOpen Source AI - News and examples
Open Source AI - News and examples
Luciano Resende
 
Building analytical microservices powered by jupyter kernels
Building analytical microservices powered by jupyter kernelsBuilding analytical microservices powered by jupyter kernels
Building analytical microservices powered by jupyter kernels
Luciano Resende
 
Building iot applications with Apache Spark and Apache Bahir
Building iot applications with Apache Spark and Apache BahirBuilding iot applications with Apache Spark and Apache Bahir
Building iot applications with Apache Spark and Apache Bahir
Luciano Resende
 
An Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
An Enterprise Analytics Platform with Jupyter Notebooks and Apache SparkAn Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
An Enterprise Analytics Platform with Jupyter Notebooks and Apache Spark
Luciano Resende
 
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
The Analytic Platform behind IBM’s Watson Data Platform - Big Data Spain 2017
Luciano Resende
 
What's new in Apache SystemML - Declarative Machine Learning
What's new in Apache SystemML  - Declarative Machine LearningWhat's new in Apache SystemML  - Declarative Machine Learning
What's new in Apache SystemML - Declarative Machine Learning
Luciano Resende
 
Big analytics meetup - Extended Jupyter Kernel Gateway
Big analytics meetup - Extended Jupyter Kernel GatewayBig analytics meetup - Extended Jupyter Kernel Gateway
Big analytics meetup - Extended Jupyter Kernel Gateway
Luciano Resende
 
Jupyter con meetup extended jupyter kernel gateway
Jupyter con meetup   extended jupyter kernel gatewayJupyter con meetup   extended jupyter kernel gateway
Jupyter con meetup extended jupyter kernel gateway
Luciano Resende
 
Writing Apache Spark and Apache Flink Applications Using Apache Bahir
Writing Apache Spark and Apache Flink Applications Using Apache BahirWriting Apache Spark and Apache Flink Applications Using Apache Bahir
Writing Apache Spark and Apache Flink Applications Using Apache Bahir
Luciano Resende
 
Ad

Recently uploaded (20)

Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Ad

Data access layer and schema definitions

  • 1. Data Access Layer and Schema Definitions Luciano Resende [email protected] [email protected] http://lresende.blogspot.com/
  • 2. About Luciano Resende •  Staff Software Engineer – Shutterfly, Inc. •  Member – Apache Software Foundation •  Committer: Apache Tuscany, Wink, Nuvem, PhotoArk December 8, 2011 MongoSV 2011 2
  • 3. MongoDB Characteristics •  Scalability •  Simplicity •  Flexible Schema •  Low TCO December 8, 2011 MongoSV 2011 3
  • 4. MongoDB initial POCs .NET   Component       firstName   first_name   MongoDB   firstname   Java   Java   Component   Component           Floor  plan  image  from  :  h3p://benchmarkoffices.com/floorplans.htm   December 8, 2011 MongoSV 2011 4
  • 5. The Platform •  Applications will interact with MongoDB persistence via services •  Enforce a consistent schema across multiple applications and cross-platform Services   •  Data Access Layer •  Data Access Layer that in Data  Access  Layer   conjunction with UDDL abstracts the persistence layer allowing for more flexible and UDDL   clean code •  A cross platform data schema definition (text DSL) •  Simple human (& machine) readable language to describe our domain model entities December 8, 2011 MongoSV 2011 5
  • 7. Schema Definition – Why using Text DSL •  Platform independent data definition. •  (Annotated) POJO (JAXB, JPA, Morphia) has too much noises and is abuse-prone. We want to enforce the patterns. •  XSD is too complicated and it doesn’t fit all for web 2.0 •  We need a simple human (& machine) readable language to describe our domain model to provide/promote: •  Service-friendly DTO, Persistence (RDB and NoSQL), Governance, Reuse, Validation, MVC, Best Practice, Documentation •  We call the DSL as Universal Data Definition Language (UDDL). •  Unify Data Definition across different platform application domains December 8, 2011 MongoSV 2011 7
  • 8. Our decision: Textual DSL •  Derived from an Apache licensed open source project Sculptor •  http://fornax.itemis.de/confluence/display/fornax/Sculptor+%28CSC%29 •  Easy to learn, intuitive syntax of the textual DSL, based on the concepts from DDD. •  Textual DSL has a lot of productivity benefits over graphical tools •  Quick development round trip, short feedback loop •  Generation of complete application from a single model, not only fragments that are hard to fit in to the overall design •  Supports JPA (oracle/mysql/postgresql)/MongoDB/JAXB/Spring/SpringMVC •  Great extensibility and customization •  Based on Eclipse Xtext/Xtend/Xpand code generation framework •  Can be used with text editor or any IDE, but DSL editor with error highlight, code completion, and outline is provided for Eclipse users •  Documentation w/ diagrams for domain model •  No runtime magic is built into the tools (generated code can be used without the tooling) December 8, 2011 MongoSV 2011 8
  • 9. Schema Definition - The idea 4 metadata   POJO   XSD   Protocol   Domain   1.  Persistence   Buffer/ThriT   2.  DTO   Model   JSON   Textual  DSL   3.  Mapping   Schema   (such  as   DDL   4.  IntrospecFon   Sculptor)   5.  ValidaFon   6.  MVC/UI   2 1 CRUD   DTO   DTO   DTO   REST   Root   Locate   3 RDB   REST   EnFty   Resource   Sub-­‐ CRUD   EnFty   Resource   EnFty   REST   Sub-­‐ CRUD   MongoDB   Resource   Generated  arFfacts   Java  code   Code   uddl   generaFon   ConfiguraFon  files   templates   Documents   (UML  diagrams,  HTML   December 8, 2011 docs)   MongoSV 2011 9
  • 10. Schema Definition - Sample Application AddressBook { basePackage=com.shutterfly.model Persistence  in   Module addressbook { hint="store=mongodb” use…   Entity Contact { dto mappedName="contact" String id key; String userId ! nullable indexed; EnFty   String prefix; String firstName; String middleName; String lastName; Required   String company; Indexes   - @ContactType type; - @Gender gender; List<String> groups; //group names - List<@ContactEmail> emails; Embedded  and   - List<@ContactAddress> addresses; References   @'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(com.shutterfly.model.common.jaxb.adapter.UTCDateXmlAdapter.class)' Timestamp created mappedName="updtime"; @'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(com.shutterfly.model.common.jaxb.adapter.UTCDateXmlAdapter.class)' Timestamp lastUpdated mappedName="instime"; } BasicType ContactEmail { String label; Boolean isPrimary; String emailAddress ! nullable indexed; Embedded  and   } } References   December 8, 2011 MongoSV 2011 10
  • 11. Schema Definition – Generated Java Code @Generated("uddl:AddressBook/addressbook/Contact") @XmlRootElement @XmlAccessorType(javax.xml.bind.annotation.XmlAccessType.FIELD) @Entity(value = "contact", noClassnameStored = true) public class Contact implements Serializable, Cloneable { @Id private String id; @XmlElement() private String userId; @XmlElement() private String prefix; @XmlElement() private String firstName; @XmlElement() private String middleName; @XmlElement() private String lastName; @XmlElement() private String company; @XmlElement() private List<String> groups = new ArrayList<String>(); @XmlJavaTypeAdapter(com.shutterfly.model.common.jaxb.adapter.UTCDateXmlAdapter.class) @XmlElement(name = "updtime") @Property("updtime") private Date created; @XmlJavaTypeAdapter(com.shutterfly.model.common.jaxb.adapter.UTCDateXmlAdapter.class) @XmlElement(name = "instime") @Property("instime") private Date lastUpdated; @XmlElement() private ContactType type; @XmlElement() private Gender gender; @XmlElementWrapper(name = "emails") @XmlElement(name = "email") @Embedded private List<ContactEmail> emails = new ArrayList<ContactEmail>(); @XmlElementWrapper(name = "addresses") @XmlElement(name = "address") @Embedded private List<ContactAddress> addresses = new ArrayList<ContactAddress>(); … } December 8, 2011 MongoSV 2011 11
  • 12. Schema Definition - Documentation December 8, 2011 MongoSV 2011 12
  • 13. DSL language development SemanFc   model   Generated  arFfacts     Grammar   Language   Eclipse  Model   Load/save   (DSL)   Workflow  Engine   Java  code     (MWE)   Parse/validate   Eclipse   Xtext   UI   ConfiguraFon   files   Xpand   Documents   Parse  tree   Grammar   model   model   (UML   diagrams,   HTML  docs)   EMF  Ecore  model   Xtend/ Check   EMF  Ecore  model     Other  DSLs   (such  as  XSD,   GPB,  ThriT  or   Extend/ Avro)     transform/ validate   December 8, 2011 MongoSV 2011 13
  • 14. Schema Definition - Open source tools Sculptor: •  http://fornax.itemis.de/confluence/display/fornax/Sculptor+%28CSC%29 Eclipse Xtext: •  http://www.eclipse.org/Xtext/ December 8, 2011 MongoSV 2011 14
  • 16. Data Access Layer •  Provides an Abstraction layer to Persistence API and storage •  Also facilitating migration from one Persistence storage to another >  Or even Y adaptor pattern to write to multiple Persistence storages •  Promote rapidly adoption of new technologies •  Provides different concrete APIs •  Query based APIs •  Entity based APIs •  Binary APIs (GridFS) •  Cache •  Query Abstraction •  Ability to plug key generators •  Promotes best practices across all applications December 8, 2011 MongoSV 2011 16
  • 17. Data Access Layer Services   Data  Access  Layer   Query   Persistence   ORM   Cache   Builder   Driver   UDDL   December 8, 2011 MongoSV 2011 17
  • 18. Data Access Layer – Query Builder •  Abstract how application developers define queries •  Agnostic of Persistence Storage •  Support the following Operators •  EQUAL, NOTEQUAL, HASTHISONE, HASALLOF, HASANYOF, HASNONEOF, HASTHISELEMENT,GREATERTHAN,GREATERHANOREQ,LESSTHAN,LESST HANOREQ,WHERE,EXISTS,SIZEEQ,MOD,PATTERN •  Support AND and OR compound operators •  Syntax originally based on the Morphia ‘Query’  QueryBuilder  query  =                                  dal.createQueryBuilder().filter(Group.USERID,  QueryOperator.EQUAL,  userId)                                          .filter(Group.ID,  QueryOperator.HASANYOF,  groupNames);      QueryBuilder  query  =                                  dal.createQueryBuilder().orFilter("_id",  QueryOperator.EQUAL,  contactId)                                          .orFilter(Contact.LEGACYID,  QueryOperator.EQUAL,  contactId);   December 8, 2011 MongoSV 2011 18
  • 19. Data Access Layer - Cache •  Provides out-of-the-box support for cache annotations for Queries and entities @Cacheable(cacheName  =  ”contacts")   public  final  List<Contact>  getContacts(QueryBuilder  query)  throws  ExcepFon   December 8, 2011 MongoSV 2011 19
  • 20. Data Access Layer - ORM •  Morphia is a lightweight type-safe library for mapping Java objects to/from MongoDB •  Morphia provides easy support for a strongly-typed programming model December 8, 2011 MongoSV 2011 20
  • 21. Data Access Layer – ORM & Partial Updates •  Scenario : Allow client applications to send partial documents and merge these changes on current document. •  Regular behavior : update({"_id":ObjectId(”…")},   {lastName:"Updated"},  false)   MongoDB   {        "_id"  :  ObjectId ("4ee1b6ac5c31a483c62d2b15"),        "firstName"  :  "Luciano",        "lastName"  :  "Resende",        "email"  :  {    "isPrimary"  :  true,    "emailAddress"  :    “lresende@...”        }   }   See  :  git://gist.github.com/1450628.git   December 8, 2011 MongoSV 2011 21
  • 22. Data Access Layer – ORM & Partial Updates •  Scenario : Allow client applications to send partial documents and merge these changes on current document. •  Regular behavior : update({"_id":ObjectId(”…")},   {lastName:"Updated"},  false)   MongoDB   {        "_id"  :  ObjectId ("4ee1b6ac5c31a483c62d2b15"),        "firstName"  :  "Luciano",   }   See  :  git://gist.github.com/1450628.git   December 8, 2011 MongoSV 2011 22
  • 23. Data Access Layer – ORM & Partial Updates •  Supporting Partial Updates •  Provides specific operations for explicitly applying partial updates •  Internally, flatten the update structure into various $set operations MongoDB   {   update({"_id":ObjectId(”…")},          "_id"  :  ObjectId {"$set":  {"lastName":  "Updated","email.isPrimary":   ("4ee1b6ac5c31a483c62d2b15"),        "firstName"  :  "Luciano",   false}},  false)        "lastName"  :  ”Resende",        "email"  :  {    "isPrimary"  :  false,    "emailAddress"  :    “lresende@...”        }   }   See  :  git://gist.github.com/1450628.git   December 8, 2011 MongoSV 2011 23
  • 24. Data Access Layer – ORM & Partial Updates •  Supporting Partial Updates •  Provides specific operations for explicitly applying partial updates •  Internally, flatten the update structure into various $set operations MongoDB   {   update({"_id":ObjectId(”…")},          "_id"  :  ObjectId {"$set":  {"lastName":  "Updated","email.isPrimary":   ("4ee1b6ac5c31a483c62d2b15"),        "firstName"  :  "Luciano",   false}},  false)        "lastName"  :  ”Updated",        "email"  :  {    "isPrimary"  :  false,    "emailAddress"  :    “lresende@...”        }   }   See  :  git://gist.github.com/1450628.git   December 9, 2011 MongoSV 2011 24
  • 25. Data Access Layer - Open source tools •  Spring Data - MongoDB: •  http://www.springsource.org/spring-data/mongodb •  Morphia •  http://code.google.com/p/morphia/ December 9, 2011 MongoSV 2011 25
  • 27. Summary •  Schema Definition •  Cross Platform, Simple human (& machine) readable language to describe our domain model entities •  Data Access Layer •  Data Access Layer that in conjunction with UDDL abstracts the persistence layer allowing for more flexible and clean code •  Promote rapidly adoption of new technologies December 8, 2011 MongoSV 2011 27
  • 28. Q&A