SlideShare a Scribd company logo
1 of 15
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 1
MongoDB & Ruby in 10 Minutes
Tobias.Trelle@codecentric.de @tobiastrelle
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 2
Tobias Trelle
- Senior IT Consultant @
codecentric AG (Düsseldorf)
- Organizer of MongoDB
User Group Düsseldorf
- Authoring a MongoDB book
(dpunkt-Verlag)
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 3
MongoDB
NoSQL data store / Open Source
Single records are called documents
Replication & Sharding out-of-the-box
Map/Reduce
Geospatial Indexes / Queries
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 4
MongoDB Overview
Server
Database
Collection
Document
Field
Tabelle
Zeile
Spalte
Relationales
Pendant Aber …
Flexibles
Schema
- Arrays
- Rekursiv
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 5
Documents
Ordered set of key/values pairs
Values can be an array, document or simple type
Max size = 16 MB
Logical namespaces for documents are called collections
Schemaless
Format: BSON = Binary JSON != JSON
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 6
Documents
{}
{ hello: "MongoDB" }
{ foo:
{ bar: "baz"},
a: [1,2,3,5,8]
}
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 7
MongoDB Gems
$ gem install mongo
Fetching: bson-1.9.0.gem (100%)
Fetching: mongo-1.9.0.gem (100%)
Successfully installed bson-1.9.0
Successfully installed mongo-1.9.0
2 gems installed
...
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 8
MongoDB Gems
$ gem install bson_ext
Fetching: bson_ext-1.9.0.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a
while...
Successfully installed bson_ext-1.9.0
1 gem installed...
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 9
Ruby Driver API
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 10
Ruby Driver
irb(main):001:0> require 'mongo'
=> true
irb(main):002:0> include Mongo
=> Object
irb(main):003:0> client = MongoClient.new
...
irb(main):004:0> db = client["test"]
...
irb(main):005:0> coll = db["foo"]
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 11
Ruby Driver
irb(main):006:0> coll.remove
=> {"n"=>3, "connectionId"=>2, "err"=>nil, "ok"=>1.0}
irb(main):007:0> coll.insert :hello => "MongoDB"
=> BSON::ObjectId('51d1100ec9f0b10b78000001')
irb(main):008:0> doc = coll.find_one
=>
{"_id"=>BSON::ObjectId('51d1100ec9f0b10b78000001'),
"hello"=>"MongoDB"}
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 12
Ruby Driver
irb(main):013:0> coll.insert :a => 1, b: [1,2,3,4,5]
=> BSON::ObjectId('51d1108ac9f0b10b78000002')
irb(main):014:0> crsr = coll.find
=> <Mongo::Cursor:0x158e2a8 namespace='test.foo'
@selector={} @cursor_id=>
irb(main):016:0> crsr.each{ |doc| puts doc }
{"_id"=>BSON::ObjectId('51d1100ec9f0b10b78000001'),
"hello"=>"MongoDB"}
{"_id"=>BSON::ObjectId('51d1108ac9f0b10b78000002'),
"a"=>1, "b"=>[1, 2, 3, 4, 5]}
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 13
Persistence Frameworks
Mongoid
http://mongoid.org/
MongoMapper
http://mongomapper.com/
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 14
MongoDB User Group Düsseldorf
https://www.xing.com/net/mongodb-dus
@MongoDUS
Meetup #7: Schema Design w/ MongoDB
18.07.2013 19:00
https://www.xing.com/events/7-treffen-schema-
design-mongodb-1268228
MUG Düsseldorf
codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 15
QUESTIONS?
Tobias Trelle
codecentric AG
Merscheider Str. 1
42699 Solingen
tel +49 (0) 212.233628.47
fax +49 (0) 212.233628.79
mail Tobias.Trelle@codecentric.de
twitter @tobiastrelle
www.codecentric.de
blog.codecentric.de/en/author/tobias-trelle
www.xing.com/net/mongodb-dus

More Related Content

What's hot

NoSQL and SQL Anti Patterns
NoSQL and SQL Anti PatternsNoSQL and SQL Anti Patterns
NoSQL and SQL Anti PatternsGleicon Moraes
 
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 HourPeter Friese
 
Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"Provectus
 
