SlideShare a Scribd company logo
1 of 35
Download to read offline
Voyage by example 
tips and tricks on persisting object models
Esteban Lorenzano 
Pharo core developer 
INRIA - RMoD 
http://smallworks.eu
Why? 
• You already know about Voyage 
• You already attended to a tutorial last year 
• But there are some recurrent problems people find 
when trying to use it 
• And I’m still seeing a lot of people that could be 
using it and they chose other solutions
What is Voyage? (1) 
• Simple abstraction layer to map objects into a database 
- Very well suited for document databases, but in theory, 
the approach will work for other kind of repositories 
‣ There was (long time ago) a Voyage-GLORP backend 
‣ There was (even more time ago) a Voyage- 
ImageSegment backend 
- Voyage-Memory, Voyage-Mongo
What is Voyage? (2) 
• Did I said is simple? 
• it ensures object identity 
• it provides error handling 
• it implements a connection pool
Voyage principles 
• Behavioural complete (for common usage), but 
decoupled approach also possible. 
• Same design for different backends, but not a 
common abstraction 
- There is no such thing as a “voyage query 
language”, etc. 
- is a bit more work for users who want to switch, 
but a lot more happiness for the program itself
Voyage ultimate goal 
To be the GLORP for NoSQL databases
The problem to solve
Impedance mistmatch 
Class A Class B Class C 
Table A Table B Table C 
1..* 
*..* 
Ideal relational model
Impedance mistmatch 
aColection 
anObject otherObject 
firstObject 
secondObject 
thirdObject 
Real object model
Impedance mistmatch 
aColection 
anObject otherObject 
Real object model 
firstObject 
secondObject 
thirdObject
Impedance mistmatch 
aColection 
anObject otherObject 
Real object model 
firstObject 
secondObject 
thirdObject
So, what about those tips?
Think in objects
A simple model 
*..* 
Hero Power
Persist 
(Hero named: ‘Groot’) 
addPower: ((Power named: ‘Plant Control’) 
level: #epic; 
yourself); 
save.
Persist 
{ 
_id: OID(…), 
#version: …, 
#instanceOf: ‘Hero’, 
name: ‘Groot’, 
powers: [ { #collection: ‘Power’, __id: OID(…) } ] 
} 
! 
{ 
_id: OID(…), 
#version: …, 
#instanceOf: ‘Power’, 
name: ‘Plant Control’, 
level: #epic, 
heroes: [ #collection: ‘Hero’, __id: OID(…) ] 
}
Take control
A simple model 
(a bit more complete) 
*..* 
Hero Power 
1..* 
Equipment 
Container Pistol 
1..*
Persist 
(Hero named: ‘Star-lord’) 
addEquipment: (Container 
addItem: Pistol new; 
yourself); 
save.
Persist (1) 
{ 
_id: OID(…), 
#version: …, 
#instanceOf: ‘Hero’, 
name: ‘Star-lord’, 
powers: [], 
equipment: [ { 
#instanceOf: ‘Container’, 
‘items’, [ 
{ #instanceOf: ‘Pistol’ } ] } ] 
}
Persist (2) 
{ 
_id: OID(1), 
#version: …, 
#instanceOf: ‘Hero’, 
name: ‘Star-lord’, 
powers: [], 
equipment: [ { #collection: ‘Equipment’, __id: OID(2) } ] 
} 
! 
{ 
_id: OID(2), 
#version: …, 
#instanceOf: ‘Container’, 
items: [ { #collection: ‘Equipment’, __id: OID(3) } ] 
} 
! 
{ 
_id: OID(3), 
#version: …, 
#instanceOf: ‘Pistol’, 
}
Integrity is a 
consequence
Allowing missing content 
• We do not have foreign keys 
- So we cannot do things like “ON DELETE 
CASCADE” 
- Even delete validations are difficult 
‣ Imagine “hero” has a “power”,and I remove the 
“power”. How can the hero notice it?
Persist 
mongoContainer 
<mongoContainer> 
! 
^ VOMongoContainer new 
collectionName: ‘powers’; 
enableMissingContent; 
yourself
Querying smart
Query (1) 
Hero 
selectMany: [ :each | … ] 
sortBy: { #name -> VOOrder ascending } asDictionary 
limit: 100 
offset: 100
Query (2) 
Hero 
selectMany: { 
‘name’ -> { 
‘$regexp’ -> ‘^G.*’. 
‘$options’ -> ‘i’ 
} asDictionary 
} asDictionary
Adapt schemes
The “scheme is not mine” 
problem 
• You can move meta-information to your program 
• Magritte-Voyage gives you a lot of power 
• You can extend/modify parts of the updating 
system too (like versioning)
Meta-information 
{ 
_id: OID(…), 
#version: …, 
#instanceOf: ‘Hero’, 
name: ‘Star-lord’, 
powers: [], 
equipment: [ { 
#instanceOf: ‘Container’, 
‘items’, [ 
{ #instanceOf: ‘Pistol’ } ] } ] 
}
Meta-information 
{ 
_id: OID(…), 
#version: …, 
#instanceOf: ‘Hero’, 
name: ‘Star-lord’, 
powers: [], 
equipment: [ { 
#instanceOf: ‘Container’, 
‘items’, [ 
{ #instanceOf: ‘Pistol’ } ] } ] 
}
Meta-information 
{ 
_id: OID(…), 
name: ‘Star-lord’, 
powers: [], 
equipment: [ { 
‘items’, [ {} ] } ] 
}
Voyage 2.0 
• Root detection (enhance save & update) 
• Cyclic detection 
- Add strategy to persist cycles even without roots (It has some 
consequences (in querying, etc.), so it will be optional) 
• integrity validations 
- #removeWithDependencies 
• Materialisation customisations 
- #readRaw 
• Add backend: Riak
Use it today! 
Gofer it 
smalltalkhubUser: ‘Pharo’ project: ’MetaRepoForPharo30’; 
configurationOf: ‘VoyageMongo’; 
loadStable. 
Thanks!! 
Esteban Lorenzano - 2014

More Related Content

What's hot

Designers Guide To jQuery
Designers Guide To jQueryDesigners Guide To jQuery
Designers Guide To jQuerySteve Krueger
 
Evolving Software with Moose
Evolving Software with MooseEvolving Software with Moose
Evolving Software with MooseDave Cross
 
Multitenant applications: How and Why
Multitenant applications: How and WhyMultitenant applications: How and Why
Multitenant applications: How and WhyFilipe Ximenes
 
Creatively creating custom post types! word sesh2
Creatively creating custom post types!  word sesh2Creatively creating custom post types!  word sesh2
Creatively creating custom post types! word sesh2techvoltz
 
Serializing Ruby Objects in Redis
Serializing Ruby Objects in RedisSerializing Ruby Objects in Redis
Serializing Ruby Objects in RedisBrian Kaney
 
"The worst code I ever wrote"
"The worst code I ever wrote""The worst code I ever wrote"
"The worst code I ever wrote"Tomas Doran
 
Advanced Debugging with Xcode - Extending LLDB
Advanced Debugging with Xcode - Extending LLDBAdvanced Debugging with Xcode - Extending LLDB
Advanced Debugging with Xcode - Extending LLDBAijaz Ansari
 
Getting startedwith noir-clojureexchange-2011
Getting startedwith noir-clojureexchange-2011Getting startedwith noir-clojureexchange-2011
Getting startedwith noir-clojureexchange-2011John Stevenson
 
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013Tim Plummer
 
Using Data That Isn't Yours
Using Data That Isn't YoursUsing Data That Isn't Yours
Using Data That Isn't Yourscogsprocket
 
Introduction to Ruby, Rails, and Ruby on Rails
Introduction to Ruby, Rails, and Ruby on RailsIntroduction to Ruby, Rails, and Ruby on Rails
Introduction to Ruby, Rails, and Ruby on RailsSimon Bagreev
 

What's hot (19)

Redis and Ohm
Redis and OhmRedis and Ohm
Redis and Ohm
 
Why Ruby?
Why Ruby? Why Ruby?
Why Ruby?
 
Smalltalk on rubinius
Smalltalk on rubiniusSmalltalk on rubinius
Smalltalk on rubinius
 
Designers Guide To jQuery
Designers Guide To jQueryDesigners Guide To jQuery
Designers Guide To jQuery
 
Evolving Software with Moose
Evolving Software with MooseEvolving Software with Moose
Evolving Software with Moose
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 
Multitenant applications: How and Why
Multitenant applications: How and WhyMultitenant applications: How and Why
Multitenant applications: How and Why
 
Your JavaScript Library
Your JavaScript LibraryYour JavaScript Library
Your JavaScript Library
 
Creatively creating custom post types! word sesh2
Creatively creating custom post types!  word sesh2Creatively creating custom post types!  word sesh2
Creatively creating custom post types! word sesh2
 
Serializing Ruby Objects in Redis
Serializing Ruby Objects in RedisSerializing Ruby Objects in Redis
Serializing Ruby Objects in Redis
 
Sprockets
SprocketsSprockets
Sprockets
 
"The worst code I ever wrote"
"The worst code I ever wrote""The worst code I ever wrote"
"The worst code I ever wrote"
 
Essential YUI
Essential YUIEssential YUI
Essential YUI
 
Advanced Debugging with Xcode - Extending LLDB
Advanced Debugging with Xcode - Extending LLDBAdvanced Debugging with Xcode - Extending LLDB
Advanced Debugging with Xcode - Extending LLDB
 
Getting startedwith noir-clojureexchange-2011
Getting startedwith noir-clojureexchange-2011Getting startedwith noir-clojureexchange-2011
Getting startedwith noir-clojureexchange-2011
 
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
 
Using Data That Isn't Yours
Using Data That Isn't YoursUsing Data That Isn't Yours
Using Data That Isn't Yours
 
Introduction to Ruby, Rails, and Ruby on Rails
Introduction to Ruby, Rails, and Ruby on RailsIntroduction to Ruby, Rails, and Ruby on Rails
Introduction to Ruby, Rails, and Ruby on Rails
 
The jQuery Divide
The jQuery DivideThe jQuery Divide
The jQuery Divide
 

Similar to Voyage by example

Drupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the islandDrupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the islandAngela Byron
 
Questioning the status quo
Questioning the status quoQuestioning the status quo
Questioning the status quoIvano Pagano
 
Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?ColdFusionConference
 
Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?devObjective
 
Everything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-insEverything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-insAndrew Dupont
 
Scalable JavaScript Design Patterns
Scalable JavaScript Design PatternsScalable JavaScript Design Patterns
Scalable JavaScript Design PatternsAddy Osmani
 
【前端Mvc】之豆瓣说实践
【前端Mvc】之豆瓣说实践【前端Mvc】之豆瓣说实践
【前端Mvc】之豆瓣说实践taobao.com
 
Learn JS concepts by implementing jQuery
Learn JS concepts by implementing jQueryLearn JS concepts by implementing jQuery
Learn JS concepts by implementing jQueryWingify Engineering
 

Similar to Voyage by example (20)

Voyage by example
Voyage by exampleVoyage by example
Voyage by example
 
Django at Scale
Django at ScaleDjango at Scale
Django at Scale
 
Dependency injectionpreso
Dependency injectionpresoDependency injectionpreso
Dependency injectionpreso
 
Week3
Week3Week3
Week3
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 
Drupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the islandDrupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the island
 
All of javascript
All of javascriptAll of javascript
All of javascript
 
Questioning the status quo
Questioning the status quoQuestioning the status quo
Questioning the status quo
 
Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?
 
Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
Design patterns
Design patternsDesign patterns
Design patterns
 
About Python
About PythonAbout Python
About Python
 
Everything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-insEverything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-ins
 
Scalable JavaScript Design Patterns
Scalable JavaScript Design PatternsScalable JavaScript Design Patterns
Scalable JavaScript Design Patterns
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
обзор Python
обзор Pythonобзор Python
обзор Python
 
Jvm internals
Jvm internalsJvm internals
Jvm internals
 
【前端Mvc】之豆瓣说实践
【前端Mvc】之豆瓣说实践【前端Mvc】之豆瓣说实践
【前端Mvc】之豆瓣说实践
 
Learn JS concepts by implementing jQuery
Learn JS concepts by implementing jQueryLearn JS concepts by implementing jQuery
Learn JS concepts by implementing jQuery
 

More from ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

More from ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Recently uploaded

The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionWave PLM
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAlluxio, Inc.
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1KnowledgeSeed
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...rajkumar669520
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfFurqanuddin10
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationHelp Desk Migration
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAlluxio, Inc.
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...Alluxio, Inc.
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAlluxio, Inc.
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024vaibhav130304
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfmbmh111980
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024Shane Coughlan
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Andreas Granig
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Gáspár Nagy
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Andrea Goulet
 
Naer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research SynthesisNaer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research Synthesisparimabajra
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfWSO2
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...OnePlan Solutions
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...naitiksharma1124
 

Recently uploaded (20)

The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion Production
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
Naer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research SynthesisNaer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research Synthesis
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 

Voyage by example

  • 1. Voyage by example tips and tricks on persisting object models
  • 2. Esteban Lorenzano Pharo core developer INRIA - RMoD http://smallworks.eu
  • 3. Why? • You already know about Voyage • You already attended to a tutorial last year • But there are some recurrent problems people find when trying to use it • And I’m still seeing a lot of people that could be using it and they chose other solutions
  • 4. What is Voyage? (1) • Simple abstraction layer to map objects into a database - Very well suited for document databases, but in theory, the approach will work for other kind of repositories ‣ There was (long time ago) a Voyage-GLORP backend ‣ There was (even more time ago) a Voyage- ImageSegment backend - Voyage-Memory, Voyage-Mongo
  • 5. What is Voyage? (2) • Did I said is simple? • it ensures object identity • it provides error handling • it implements a connection pool
  • 6. Voyage principles • Behavioural complete (for common usage), but decoupled approach also possible. • Same design for different backends, but not a common abstraction - There is no such thing as a “voyage query language”, etc. - is a bit more work for users who want to switch, but a lot more happiness for the program itself
  • 7. Voyage ultimate goal To be the GLORP for NoSQL databases
  • 9. Impedance mistmatch Class A Class B Class C Table A Table B Table C 1..* *..* Ideal relational model
  • 10. Impedance mistmatch aColection anObject otherObject firstObject secondObject thirdObject Real object model
  • 11. Impedance mistmatch aColection anObject otherObject Real object model firstObject secondObject thirdObject
  • 12. Impedance mistmatch aColection anObject otherObject Real object model firstObject secondObject thirdObject
  • 13. So, what about those tips?
  • 15. A simple model *..* Hero Power
  • 16. Persist (Hero named: ‘Groot’) addPower: ((Power named: ‘Plant Control’) level: #epic; yourself); save.
  • 17. Persist { _id: OID(…), #version: …, #instanceOf: ‘Hero’, name: ‘Groot’, powers: [ { #collection: ‘Power’, __id: OID(…) } ] } ! { _id: OID(…), #version: …, #instanceOf: ‘Power’, name: ‘Plant Control’, level: #epic, heroes: [ #collection: ‘Hero’, __id: OID(…) ] }
  • 19. A simple model (a bit more complete) *..* Hero Power 1..* Equipment Container Pistol 1..*
  • 20. Persist (Hero named: ‘Star-lord’) addEquipment: (Container addItem: Pistol new; yourself); save.
  • 21. Persist (1) { _id: OID(…), #version: …, #instanceOf: ‘Hero’, name: ‘Star-lord’, powers: [], equipment: [ { #instanceOf: ‘Container’, ‘items’, [ { #instanceOf: ‘Pistol’ } ] } ] }
  • 22. Persist (2) { _id: OID(1), #version: …, #instanceOf: ‘Hero’, name: ‘Star-lord’, powers: [], equipment: [ { #collection: ‘Equipment’, __id: OID(2) } ] } ! { _id: OID(2), #version: …, #instanceOf: ‘Container’, items: [ { #collection: ‘Equipment’, __id: OID(3) } ] } ! { _id: OID(3), #version: …, #instanceOf: ‘Pistol’, }
  • 23. Integrity is a consequence
  • 24. Allowing missing content • We do not have foreign keys - So we cannot do things like “ON DELETE CASCADE” - Even delete validations are difficult ‣ Imagine “hero” has a “power”,and I remove the “power”. How can the hero notice it?
  • 25. Persist mongoContainer <mongoContainer> ! ^ VOMongoContainer new collectionName: ‘powers’; enableMissingContent; yourself
  • 27. Query (1) Hero selectMany: [ :each | … ] sortBy: { #name -> VOOrder ascending } asDictionary limit: 100 offset: 100
  • 28. Query (2) Hero selectMany: { ‘name’ -> { ‘$regexp’ -> ‘^G.*’. ‘$options’ -> ‘i’ } asDictionary } asDictionary
  • 30. The “scheme is not mine” problem • You can move meta-information to your program • Magritte-Voyage gives you a lot of power • You can extend/modify parts of the updating system too (like versioning)
  • 31. Meta-information { _id: OID(…), #version: …, #instanceOf: ‘Hero’, name: ‘Star-lord’, powers: [], equipment: [ { #instanceOf: ‘Container’, ‘items’, [ { #instanceOf: ‘Pistol’ } ] } ] }
  • 32. Meta-information { _id: OID(…), #version: …, #instanceOf: ‘Hero’, name: ‘Star-lord’, powers: [], equipment: [ { #instanceOf: ‘Container’, ‘items’, [ { #instanceOf: ‘Pistol’ } ] } ] }
  • 33. Meta-information { _id: OID(…), name: ‘Star-lord’, powers: [], equipment: [ { ‘items’, [ {} ] } ] }
  • 34. Voyage 2.0 • Root detection (enhance save & update) • Cyclic detection - Add strategy to persist cycles even without roots (It has some consequences (in querying, etc.), so it will be optional) • integrity validations - #removeWithDependencies • Materialisation customisations - #readRaw • Add backend: Riak
  • 35. Use it today! Gofer it smalltalkhubUser: ‘Pharo’ project: ’MetaRepoForPharo30’; configurationOf: ‘VoyageMongo’; loadStable. Thanks!! Esteban Lorenzano - 2014