SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
Nuxeo: from SQL to
MongoDB
Florent Guillaume — Director of R&D, Nuxeo
2014-07-03
The Nuxeo Model
Nuxeo Platform
SQL DB
Document
BLOBS
<META>
<META>
<META>
Repository
BlobStore
Store
Read
Cache
Persistence
Engine
Insert
Update
Select
FS
MongoDB
VCS DBS
Nuxeo Core — Rich Documents
• Scalars
• Strings, Integers, Floats, Booleans, Dates
• Binary blobs (stored using separate BinaryStore service)
• Arrays of scalars
• Complex properties (sub-documents)
• Lists of complex properties
• System properties
• Id, type, facets, lifecycle state, ACL, version flags...
Nuxeo Core — Rich Documents
• Scalar properties and arrays
• dc:title = "My Document"
• dc:contributors = ["bob", "pete", "mary"]
• dc:created = 2014-07-03T12:15:07+0200
• ecm:uuid = 52a7352b-041e-49ed-8676-328ce90cc103
• ecm:primaryType = "MyFile"
• ecm:majorVersion = 2, ecm:minorVersion = 0
• ecm:isLatestMajorVersion = true, ecm:isLatestVersion = false
Nuxeo Core — Rich Documents
• Complex properties and lists of them
• primaryAddress = { street = "1 rue René Clair", zip = "75018",

city = "Paris", country = "France" }
• files = [
• { name = "doc.txt", length = 1234, mime-type = "plain/text",

data = 0111fefdc8b14738067e54f30e568115 }
• { name = "doc.pdf", length = 29344, mime-type = "application/pdf",

data = 20f42df3221d61cb3e6ab8916b248216 }
]
Nuxeo Core — Rich Operations
• CRUD
• Create
• Retrieve
• Update
• Delete
• Move
• Copy
• ... but in a Hierarchy
Nuxeo Core — Rich Features
• Security based on ACLs and inheritance
• block bob for Write, allow members for Read
• Proxies (multi-filing)
• Versioning
• Placeless documents (versions, tags, relations...)
• Facets (dynamic typing)
• Locking
• Search (NXQL)