Yesplan: 10 Years later
Yesplan: 10 Years laterYesplan: 10 Years later
Yesplan: 10 Years laterPharo
 
Embulk at Treasure Data
Embulk at Treasure DataEmbulk at Treasure Data
Embulk at Treasure DataSatoshi Akama
 
ElasticSearch Introduction
ElasticSearch IntroductionElasticSearch Introduction
ElasticSearch IntroductionMinh Hoang
 
Aggregation APi in Ibexa DXP by Adam Wójs
Aggregation APi in Ibexa DXP by Adam WójsAggregation APi in Ibexa DXP by Adam Wójs
Aggregation APi in Ibexa DXP by Adam WójsJani Tarvainen
 
REST Web API with MongoDB
REST Web API with MongoDBREST Web API with MongoDB
REST Web API with MongoDBMongoDB
 
Easy deployment & management of cloud apps
Easy deployment & management of cloud appsEasy deployment & management of cloud apps
Easy deployment & management of cloud appsDavid Cunningham
 
JBoss Fuse Workshop 101 part 6
JBoss Fuse Workshop 101 part 6JBoss Fuse Workshop 101 part 6
JBoss Fuse Workshop 101 part 6Christina Lin
 
High Performance API Mashups with Node.js and ql.io
High Performance API Mashups with Node.js and ql.ioHigh Performance API Mashups with Node.js and ql.io
High Performance API Mashups with Node.js and ql.ioJonathan LeBlanc
 
Jsonnet, terraform & packer
Jsonnet, terraform & packerJsonnet, terraform & packer
Jsonnet, terraform & packerDavid Cunningham
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderSadayuki Furuhashi
 
What's new in Ansible 2.0
What's new in Ansible 2.0What's new in Ansible 2.0
What's new in Ansible 2.0Allan Denot
 
Ansible with AWS
Ansible with AWSAnsible with AWS
Ansible with AWSAllan Denot
 
Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#Tamir Dresher
 
Automating Workflows for Analytics Pipelines
Automating Workflows for Analytics PipelinesAutomating Workflows for Analytics Pipelines
Automating Workflows for Analytics PipelinesSadayuki Furuhashi
 

What's hot (20)

NoSQL and SQL Anti Patterns
NoSQL and SQL Anti PatternsNoSQL and SQL Anti Patterns
NoSQL and SQL Anti Patterns
 
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
 
Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"
 
Yesplan: 10 Years later
Yesplan: 10 Years laterYesplan: 10 Years later
Yesplan: 10 Years later
 
Embulk at Treasure Data
Embulk at Treasure DataEmbulk at Treasure Data
Embulk at Treasure Data
 
ElasticSearch Introduction
ElasticSearch IntroductionElasticSearch Introduction
ElasticSearch Introduction
 
Aggregation APi in Ibexa DXP by Adam Wójs
Aggregation APi in Ibexa DXP by Adam WójsAggregation APi in Ibexa DXP by Adam Wójs
Aggregation APi in Ibexa DXP by Adam Wójs
 
Embuk internals
Embuk internalsEmbuk internals
Embuk internals
 
REST Web API with MongoDB
REST Web API with MongoDBREST Web API with MongoDB
REST Web API with MongoDB
 
Easy deployment & management of cloud apps
Easy deployment & management of cloud appsEasy deployment & management of cloud apps
Easy deployment & management of cloud apps
 
JBoss Fuse Workshop 101 part 6
JBoss Fuse Workshop 101 part 6JBoss Fuse Workshop 101 part 6
JBoss Fuse Workshop 101 part 6
 
High Performance API Mashups with Node.js and ql.io
High Performance API Mashups with Node.js and ql.ioHigh Performance API Mashups with Node.js and ql.io
High Performance API Mashups with Node.js and ql.io
 
Jsonnet, terraform & packer
Jsonnet, terraform & packerJsonnet, terraform & packer
Jsonnet, terraform & packer
 
Scripting Embulk Plugins
Scripting Embulk PluginsScripting Embulk Plugins
Scripting Embulk Plugins
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loader
 
