SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
An introduction to U1Db David Planella @ Ubuntu Online Summit, June 2014
> U1Db basics
(c) 2013 Canonical
U1Db in a nutshell
> U1DB is a database API for synchronised databases of JSON documents
> Enables apps to store documents and sync them across devices
> Implementations are platform-specific, the API is platform-agnostic
> Simple to use
> Schemaless - more flexibility and faster development
> Intended for user-specific data
U1Db basics
(c) 2013 Canonical
U1Db is document-oriented
> In U1Db databases store JSON documents
> Documents don’t need a predefined list of fields
{ "key": "value" }
{ "firstname": "Jan", "surname": "Molby", "position": "midfield" }
{ "department": "Department of redundancy department",
"managers": [
{ "name": "Mary", "phone_number": "12345" },
{ "name": "Katherine" },
{ "name": "Rob", "phone_number": "54321" } ]
}
U1Db basics
(c) 2013 Canonical
U1Db elements
> Document storage and retrieval
> Covers the basic creation, retrieval and edition of documents
> Database, Document
> Querying
> Retrieval of a subset of documents based on certain criteria
> Index, Query
> Sync
> Synchronization of data across devices via a U1Db server
> Synchronizer
U1Db basics
> U1Db for app developers
(c) 2013 Canonical
Document storage and retrieval: the Database
> Provides the permanent storage for the app’s data
> Can be used directly as a model by other QML elements (e.g. ListView)
import U1db 1.0 as U1db
U1db.Database {
id: aDatabase
path: "aDatabase.u1db"
}
U1Db for app developers
(c) 2013 Canonical
Document storage and retrieval: the Document
> A database will generally contain multiple JSON-oriented documents
> Documents can be created dynamically at runtime
import U1db 1.0 as U1db
U1db.Document {
id: aDocument
database: aDatabase
docId: "lastPlace"
create: true
defaults: { "place": "Barcelona" }
}
U1Db for app developers
(c) 2013 Canonical
Querying: the Index
> An Index defines what fields can be filtered using a Query
> Used to retrieve documents other than by doc ID
> An index is created from ‘’index expressions’‘, which name one
or more fields in the document
import U1db 1.0 as U1db
U1db.Index {
id: by_place
database: aDatabase
expression: ["place"] // Use dot notation for nested fields
}
U1Db for app developers
(c) 2013 Canonical
Querying: the Query
> Once an index has been defined, the query is used to retrieve the data
> Can be used directly as a model by other QML elements (e.g. ListView)
> “Starts with” queries with wildcards are also supported
import U1db 1.0 as U1db
U1db.Query {
id: places
index: by_place
query: [ { "*" } ] // Could also be "Barc*" for further filtering
}
U1Db for app developers
> U1Db demo
Thank you
and
stay in touch!
> David Planella <david.planella@ubuntu.com>
> +DavidPlanella · @dplanella
> developer.ubuntu.com
> @ubuntuappdev
> gplus.to/ubuntuappdev
> facebook.com/ubuntuappdev

Más contenido relacionado

La actualidad más candente

The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
MongoDB
 

La actualidad más candente (20)

An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Updating materialized views and caches using kafka
Updating materialized views and caches using kafkaUpdating materialized views and caches using kafka
Updating materialized views and caches using kafka
 
2011 mongo FR - scaling with mongodb
2011 mongo FR - scaling with mongodb2011 mongo FR - scaling with mongodb
2011 mongo FR - scaling with mongodb
 
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorAnalytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop Connector
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Full metal mongo
Full metal mongoFull metal mongo
Full metal mongo
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
 
MongoDB
MongoDBMongoDB
MongoDB
 
Replicating application data into materialized views
Replicating application data into materialized viewsReplicating application data into materialized views
Replicating application data into materialized views
 
Webinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDBWebinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDB
 
2011 Mongo FR - MongoDB introduction
2011 Mongo FR - MongoDB introduction2011 Mongo FR - MongoDB introduction
2011 Mongo FR - MongoDB introduction
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behl
 
Mongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg Solutions
 
Agg framework selectgroup feb2015 v2
Agg framework selectgroup feb2015 v2Agg framework selectgroup feb2015 v2
Agg framework selectgroup feb2015 v2
 
MongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDBMongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDB
 
Wp1 2014
Wp1 2014Wp1 2014
Wp1 2014
 
Rethinkdb
RethinkdbRethinkdb
Rethinkdb
 

Similar a An introduction to U1db

Meetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDBMeetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDB
Minsk MongoDB User Group
 
Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...
Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
IndicThreads
 
Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2
rusersla
 
ArangoDB – A different approach to NoSQL
ArangoDB – A different approach to NoSQLArangoDB – A different approach to NoSQL
ArangoDB – A different approach to NoSQL
ArangoDB Database
 
Spark SQL - 10 Things You Need to Know
Spark SQL - 10 Things You Need to KnowSpark SQL - 10 Things You Need to Know
Spark SQL - 10 Things You Need to Know
Kristian Alexander
 

Similar a An introduction to U1db (20)

Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
 
Meetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDBMeetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDB
 
Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...
Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
CouchDB : More Couch
CouchDB : More CouchCouchDB : More Couch
CouchDB : More Couch
 
Code Camp - Building a Glass app with Wakanda
Code Camp - Building a Glass app with WakandaCode Camp - Building a Glass app with Wakanda
Code Camp - Building a Glass app with Wakanda
 
MongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and ImplicationsMongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and Implications
 
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
 
9b. Document-Oriented Databases lab
9b. Document-Oriented Databases lab9b. Document-Oriented Databases lab
9b. Document-Oriented Databases lab
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 Hour
 
Adodb Pdo Presentation
Adodb Pdo PresentationAdodb Pdo Presentation
Adodb Pdo Presentation
 
Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2Los Angeles R users group - Dec 14 2010 - Part 2
Los Angeles R users group - Dec 14 2010 - Part 2
 
Webinar: The Anatomy of the Cloudant Data Layer
Webinar: The Anatomy of the Cloudant Data LayerWebinar: The Anatomy of the Cloudant Data Layer
Webinar: The Anatomy of the Cloudant Data Layer
 
ArangoDB – A different approach to NoSQL
ArangoDB – A different approach to NoSQLArangoDB – A different approach to NoSQL
ArangoDB – A different approach to NoSQL
 
Where are yours vertexes and what are they talking about?
Where are yours vertexes and what are they talking about?Where are yours vertexes and what are they talking about?
Where are yours vertexes and what are they talking about?
 
2017 10-oow-fma-application-containers-v01-final
2017 10-oow-fma-application-containers-v01-final2017 10-oow-fma-application-containers-v01-final
2017 10-oow-fma-application-containers-v01-final
 
HyperGraphQL
HyperGraphQLHyperGraphQL
HyperGraphQL
 
Reactive dashboard’s using apache spark
Reactive dashboard’s using apache sparkReactive dashboard’s using apache spark
Reactive dashboard’s using apache spark
 
Spark SQL - 10 Things You Need to Know
Spark SQL - 10 Things You Need to KnowSpark SQL - 10 Things You Need to Know
Spark SQL - 10 Things You Need to Know
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

An introduction to U1db

  • 1. An introduction to U1Db David Planella @ Ubuntu Online Summit, June 2014
  • 3. (c) 2013 Canonical U1Db in a nutshell > U1DB is a database API for synchronised databases of JSON documents > Enables apps to store documents and sync them across devices > Implementations are platform-specific, the API is platform-agnostic > Simple to use > Schemaless - more flexibility and faster development > Intended for user-specific data U1Db basics
  • 4. (c) 2013 Canonical U1Db is document-oriented > In U1Db databases store JSON documents > Documents don’t need a predefined list of fields { "key": "value" } { "firstname": "Jan", "surname": "Molby", "position": "midfield" } { "department": "Department of redundancy department", "managers": [ { "name": "Mary", "phone_number": "12345" }, { "name": "Katherine" }, { "name": "Rob", "phone_number": "54321" } ] } U1Db basics
  • 5. (c) 2013 Canonical U1Db elements > Document storage and retrieval > Covers the basic creation, retrieval and edition of documents > Database, Document > Querying > Retrieval of a subset of documents based on certain criteria > Index, Query > Sync > Synchronization of data across devices via a U1Db server > Synchronizer U1Db basics
  • 6. > U1Db for app developers
  • 7. (c) 2013 Canonical Document storage and retrieval: the Database > Provides the permanent storage for the app’s data > Can be used directly as a model by other QML elements (e.g. ListView) import U1db 1.0 as U1db U1db.Database { id: aDatabase path: "aDatabase.u1db" } U1Db for app developers
  • 8. (c) 2013 Canonical Document storage and retrieval: the Document > A database will generally contain multiple JSON-oriented documents > Documents can be created dynamically at runtime import U1db 1.0 as U1db U1db.Document { id: aDocument database: aDatabase docId: "lastPlace" create: true defaults: { "place": "Barcelona" } } U1Db for app developers
  • 9. (c) 2013 Canonical Querying: the Index > An Index defines what fields can be filtered using a Query > Used to retrieve documents other than by doc ID > An index is created from ‘’index expressions’‘, which name one or more fields in the document import U1db 1.0 as U1db U1db.Index { id: by_place database: aDatabase expression: ["place"] // Use dot notation for nested fields } U1Db for app developers
  • 10. (c) 2013 Canonical Querying: the Query > Once an index has been defined, the query is used to retrieve the data > Can be used directly as a model by other QML elements (e.g. ListView) > “Starts with” queries with wildcards are also supported import U1db 1.0 as U1db U1db.Query { id: places index: by_place query: [ { "*" } ] // Could also be "Barc*" for further filtering } U1Db for app developers
  • 12. Thank you and stay in touch! > David Planella <david.planella@ubuntu.com> > +DavidPlanella · @dplanella > developer.ubuntu.com > @ubuntuappdev > gplus.to/ubuntuappdev > facebook.com/ubuntuappdev