SELECT * FROM File WHERE files/*/name = 'doc.txt'
Nuxeo Core — Hierarchy
• Parent-child relationship
• Recursion
• Find all the children to change something
• Lifecycle state
• Security
• Search on a subset of the hierarchy
• ... AND ecm:path STARTSWITH '/workspaces/receipts'
SQL vs DBS/MongoDB
Storage — SQL
• Stores data in a set of JOINed tables
• Star schema, around the main hierarchy
• Lists as JOINed table with item/pos
• Complex properties as sub-documents (children)
• Lists of complex properties as ordered sub-documents
• Id generated by application or database
• String / native UUID / serial integer
Storage — SQL (base hierarchy)
Storage — SQL (simple props)
Storage — SQL (complex props)
Storage — MongoDB
• Standard JSON documents
• Property names fully prefixed
• Lists as arrays of scalars
• Complex properties as sub-documents
• Complex lists as arrays of sub-documents
• Id generated by MongoDB
• Counter using findAndModify, $inc and returnNew
Storage — MongoDB
"ecm:id": "52a7352b-041e-49ed-8676-328ce90cc103",

"dc:title": "My Document",

"dc:contributors": ["bob", "pete", "mary"],

"dc:created": ISODate("2014-07-03T12:15:07+0200"),

"ecm:primaryType": "MyFile",

"ecm:majorVersion": NumberLong(2),

"ecm:minorVersion": NumberLong(0),

"ecm:isLatestMajorVersion": true,

"ecm:isLatestVersion": false,

Storage — MongoDB
primaryAddress: { street: "1 rue René Clair", zip: "75018",

city: "Paris", country: "France" },

files: [{ name: "doc.txt", length: 1234, mime-type: "plain/text",

data: "0111fefdc8b14738067e54f30e568115" },

{ name: "doc.pdf", length: 29344, mime-type: "application/
pdf",

data: "20f42df3221d61cb3e6ab8916b248216" }]

"ecm:acp": [{

name: "local",

acl: [{ grant: false, perm: "Write", user: "bob" },

{ grant: true, perm: "Read", user: "pete" },

{ grant: true, perm: "Read", user: "members" }]

}]
Hierarchy — SQL
• Parent-child relationship
• hierarchy.parentid column
• Recursion optimized through ancestors table
• For each document list all its ancestors
• Maintained by database triggers (create, delete, move, copy)
• Alternative for PostgreSQL: array column with all ancestors
Hierarchy — SQL
Hierarchy — MongoDB
• Parent-child relationship
• ecm:parentId field
• Recursion optimized through ecm:ancestorIds array
• Maintained by framework (create, delete, move, copy)
Hierarchy — MongoDB
"ecm:parentId": "afb488e7",
"ecm:ancestorIds": ["00000000", "18ba9e90",
"afb488e7"],

Proxies — SQL
• Reference to target document
• proxies.targetid column
• Holds only hierarchy-based information, no content
• Parent, name, ACL...
• Additional JOIN during search
Proxies — MongoDB
• Copy of the target document
• ecm:proxyTargetId field
• Target document knows who's pointing to it
• ecm:proxyIds field
• Maintained by framework
• Copy needs to be kept up to date when target changes
• Maintained by framework
Proxies — Semantics
• What to do when:
• Target removed (→ forbid)
• Proxy removed
• Proxy + target removed at the same time (→ ok)
• Target copied
• Proxy copied (→ new proxy to original target)
• Proxy + target copied at the same time (todo)
Security — SQL
• Generic ACP stored in acls table
• Precomputed Read ACLs needed for search
• Ordered list of identities having access, with blocking

["Management", "Supervisors", "-Temps", "bob"]
• Read ACLs are given an identifier
• Identities having access to which Read ACL is precomputed
• Maintained by database triggers
• Search matches using JOIN
Security — SQL
Security — SQL
Security — MongoDB
• Generic ACP stored in ecm:acp field
• Precomputed Read ACLs needed for search
• Simple set of identities having access

ecm:racl: ["Management", "Supervisors", "bob"]!
• Semantic restrictions on blocking
• Maintained by framework
• Search matches if intersection

{"ecm:racl": {"$in": ["bob", "members", "Everyone"]}}
Search — SQL
• Translated from NXQL to SQL
• JOIN of all required star/list/complex properties tables
• Additional UNION + JOINs for proxies
• Additional JOIN for security
• Can have correlations (reuse same JOIN)
• Fulltext index(es) on fulltext.simpletext /
fulltext.binarytext columns
• Translated from NXQL to MongoDB syntax
• Proxies queried directly
• Security queried by set intersection
• One fulltext index for ecm:fulltextSimple /
ecm:fulltextBinary fields
• Some limitations
Search — MongoDB
Search — MongoDB Limitations
• Only one fulltext search per query, restrictions on position
• No generic boolean NOT, must be pushed down as
negative operators
• Search is field/value based
• No multi-field operators (title = description,
expirationDate > modificationDate)
• No multi-field arithmetic (amount + bonus < 1000)
• Subdocument correlation with $elemMatch is less generic than
full JOINs
Transactions — SQL
• Standard SQL database capabilities
• Atomic commit
• Two-phase commit (prepare/commit) also useable, although
costly
• Rollback
• Transient data is data modified in the database but not
yet committed
• Transient data is visible along committed data for retrieval and
search
Transactions — MongoDB
• No atomic commit beyond a single document
• Commit using a big batch of create/delete/update
accumulated in-memory
• Not atomic, others can see partial state
• No transient space
• Emulate transient space in-memory, flush at commit time
• All accesses and searches must check the transient space as
well as MongoDB
Transactions — MongoDB
• No rollback
• Rollback by dropping the in-memory transient space
• Operations involving several documents in relation
• Move, delete, copy, ancestors or recursion checks
• Using transient space + MongoDB for them is too complex
• Flush to MongoDB before doing them (commit)
• Must be able to be rolled back if needed (transaction
compensation)
• Others can see state that's eventually invalid
MongoDB — Restrictions
• Eventual consistency and no transactions
• Prevents strong checks
• Duplicate name in a folder
• Move creating cycles
• Remove target before proxy
• Create document in a deleted folder
• Prevents full consistency of hierarchical processing
• Read ACLs, quotas
• Needs background jobs that check consistency
MongoDB — Features
• Bulk operations
• Map-reduce for aggregations
• Quotas / count / folder content last modified
• Conditional updates
• Locks
• Prevent dirty writes
• GridFS to store binaries
• Sharding
DBS — Future Work
Future Work
• DBS used for more services
• Directories / Vocabularies / User database
• Audit log
• DBS for other backends
• Elasticsearch
• Redis
• PostgreSQL / JSON
• Other...
Thanks!
We're Hiring!

Weitere ähnliche Inhalte

Was ist angesagt?

Mongo db eveningschemadesign
Mongo db eveningschemadesignMongo db eveningschemadesign
Mongo db eveningschemadesign
MongoDB APAC
 
Node.js and couchbase Full Stack JSON - Munich NoSQL
Node.js and couchbase   Full Stack JSON - Munich NoSQLNode.js and couchbase   Full Stack JSON - Munich NoSQL
Node.js and couchbase Full Stack JSON - Munich NoSQL
Philipp Fehre
 

Was ist angesagt? (20)

Mongo db eveningschemadesign
Mongo db eveningschemadesignMongo db eveningschemadesign
Mongo db eveningschemadesign
 
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
 
Rpsonmongodb
RpsonmongodbRpsonmongodb
Rpsonmongodb
 
Introduction to Windows Azure Data Services
Introduction to Windows Azure Data ServicesIntroduction to Windows Azure Data Services
Introduction to Windows Azure Data Services
 
Nuxeo Platform LTS 2015 Highlights
Nuxeo Platform LTS 2015 HighlightsNuxeo Platform LTS 2015 Highlights
Nuxeo Platform LTS 2015 Highlights
 
MMS - Monitoring, backup and management at a single click
MMS - Monitoring, backup and management at a single clickMMS - Monitoring, backup and management at a single click
MMS - Monitoring, backup and management at a single click
 
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part20812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
 
Node.js and couchbase Full Stack JSON - Munich NoSQL
Node.js and couchbase   Full Stack JSON - Munich NoSQLNode.js and couchbase   Full Stack JSON - Munich NoSQL
Node.js and couchbase Full Stack JSON - Munich NoSQL
 
Choosing the right Cloud Database
Choosing the right Cloud DatabaseChoosing the right Cloud Database
Choosing the right Cloud Database
 
Soaring through the Clouds - Oracle Fusion Middleware Partner Forum 2016
Soaring through the Clouds - Oracle Fusion Middleware Partner Forum 2016 Soaring through the Clouds - Oracle Fusion Middleware Partner Forum 2016
Soaring through the Clouds - Oracle Fusion Middleware Partner Forum 2016
 
Cloudant Overview Bluemix Meetup from Lisa Neddam
Cloudant Overview Bluemix Meetup from Lisa NeddamCloudant Overview Bluemix Meetup from Lisa Neddam
Cloudant Overview Bluemix Meetup from Lisa Neddam
 
Introduction to RavenDB
Introduction to RavenDBIntroduction to RavenDB
Introduction to RavenDB
 
Elk ruminating on logs
Elk ruminating on logsElk ruminating on logs
Elk ruminating on logs
 
Couchbase@live person meetup july 22nd
Couchbase@live person meetup   july 22ndCouchbase@live person meetup   july 22nd
Couchbase@live person meetup july 22nd
 
The Essentials of Building Cloud-Based Web Apps with Azure
The Essentials of Building Cloud-Based Web Apps with AzureThe Essentials of Building Cloud-Based Web Apps with Azure
The Essentials of Building Cloud-Based Web Apps with Azure
 
MongoDB seminar
MongoDB seminarMongoDB seminar
MongoDB seminar
 
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
Migrating Customers to Microsoft Azure: Lessons Learned From the FieldMigrating Customers to Microsoft Azure: Lessons Learned From the Field
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
 
Accelerating Data Ingestion with Databricks Autoloader
Accelerating Data Ingestion with Databricks AutoloaderAccelerating Data Ingestion with Databricks Autoloader
Accelerating Data Ingestion with Databricks Autoloader
 
.NET Core Apps: Design & Development
.NET Core Apps: Design & Development.NET Core Apps: Design & Development
.NET Core Apps: Design & Development
 
Webinar: Architecting Secure and Compliant Applications with MongoDB
Webinar: Architecting Secure and Compliant Applications with MongoDBWebinar: Architecting Secure and Compliant Applications with MongoDB
Webinar: Architecting Secure and Compliant Applications with MongoDB
 

Andere mochten auch

Manual magento 1-1
Manual magento 1-1Manual magento 1-1
Manual magento 1-1
plopez_7
 
RAF TABTRONICS LLC COMPANY OVERVIEW - 2014
RAF TABTRONICS LLC COMPANY OVERVIEW - 2014RAF TABTRONICS LLC COMPANY OVERVIEW - 2014
RAF TABTRONICS LLC COMPANY OVERVIEW - 2014
Lisa Carpenter
 
La Diaclasa (Benaocaz)
La Diaclasa  (Benaocaz)La Diaclasa  (Benaocaz)
La Diaclasa (Benaocaz)
clubchiclamon
 
Contraste
ContrasteContraste
Contraste
Edy Hm
 

Andere mochten auch (20)

Manual magento 1-1
Manual magento 1-1Manual magento 1-1
Manual magento 1-1
 
Literatura guatemalteca de finales del siglo XIX
Literatura guatemalteca de finales del siglo XIXLiteratura guatemalteca de finales del siglo XIX
Literatura guatemalteca de finales del siglo XIX
 
IVA CAIXA
IVA CAIXAIVA CAIXA
IVA CAIXA
 
Marketing Digital
Marketing DigitalMarketing Digital
Marketing Digital
 
Actitud Laboral
Actitud LaboralActitud Laboral
Actitud Laboral
 
Digital Influence - The social professional
Digital Influence - The social professionalDigital Influence - The social professional
Digital Influence - The social professional
 
Motion Django Meetup
Motion Django MeetupMotion Django Meetup
Motion Django Meetup
 
Presentación Internet_ruben diaz
Presentación Internet_ruben diaz Presentación Internet_ruben diaz
Presentación Internet_ruben diaz
 
RAF TABTRONICS LLC COMPANY OVERVIEW - 2014
RAF TABTRONICS LLC COMPANY OVERVIEW - 2014RAF TABTRONICS LLC COMPANY OVERVIEW - 2014
RAF TABTRONICS LLC COMPANY OVERVIEW - 2014
 
Norwich o crest_bred
Norwich o crest_bredNorwich o crest_bred
Norwich o crest_bred
 
La Diaclasa (Benaocaz)
La Diaclasa  (Benaocaz)La Diaclasa  (Benaocaz)
La Diaclasa (Benaocaz)
 
2911 1 3
2911 1 32911 1 3
2911 1 3
 
¿Qué es la Facioterapia?
¿Qué es la Facioterapia?¿Qué es la Facioterapia?
¿Qué es la Facioterapia?
 
Curso inicial
Curso inicialCurso inicial
Curso inicial
 
Procesos mc perú
Procesos mc perúProcesos mc perú
Procesos mc perú
 
Artseduca 7
Artseduca 7Artseduca 7
Artseduca 7
 
Psicologia+clinica+que+es
Psicologia+clinica+que+esPsicologia+clinica+que+es
Psicologia+clinica+que+es
 
Exercici portfolio
Exercici portfolioExercici portfolio
Exercici portfolio
 
PROGRAMA ERRADICACION DE LA MOSCA DEL MEDITERRANEO EN MENDOZA
PROGRAMA ERRADICACION DE LA MOSCA DEL MEDITERRANEO EN MENDOZAPROGRAMA ERRADICACION DE LA MOSCA DEL MEDITERRANEO EN MENDOZA
PROGRAMA ERRADICACION DE LA MOSCA DEL MEDITERRANEO EN MENDOZA
 
Contraste
ContrasteContraste
Contraste
 

Ähnlich wie From SQL to MongoDB

Hibernate in XPages
Hibernate in XPagesHibernate in XPages
Hibernate in XPages
Toby Samples
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects Optimization
WO Community
 

Ähnlich wie From SQL to MongoDB (20)

Azure DocumentDB
Azure DocumentDBAzure DocumentDB
Azure DocumentDB
 
Document db
Document dbDocument db
Document db
 
MongoDB & NoSQL 101
 MongoDB & NoSQL 101 MongoDB & NoSQL 101
MongoDB & NoSQL 101
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
Hibernate in XPages
Hibernate in XPagesHibernate in XPages
Hibernate in XPages
 
Accesso ai dati con Azure Data Platform
Accesso ai dati con Azure Data PlatformAccesso ai dati con Azure Data Platform
Accesso ai dati con Azure Data Platform
 
mongodb_DS.pptx
mongodb_DS.pptxmongodb_DS.pptx
mongodb_DS.pptx
 
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
 
Mongodb my
Mongodb myMongodb my
Mongodb my
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
Solving Your Backup Needs Using MongoDB Ops Manager, Cloud Manager and Atlas
Solving Your Backup Needs Using MongoDB Ops Manager, Cloud Manager and AtlasSolving Your Backup Needs Using MongoDB Ops Manager, Cloud Manager and Atlas
Solving Your Backup Needs Using MongoDB Ops Manager, Cloud Manager and Atlas
 
MongoDB.local Austin 2018: Solving Your Backup Needs Using MongoDB Ops Manage...
MongoDB.local Austin 2018: Solving Your Backup Needs Using MongoDB Ops Manage...MongoDB.local Austin 2018: Solving Your Backup Needs Using MongoDB Ops Manage...
MongoDB.local Austin 2018: Solving Your Backup Needs Using MongoDB Ops Manage...
 
MongoDB.local DC 2018: Solving Your Backup Needs Using MongoDB Ops Manager, C...
MongoDB.local DC 2018: Solving Your Backup Needs Using MongoDB Ops Manager, C...MongoDB.local DC 2018: Solving Your Backup Needs Using MongoDB Ops Manager, C...
MongoDB.local DC 2018: Solving Your Backup Needs Using MongoDB Ops Manager, C...
 
SilverStripe From a Developer's Perspective
SilverStripe From a Developer's PerspectiveSilverStripe From a Developer's Perspective
SilverStripe From a Developer's Perspective
 
Sqlite
SqliteSqlite
Sqlite
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
 
TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...
TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...
TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects Optimization
 

Mehr von Nuxeo

Enabling Digital Transformation Amidst a Global Pandemic | Low-Code, Cloud, A...
Enabling Digital Transformation Amidst a Global Pandemic | Low-Code, Cloud, A...Enabling Digital Transformation Amidst a Global Pandemic | Low-Code, Cloud, A...
Enabling Digital Transformation Amidst a Global Pandemic | Low-Code, Cloud, A...
Nuxeo
 

Mehr von Nuxeo (20)

Own the Digital Shelf Strategies Food and Beverage Companies
Own the Digital Shelf Strategies Food and Beverage CompaniesOwn the Digital Shelf Strategies Food and Beverage Companies
Own the Digital Shelf Strategies Food and Beverage Companies
 
How DAM Librarians Can Get Ready for the Uncertain Future
How DAM Librarians Can Get Ready for the Uncertain FutureHow DAM Librarians Can Get Ready for the Uncertain Future
How DAM Librarians Can Get Ready for the Uncertain Future
 
How Insurers Fueled Transformation During a Pandemic
How Insurers Fueled Transformation During a PandemicHow Insurers Fueled Transformation During a Pandemic
How Insurers Fueled Transformation During a Pandemic
 
Manage your Content at Scale with MongoDB and Nuxeo
Manage your Content at Scale with MongoDB and NuxeoManage your Content at Scale with MongoDB and Nuxeo
Manage your Content at Scale with MongoDB and Nuxeo
 
Accelerate the Digital Supply Chain From Idea to Support
Accelerate the Digital Supply Chain From Idea to SupportAccelerate the Digital Supply Chain From Idea to Support
Accelerate the Digital Supply Chain From Idea to Support
 
Where are you in the DAM Continuum
Where are you in the DAM ContinuumWhere are you in the DAM Continuum
Where are you in the DAM Continuum
 
Customer Experience in 2021
Customer Experience in 2021Customer Experience in 2021
Customer Experience in 2021
 
L’IA personnalisée, clé d’une gestion de l’information innovante
L’IA personnalisée, clé d’une gestion de l’information innovanteL’IA personnalisée, clé d’une gestion de l’information innovante
L’IA personnalisée, clé d’une gestion de l’information innovante
 
Gérer ses contenus avec MongoDB et Nuxeo
Gérer ses contenus avec MongoDB et NuxeoGérer ses contenus avec MongoDB et Nuxeo
Gérer ses contenus avec MongoDB et Nuxeo
 
Le DAM en 2021 : Tendances, points clés et critères d'évaluation
Le DAM en 2021 : Tendances, points clés et critères d'évaluationLe DAM en 2021 : Tendances, points clés et critères d'évaluation
Le DAM en 2021 : Tendances, points clés et critères d'évaluation
 
Enabling Digital Transformation Amidst a Global Pandemic | Low-Code, Cloud, A...
Enabling Digital Transformation Amidst a Global Pandemic | Low-Code, Cloud, A...Enabling Digital Transformation Amidst a Global Pandemic | Low-Code, Cloud, A...
Enabling Digital Transformation Amidst a Global Pandemic | Low-Code, Cloud, A...
 
Elevate your Customer's Experience and Stay Ahead of the Competition
Elevate your Customer's Experience and Stay Ahead of the CompetitionElevate your Customer's Experience and Stay Ahead of the Competition
Elevate your Customer's Experience and Stay Ahead of the Competition
 
Driving Brand Loyalty Through Superior Customer Experience
Driving Brand Loyalty Through Superior Customer Experience Driving Brand Loyalty Through Superior Customer Experience
Driving Brand Loyalty Through Superior Customer Experience
 
Drive Enterprise Speed and Scale with A Cloud-Native DAM
Drive Enterprise Speed and Scale with A Cloud-Native DAMDrive Enterprise Speed and Scale with A Cloud-Native DAM
Drive Enterprise Speed and Scale with A Cloud-Native DAM
 
The Big Picture: the Role of Video, Photography, and Content in Enhancing the...
The Big Picture: the Role of Video, Photography, and Content in Enhancing the...The Big Picture: the Role of Video, Photography, and Content in Enhancing the...
The Big Picture: the Role of Video, Photography, and Content in Enhancing the...
 
How Creatives Are Getting Creative in 2020 and Beyond
How Creatives Are Getting Creative in 2020 and BeyondHow Creatives Are Getting Creative in 2020 and Beyond
How Creatives Are Getting Creative in 2020 and Beyond
 
Digitalisation : Améliorez la collaboration et l’expérience client grâce au DAM
Digitalisation : Améliorez la collaboration et l’expérience client grâce au DAMDigitalisation : Améliorez la collaboration et l’expérience client grâce au DAM
Digitalisation : Améliorez la collaboration et l’expérience client grâce au DAM
 
Reimagine Your Claims Process with Future-Proof Technologies
Reimagine Your Claims Process with Future-Proof TechnologiesReimagine Your Claims Process with Future-Proof Technologies
Reimagine Your Claims Process with Future-Proof Technologies
 
Comment le Centre Hospitalier Laborit dématérialise ses processus administratifs
Comment le Centre Hospitalier Laborit dématérialise ses processus administratifsComment le Centre Hospitalier Laborit dématérialise ses processus administratifs
Comment le Centre Hospitalier Laborit dématérialise ses processus administratifs
 
Accelerating the Packaging Design Process with Artificial Intelligence
Accelerating the Packaging Design Process with Artificial IntelligenceAccelerating the Packaging Design Process with Artificial Intelligence
Accelerating the Packaging Design Process with Artificial Intelligence
 

Kürzlich hochgeladen

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Kürzlich hochgeladen (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 

From SQL to MongoDB

  • 1. Nuxeo: from SQL to MongoDB Florent Guillaume — Director of R&D, Nuxeo 2014-07-03
  • 4. Nuxeo Core — Rich Documents • Scalars • Strings, Integers, Floats, Booleans, Dates • Binary blobs (stored using separate BinaryStore service) • Arrays of scalars • Complex properties (sub-documents) • Lists of complex properties • System properties • Id, type, facets, lifecycle state, ACL, version flags...
  • 5. Nuxeo Core — Rich Documents • Scalar properties and arrays • dc:title = "My Document" • dc:contributors = ["bob", "pete", "mary"] • dc:created = 2014-07-03T12:15:07+0200 • ecm:uuid = 52a7352b-041e-49ed-8676-328ce90cc103 • ecm:primaryType = "MyFile" • ecm:majorVersion = 2, ecm:minorVersion = 0 • ecm:isLatestMajorVersion = true, ecm:isLatestVersion = false
  • 6. Nuxeo Core — Rich Documents • Complex properties and lists of them • primaryAddress = { street = "1 rue René Clair", zip = "75018",
 city = "Paris", country = "France" } • files = [ • { name = "doc.txt", length = 1234, mime-type = "plain/text",
 data = 0111fefdc8b14738067e54f30e568115 } • { name = "doc.pdf", length = 29344, mime-type = "application/pdf",
 data = 20f42df3221d61cb3e6ab8916b248216 } ]
  • 7. Nuxeo Core — Rich Operations • CRUD • Create • Retrieve • Update • Delete • Move • Copy • ... but in a Hierarchy
  • 8. Nuxeo Core — Rich Features • Security based on ACLs and inheritance • block bob for Write, allow members for Read • Proxies (multi-filing) • Versioning • Placeless documents (versions, tags, relations...) • Facets (dynamic typing) • Locking • Search (NXQL)
 SELECT * FROM File WHERE files/*/name = 'doc.txt'
  • 9. Nuxeo Core — Hierarchy • Parent-child relationship • Recursion • Find all the children to change something • Lifecycle state • Security • Search on a subset of the hierarchy • ... AND ecm:path STARTSWITH '/workspaces/receipts'
  • 11. Storage — SQL • Stores data in a set of JOINed tables • Star schema, around the main hierarchy • Lists as JOINed table with item/pos • Complex properties as sub-documents (children) • Lists of complex properties as ordered sub-documents • Id generated by application or database • String / native UUID / serial integer
  • 15. Storage — MongoDB • Standard JSON documents • Property names fully prefixed • Lists as arrays of scalars • Complex properties as sub-documents • Complex lists as arrays of sub-documents • Id generated by MongoDB • Counter using findAndModify, $inc and returnNew
  • 16. Storage — MongoDB "ecm:id": "52a7352b-041e-49ed-8676-328ce90cc103",
 "dc:title": "My Document",
 "dc:contributors": ["bob", "pete", "mary"],
 "dc:created": ISODate("2014-07-03T12:15:07+0200"),
 "ecm:primaryType": "MyFile",
 "ecm:majorVersion": NumberLong(2),
 "ecm:minorVersion": NumberLong(0),
 "ecm:isLatestMajorVersion": true,
 "ecm:isLatestVersion": false,

  • 17. Storage — MongoDB primaryAddress: { street: "1 rue René Clair", zip: "75018",
 city: "Paris", country: "France" },
 files: [{ name: "doc.txt", length: 1234, mime-type: "plain/text",
 data: "0111fefdc8b14738067e54f30e568115" },
 { name: "doc.pdf", length: 29344, mime-type: "application/ pdf",
 data: "20f42df3221d61cb3e6ab8916b248216" }]
 "ecm:acp": [{
 name: "local",
 acl: [{ grant: false, perm: "Write", user: "bob" },
 { grant: true, perm: "Read", user: "pete" },
 { grant: true, perm: "Read", user: "members" }]
 }]
  • 18. Hierarchy — SQL • Parent-child relationship • hierarchy.parentid column • Recursion optimized through ancestors table • For each document list all its ancestors • Maintained by database triggers (create, delete, move, copy) • Alternative for PostgreSQL: array column with all ancestors
  • 20. Hierarchy — MongoDB • Parent-child relationship • ecm:parentId field • Recursion optimized through ecm:ancestorIds array • Maintained by framework (create, delete, move, copy)
  • 22. Proxies — SQL • Reference to target document • proxies.targetid column • Holds only hierarchy-based information, no content • Parent, name, ACL... • Additional JOIN during search
  • 23. Proxies — MongoDB • Copy of the target document • ecm:proxyTargetId field • Target document knows who's pointing to it • ecm:proxyIds field • Maintained by framework • Copy needs to be kept up to date when target changes • Maintained by framework
  • 24. Proxies — Semantics • What to do when: • Target removed (→ forbid) • Proxy removed • Proxy + target removed at the same time (→ ok) • Target copied • Proxy copied (→ new proxy to original target) • Proxy + target copied at the same time (todo)
  • 25. Security — SQL • Generic ACP stored in acls table • Precomputed Read ACLs needed for search • Ordered list of identities having access, with blocking
 ["Management", "Supervisors", "-Temps", "bob"] • Read ACLs are given an identifier • Identities having access to which Read ACL is precomputed • Maintained by database triggers • Search matches using JOIN
  • 28. Security — MongoDB • Generic ACP stored in ecm:acp field • Precomputed Read ACLs needed for search • Simple set of identities having access
 ecm:racl: ["Management", "Supervisors", "bob"]! • Semantic restrictions on blocking • Maintained by framework • Search matches if intersection
 {"ecm:racl": {"$in": ["bob", "members", "Everyone"]}}
  • 29. Search — SQL • Translated from NXQL to SQL • JOIN of all required star/list/complex properties tables • Additional UNION + JOINs for proxies • Additional JOIN for security • Can have correlations (reuse same JOIN) • Fulltext index(es) on fulltext.simpletext / fulltext.binarytext columns
  • 30. • Translated from NXQL to MongoDB syntax • Proxies queried directly • Security queried by set intersection • One fulltext index for ecm:fulltextSimple / ecm:fulltextBinary fields • Some limitations Search — MongoDB
  • 31. Search — MongoDB Limitations • Only one fulltext search per query, restrictions on position • No generic boolean NOT, must be pushed down as negative operators • Search is field/value based • No multi-field operators (title = description, expirationDate > modificationDate) • No multi-field arithmetic (amount + bonus < 1000) • Subdocument correlation with $elemMatch is less generic than full JOINs
  • 32. Transactions — SQL • Standard SQL database capabilities • Atomic commit • Two-phase commit (prepare/commit) also useable, although costly • Rollback • Transient data is data modified in the database but not yet committed • Transient data is visible along committed data for retrieval and search
  • 33. Transactions — MongoDB • No atomic commit beyond a single document • Commit using a big batch of create/delete/update accumulated in-memory • Not atomic, others can see partial state • No transient space • Emulate transient space in-memory, flush at commit time • All accesses and searches must check the transient space as well as MongoDB
  • 34. Transactions — MongoDB • No rollback • Rollback by dropping the in-memory transient space • Operations involving several documents in relation • Move, delete, copy, ancestors or recursion checks • Using transient space + MongoDB for them is too complex • Flush to MongoDB before doing them (commit) • Must be able to be rolled back if needed (transaction compensation) • Others can see state that's eventually invalid
  • 35. MongoDB — Restrictions • Eventual consistency and no transactions • Prevents strong checks • Duplicate name in a folder • Move creating cycles • Remove target before proxy • Create document in a deleted folder • Prevents full consistency of hierarchical processing • Read ACLs, quotas • Needs background jobs that check consistency
  • 36. MongoDB — Features • Bulk operations • Map-reduce for aggregations • Quotas / count / folder content last modified • Conditional updates • Locks • Prevent dirty writes • GridFS to store binaries • Sharding
  • 38. Future Work • DBS used for more services • Directories / Vocabularies / User database • Audit log • DBS for other backends • Elasticsearch • Redis • PostgreSQL / JSON • Other...