Docker Monitoring Webinar
Docker Monitoring  WebinarDocker Monitoring  Webinar
Docker Monitoring Webinar
 
What's new in Ansible 2.0
What's new in Ansible 2.0What's new in Ansible 2.0
What's new in Ansible 2.0
 
Ansible with AWS
Ansible with AWSAnsible with AWS
Ansible with AWS
 
Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#
 
Automating Workflows for Analytics Pipelines
Automating Workflows for Analytics PipelinesAutomating Workflows for Analytics Pipelines
Automating Workflows for Analytics Pipelines
 

Viewers also liked

Deepak ib solved paper
Deepak ib solved paperDeepak ib solved paper
Deepak ib solved paperDeepak R Gorad
 
Being A Socially Responsible Social Developer: Mobile App Security
Being A Socially Responsible Social Developer: Mobile App SecurityBeing A Socially Responsible Social Developer: Mobile App Security
Being A Socially Responsible Social Developer: Mobile App SecurityDoug Sillars
 
Ppt newton's law
Ppt newton's lawPpt newton's law
Ppt newton's lawmamardc
 
XPRESS VACATIONS
XPRESS VACATIONSXPRESS VACATIONS
XPRESS VACATIONSai04832122
 
Meatco AGM 2012 - CEO Presentation
Meatco AGM 2012 - CEO PresentationMeatco AGM 2012 - CEO Presentation
Meatco AGM 2012 - CEO Presentationmeatconamibia
 
Communication projects
Communication projectsCommunication projects
Communication projectsSenthil Kumar
 
deepak gorad Final csr
deepak gorad Final csrdeepak gorad Final csr
deepak gorad Final csrDeepak R Gorad
 
Deepak strategic managemt -apple
Deepak  strategic managemt -appleDeepak  strategic managemt -apple
Deepak strategic managemt -appleDeepak R Gorad
 
Project titles for eee, ece, eie - M.E, B.E, Ph.D, EEE, ECE, EIE Projects
Project titles for  eee, ece, eie - M.E, B.E, Ph.D, EEE, ECE, EIE Projects Project titles for  eee, ece, eie - M.E, B.E, Ph.D, EEE, ECE, EIE Projects
Project titles for eee, ece, eie - M.E, B.E, Ph.D, EEE, ECE, EIE Projects Senthil Kumar
 
Port folio 20121005
Port folio 20121005Port folio 20121005
Port folio 20121005Thành Mắm
 
Embedded project list
Embedded project listEmbedded project list
Embedded project listSenthil Kumar
 

Viewers also liked (20)

Deepak ib solved paper
Deepak ib solved paperDeepak ib solved paper
Deepak ib solved paper
 
Being A Socially Responsible Social Developer: Mobile App Security
Being A Socially Responsible Social Developer: Mobile App SecurityBeing A Socially Responsible Social Developer: Mobile App Security
Being A Socially Responsible Social Developer: Mobile App Security
 
Circuitanlys2
Circuitanlys2Circuitanlys2
Circuitanlys2
 
Dft2
Dft2Dft2
Dft2
 
Ppt newton's law
Ppt newton's lawPpt newton's law
Ppt newton's law
 
XPRESS VACATIONS
XPRESS VACATIONSXPRESS VACATIONS
XPRESS VACATIONS
 
Windows7
Windows7Windows7
Windows7
 
Reechal bday
Reechal bdayReechal bday
Reechal bday
 
Meatco AGM 2012 - CEO Presentation
Meatco AGM 2012 - CEO PresentationMeatco AGM 2012 - CEO Presentation
Meatco AGM 2012 - CEO Presentation
 
Communication projects
Communication projectsCommunication projects
Communication projects
 
Sante1 slideshare
Sante1 slideshareSante1 slideshare
Sante1 slideshare
 
deepak gorad Final csr
deepak gorad Final csrdeepak gorad Final csr
deepak gorad Final csr
 
Power
PowerPower
Power
 
Deepak strategic managemt -apple
Deepak  strategic managemt -appleDeepak  strategic managemt -apple
Deepak strategic managemt -apple
 
Mscc抜粋版
Mscc抜粋版Mscc抜粋版
Mscc抜粋版
 
Entrepreneurship
EntrepreneurshipEntrepreneurship
Entrepreneurship
 
Project titles for eee, ece, eie - M.E, B.E, Ph.D, EEE, ECE, EIE Projects
Project titles for  eee, ece, eie - M.E, B.E, Ph.D, EEE, ECE, EIE Projects Project titles for  eee, ece, eie - M.E, B.E, Ph.D, EEE, ECE, EIE Projects
Project titles for eee, ece, eie - M.E, B.E, Ph.D, EEE, ECE, EIE Projects
 
Drgorad sm project
Drgorad sm projectDrgorad sm project
Drgorad sm project
 
Port folio 20121005
Port folio 20121005Port folio 20121005
Port folio 20121005
 
Embedded project list
Embedded project listEmbedded project list
Embedded project list
 

Similar to An introduction to MongoDB and Ruby

BedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBBedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBTobias Trelle
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRailsMike Dirolf
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBMongoDB
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHPichikaway
 
introtomongodb
introtomongodbintrotomongodb
introtomongodbsaikiran
 
Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Tobias Trelle
 
MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling Sachin Bhosale
 
DrupalCon Chicago Practical MongoDB and Drupal
DrupalCon Chicago Practical MongoDB and DrupalDrupalCon Chicago Practical MongoDB and Drupal
DrupalCon Chicago Practical MongoDB and DrupalDoug Green
 
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBBattle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBJesse Wolgamott
 
Code as Data workshop: Using source{d} Engine to extract insights from git re...
Code as Data workshop: Using source{d} Engine to extract insights from git re...Code as Data workshop: Using source{d} Engine to extract insights from git re...
Code as Data workshop: Using source{d} Engine to extract insights from git re...source{d}
 
Introduction to MongoDB with PHP
Introduction to MongoDB with PHPIntroduction to MongoDB with PHP
Introduction to MongoDB with PHPfwso
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDBNorberto Leite
 
Optimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at LocalyticsOptimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at LocalyticsBenjamin Darfler
 
Hosting MongoDB & our experience with database as a service
Hosting MongoDB & our experience with database as a serviceHosting MongoDB & our experience with database as a service
Hosting MongoDB & our experience with database as a serviceGrzegorz Gwoźdź
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBAlex Bilbie
 
Tikal Fuse Day Access Layer Implementation (C#) Based On Mongo Db
Tikal Fuse Day   Access Layer Implementation (C#) Based On Mongo DbTikal Fuse Day   Access Layer Implementation (C#) Based On Mongo Db
Tikal Fuse Day Access Layer Implementation (C#) Based On Mongo DbTikal Knowledge
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBMongoDB
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsMongoDB
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsMongoDB
 

Similar to An introduction to MongoDB and Ruby (20)

BedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBBedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRails
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 
MongoDB
MongoDBMongoDB
MongoDB
 
introtomongodb
introtomongodbintrotomongodb
introtomongodb
 
Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Morphia, Spring Data & Co.
Morphia, Spring Data & Co.
 
MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling
 
DrupalCon Chicago Practical MongoDB and Drupal
DrupalCon Chicago Practical MongoDB and DrupalDrupalCon Chicago Practical MongoDB and Drupal
DrupalCon Chicago Practical MongoDB and Drupal
 
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBBattle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
 
Code as Data workshop: Using source{d} Engine to extract insights from git re...
Code as Data workshop: Using source{d} Engine to extract insights from git re...Code as Data workshop: Using source{d} Engine to extract insights from git re...
Code as Data workshop: Using source{d} Engine to extract insights from git re...
 
Introduction to MongoDB with PHP
Introduction to MongoDB with PHPIntroduction to MongoDB with PHP
Introduction to MongoDB with PHP
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDB
 
Optimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at LocalyticsOptimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at Localytics
 
Hosting MongoDB & our experience with database as a service
Hosting MongoDB & our experience with database as a serviceHosting MongoDB & our experience with database as a service
Hosting MongoDB & our experience with database as a service
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Tikal Fuse Day Access Layer Implementation (C#) Based On Mongo Db
Tikal Fuse Day   Access Layer Implementation (C#) Based On Mongo DbTikal Fuse Day   Access Layer Implementation (C#) Based On Mongo Db
Tikal Fuse Day Access Layer Implementation (C#) Based On Mongo Db
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.js
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.js
 

More from Tobias Trelle

TDD mit JUnit und Mockito
TDD mit JUnit und MockitoTDD mit JUnit und Mockito
TDD mit JUnit und MockitoTobias Trelle
 
NoSQL - Einführung in Graphen-Datenbanken mit Neo4j
NoSQL - Einführung in Graphen-Datenbanken mit Neo4jNoSQL - Einführung in Graphen-Datenbanken mit Neo4j
NoSQL - Einführung in Graphen-Datenbanken mit Neo4jTobias Trelle
 
Einführung in NoSQL-Datenbanken
Einführung in NoSQL-DatenbankenEinführung in NoSQL-Datenbanken
Einführung in NoSQL-DatenbankenTobias Trelle
 
MongoDB - Riesige Datenmengen schemafrei verwalten
MongoDB - Riesige Datenmengen schemafrei verwaltenMongoDB - Riesige Datenmengen schemafrei verwalten
MongoDB - Riesige Datenmengen schemafrei verwaltenTobias Trelle
 
Test Automation for NoSQL Databases
Test Automation for NoSQL DatabasesTest Automation for NoSQL Databases
Test Automation for NoSQL DatabasesTobias Trelle
 
Morphia, Spring Data & Co
Morphia, Spring Data & CoMorphia, Spring Data & Co
Morphia, Spring Data & CoTobias Trelle
 
Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Tobias Trelle
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBTobias Trelle
 
OOP 2013: Praktische Einführung in MongoDB
OOP 2013: Praktische Einführung in MongoDBOOP 2013: Praktische Einführung in MongoDB
OOP 2013: Praktische Einführung in MongoDBTobias Trelle
 
MongoDB Munich 2012: Spring Data MongoDB
MongoDB Munich 2012: Spring Data MongoDBMongoDB Munich 2012: Spring Data MongoDB
MongoDB Munich 2012: Spring Data MongoDBTobias Trelle
 
MongoDB Live Hacking
MongoDB Live HackingMongoDB Live Hacking
MongoDB Live HackingTobias Trelle
 

More from Tobias Trelle (12)

TDD mit JUnit und Mockito
TDD mit JUnit und MockitoTDD mit JUnit und Mockito
TDD mit JUnit und Mockito
 
NoSQL - Einführung in Graphen-Datenbanken mit Neo4j
NoSQL - Einführung in Graphen-Datenbanken mit Neo4jNoSQL - Einführung in Graphen-Datenbanken mit Neo4j
NoSQL - Einführung in Graphen-Datenbanken mit Neo4j
 
Einführung in NoSQL-Datenbanken
Einführung in NoSQL-DatenbankenEinführung in NoSQL-Datenbanken
Einführung in NoSQL-Datenbanken
 
MongoDB Einführung
MongoDB EinführungMongoDB Einführung
MongoDB Einführung
 
MongoDB - Riesige Datenmengen schemafrei verwalten
MongoDB - Riesige Datenmengen schemafrei verwaltenMongoDB - Riesige Datenmengen schemafrei verwalten
MongoDB - Riesige Datenmengen schemafrei verwalten
 
Test Automation for NoSQL Databases
Test Automation for NoSQL DatabasesTest Automation for NoSQL Databases
Test Automation for NoSQL Databases
 
Morphia, Spring Data & Co
Morphia, Spring Data & CoMorphia, Spring Data & Co
Morphia, Spring Data & Co
 
Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
OOP 2013: Praktische Einführung in MongoDB
OOP 2013: Praktische Einführung in MongoDBOOP 2013: Praktische Einführung in MongoDB
OOP 2013: Praktische Einführung in MongoDB
 
MongoDB Munich 2012: Spring Data MongoDB
MongoDB Munich 2012: Spring Data MongoDBMongoDB Munich 2012: Spring Data MongoDB
MongoDB Munich 2012: Spring Data MongoDB
 
MongoDB Live Hacking
MongoDB Live HackingMongoDB Live Hacking
MongoDB Live Hacking
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

An introduction to MongoDB and Ruby

  • 1. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 1 MongoDB & Ruby in 10 Minutes Tobias.Trelle@codecentric.de @tobiastrelle
  • 2. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 2 Tobias Trelle - Senior IT Consultant @ codecentric AG (Düsseldorf) - Organizer of MongoDB User Group Düsseldorf - Authoring a MongoDB book (dpunkt-Verlag)
  • 3. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 3 MongoDB NoSQL data store / Open Source Single records are called documents Replication & Sharding out-of-the-box Map/Reduce Geospatial Indexes / Queries
  • 4. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 4 MongoDB Overview Server Database Collection Document Field Tabelle Zeile Spalte Relationales Pendant Aber … Flexibles Schema - Arrays - Rekursiv
  • 5. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 5 Documents Ordered set of key/values pairs Values can be an array, document or simple type Max size = 16 MB Logical namespaces for documents are called collections Schemaless Format: BSON = Binary JSON != JSON
  • 6. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 6 Documents {} { hello: "MongoDB" } { foo: { bar: "baz"}, a: [1,2,3,5,8] }
  • 7. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 7 MongoDB Gems $ gem install mongo Fetching: bson-1.9.0.gem (100%) Fetching: mongo-1.9.0.gem (100%) Successfully installed bson-1.9.0 Successfully installed mongo-1.9.0 2 gems installed ...
  • 8. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 8 MongoDB Gems $ gem install bson_ext Fetching: bson_ext-1.9.0.gem (100%) Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... Successfully installed bson_ext-1.9.0 1 gem installed...
  • 9. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 9 Ruby Driver API
  • 10. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 10 Ruby Driver irb(main):001:0> require 'mongo' => true irb(main):002:0> include Mongo => Object irb(main):003:0> client = MongoClient.new ... irb(main):004:0> db = client["test"] ... irb(main):005:0> coll = db["foo"]
  • 11. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 11 Ruby Driver irb(main):006:0> coll.remove => {"n"=>3, "connectionId"=>2, "err"=>nil, "ok"=>1.0} irb(main):007:0> coll.insert :hello => "MongoDB" => BSON::ObjectId('51d1100ec9f0b10b78000001') irb(main):008:0> doc = coll.find_one => {"_id"=>BSON::ObjectId('51d1100ec9f0b10b78000001'), "hello"=>"MongoDB"}
  • 12. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 12 Ruby Driver irb(main):013:0> coll.insert :a => 1, b: [1,2,3,4,5] => BSON::ObjectId('51d1108ac9f0b10b78000002') irb(main):014:0> crsr = coll.find => <Mongo::Cursor:0x158e2a8 namespace='test.foo' @selector={} @cursor_id=> irb(main):016:0> crsr.each{ |doc| puts doc } {"_id"=>BSON::ObjectId('51d1100ec9f0b10b78000001'), "hello"=>"MongoDB"} {"_id"=>BSON::ObjectId('51d1108ac9f0b10b78000002'), "a"=>1, "b"=>[1, 2, 3, 4, 5]}
  • 13. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 13 Persistence Frameworks Mongoid http://mongoid.org/ MongoMapper http://mongomapper.com/
  • 14. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 14 MongoDB User Group Düsseldorf https://www.xing.com/net/mongodb-dus @MongoDUS Meetup #7: Schema Design w/ MongoDB 18.07.2013 19:00 https://www.xing.com/events/7-treffen-schema- design-mongodb-1268228 MUG Düsseldorf
  • 15. codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 15 QUESTIONS? Tobias Trelle codecentric AG Merscheider Str. 1 42699 Solingen tel +49 (0) 212.233628.47 fax +49 (0) 212.233628.79 mail Tobias.Trelle@codecentric.de twitter @tobiastrelle www.codecentric.de blog.codecentric.de/en/author/tobias-trelle www.xing.com/net/mongodb-dus