SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
nonSQL databases
     alexey gaziev
RDBMS


• Great for many apps
• Shortcomings
  • Scalability
  • Flexibility
Other DBMS

• Flat file
• Hierarchical
• Network
• Document-oriented
• Object-oriented
CAP Theorem

                                          Pick two

С             A                        • Consistency
                                       • Availability
    P                                  • Tolerance to network
                                          Partitions


    http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf
ACID & BASE

• Atomicity     • Basically Available
• Consistency   • Soft state
• Isolation     • Eventually consistent
• Durability
ACID vs. BASE
    ACID                      BASE
•   Strong consistency    •   Weak consistency

•   Isolation             •   Availability first

•   Focus on “commit”     •   Best effort

•   Nested transactions   •   Approximate answers

•   Availability?         •   Agressive (optimistic)

•   Conservative          •   Simpler!

•   Difficult evolution     •   Faster
    (schema)
                          •   Easier evolution
Scalability &                Intro
Performance
                memcached

                   Key/Values store




                                                RDBMS




                                      Depth of Functionality
Features
• Collection oriented storage: easy storage of object/
  JSON -style data
• Dynamic queries
• Full index support, including on inner objects and
  embedded arrays
• Query profiling
• Replication and fail-over support
• Efficient storage of binary data including large objects
  (e.g. photos and videos)
• Auto-sharding for cloud-level scalability (currently in
  alpha)
• Commercial support available
Great for

• Websites
• Caching
• High volume, low value
• High scalability
• Storage of program objects and json
Not as great for


• Highly transactional
• Ad-hoc business intelligence
• Problems requiring SQL
Installation
Collection

• Think table, but with no schema
• For grouping into smaller query sets (speed)
• Each top entity in your app would have its own
 collection (users, articles, etc.)

• Full index support
Document


• Stored in collection, think record or row
• Can have _id key that works like primary key in
 MySQL

• Two options for relationships: subdocument or
 db reference
Storage (BSON)

{ author: 'joe',
  created: Date('03-28-2009'),
  title: 'Yet another blog post',
  text: 'Here is the text...',
  tags: [ 'example', 'joe' ],
  comments: [ { author: 'jim', comment: 'I disagree' },
           { author: 'nancy', comment: 'Good post' }
  ]
}
Basics
$ bin/mongod &
$ bin/mongo
...
> use mydb
> j = { name: "mongo"};
{"name" : "mongo"}
> t = { x : 3 };
{ "x" : 3 }
> db.things.save(j);
> db.things.save(t);
> db.things.find();
in cursor for : DBQuery: example.things ->
{"name" : "mongo" , "_id" : "497cf60751712cf7758+dbb"}
{"x" : 3 , "_id" : "497cf61651712cf7758+dbc"}
>
Querying

•   db.collection.find({‘first_name’: ‘John’}) # finds all Johns

•   db.collection.find({‘first_name’: /^J/}) # regex

•   db.collection.find_first({‘_id’:1}) # finds first with _id of 1

•   db.collection.find({‘age’: {‘$gt’: 21}}) # finds possible drinkers

•   db.collection.find({‘author.first_name’:‘John’}) # subdocument

•   db.collection.find({$where:‘this.age >= 6 && this.age <= 18’})
Querying 2

•   $in, $nin, $all, $ne, $gt, $gte, $lt, $lte, $size, $where

•   :fields (like :select in active record)

•   :limit, :offset for pagination

•   :sort ascending or descending [[‘foo’, 1], [‘bar’, -1]]

•   count and group (uses map/reduce)
Dynamic querying
Ruby support

• mongo-ruby-driver
  • Pure Ruby, with optional C extension
• MongoRecord
  • ORM like functionality
• Other mappers
Ruby basics
• Connect:
  • db = Mongo.new.db(‘my-database’)
  • coll = db.collection(‘players’)
• Insert:
  • coll.insert (“name” => “mike”, “age” => ...
• Query:
  • coll.find (“age” => 35)
Grid FS


• File storage in MongoDB

• IO-like API for Ruby
Other cool stuff



• Capped collections
• Upserts
• Multikeys
Resources
• http://spitfiresky.com/blog/recap-of-my-sdruby-
 presentation-on-mongodb.html

• http://railstips.org/2009/6/3/what-if-a-key-
 value-store-mated-with-a-relational-database-
 system

• http://www.mongodb.org/display/DOCS/
 Production+Deployments

• http://www.mongohq.com/home
Resources 2


• http://api.mongodb.org/ruby/0.15.1/index.html
• http://www.engineyard.com/blog/2009/
 mongodb-a-light-in-the-darkness-key-value-
 stores-part-5

• http://queue.acm.org/detail.cfm?id=1394128
thanks!

Contenu connexe

Tendances

Optimize drupal using mongo db
Optimize drupal using mongo dbOptimize drupal using mongo db
Optimize drupal using mongo dbVladimir Ilic
 
캐시 분산처리 인프라
캐시 분산처리 인프라캐시 분산처리 인프라
캐시 분산처리 인프라Park Chunduck
 
COSCUP 2019 - The discussion between Knex.js and PostgreSQL
COSCUP 2019 - The discussion between Knex.js and PostgreSQLCOSCUP 2019 - The discussion between Knex.js and PostgreSQL
COSCUP 2019 - The discussion between Knex.js and PostgreSQLLen Chang
 
MongoDB Memory Management Demystified
MongoDB Memory Management DemystifiedMongoDB Memory Management Demystified
MongoDB Memory Management DemystifiedMongoDB
 
When Will Drupal Die? (Keynote talk)
When Will Drupal Die? (Keynote talk)When Will Drupal Die? (Keynote talk)
When Will Drupal Die? (Keynote talk)chrisshattuck
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadKrivoy Rog IT Community
 
Discover MongoDB - Israel
Discover MongoDB - IsraelDiscover MongoDB - Israel
Discover MongoDB - IsraelMichael Fiedler
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend PerformanceThomas Weinert
 
Website performance optimization QA
Website performance optimization QAWebsite performance optimization QA
Website performance optimization QADenis Dudaev
 
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...MongoDB
 
2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_newMongoDB
 
Web Optimization Level: Paranoid
Web Optimization Level: ParanoidWeb Optimization Level: Paranoid
Web Optimization Level: Paranoidrobin_sy
 
MongoDB Basic Concepts
MongoDB Basic ConceptsMongoDB Basic Concepts
MongoDB Basic ConceptsMongoDB
 
Migrating from RDBMS to MongoDB
Migrating from RDBMS to MongoDBMigrating from RDBMS to MongoDB
Migrating from RDBMS to MongoDBMongoDB
 
MongoFr : MongoDB as a log Collector
MongoFr : MongoDB as a log CollectorMongoFr : MongoDB as a log Collector
MongoFr : MongoDB as a log CollectorPierre Baillet
 

Tendances (20)

Optimize drupal using mongo db
Optimize drupal using mongo dbOptimize drupal using mongo db
Optimize drupal using mongo db
 
캐시 분산처리 인프라
캐시 분산처리 인프라캐시 분산처리 인프라
캐시 분산처리 인프라
 
COSCUP 2019 - The discussion between Knex.js and PostgreSQL
COSCUP 2019 - The discussion between Knex.js and PostgreSQLCOSCUP 2019 - The discussion between Knex.js and PostgreSQL
COSCUP 2019 - The discussion between Knex.js and PostgreSQL
 
MongoDB Memory Management Demystified
MongoDB Memory Management DemystifiedMongoDB Memory Management Demystified
MongoDB Memory Management Demystified
 
When Will Drupal Die? (Keynote talk)
When Will Drupal Die? (Keynote talk)When Will Drupal Die? (Keynote talk)
When Will Drupal Die? (Keynote talk)
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
Mongodb
MongodbMongodb
Mongodb
 
Discover MongoDB - Israel
Discover MongoDB - IsraelDiscover MongoDB - Israel
Discover MongoDB - Israel
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend Performance
 
Website performance optimization QA
Website performance optimization QAWebsite performance optimization QA
Website performance optimization QA
 
CouchDB
CouchDBCouchDB
CouchDB
 
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...
 
2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new
 
Web Optimization Level: Paranoid
Web Optimization Level: ParanoidWeb Optimization Level: Paranoid
Web Optimization Level: Paranoid
 
A faster web
A faster webA faster web
A faster web
 
MongoDB Basic Concepts
MongoDB Basic ConceptsMongoDB Basic Concepts
MongoDB Basic Concepts
 
Fluent 2012 v2
Fluent 2012   v2Fluent 2012   v2
Fluent 2012 v2
 
Connection
ConnectionConnection
Connection
 
Migrating from RDBMS to MongoDB
Migrating from RDBMS to MongoDBMigrating from RDBMS to MongoDB
Migrating from RDBMS to MongoDB
 
MongoFr : MongoDB as a log Collector
MongoFr : MongoDB as a log CollectorMongoFr : MongoDB as a log Collector
MongoFr : MongoDB as a log Collector
 

En vedette

Tarea1 cristina ruiz_gascon
Tarea1 cristina ruiz_gasconTarea1 cristina ruiz_gascon
Tarea1 cristina ruiz_gasconcrisalba77
 
Smalltalk в распределённых системах реального времени
Smalltalk в распределённых системах реального времениSmalltalk в распределённых системах реального времени
Smalltalk в распределённых системах реального времениФПС СПбГПУ
 
Smalltalk: первое знакомство
Smalltalk: первое знакомствоSmalltalk: первое знакомство
Smalltalk: первое знакомствоФПС СПбГПУ
 
Smalltalk в распределенных бизнес-приложениях
Smalltalk в распределенных бизнес-приложенияхSmalltalk в распределенных бизнес-приложениях
Smalltalk в распределенных бизнес-приложенияхФПС СПбГПУ
 

En vedette (7)

КИТ ДОД 2013
КИТ ДОД 2013КИТ ДОД 2013
КИТ ДОД 2013
 
Tarea1 cristina ruiz_gascon
Tarea1 cristina ruiz_gasconTarea1 cristina ruiz_gascon
Tarea1 cristina ruiz_gascon
 
Smalltalk в распределённых системах реального времени
Smalltalk в распределённых системах реального времениSmalltalk в распределённых системах реального времени
Smalltalk в распределённых системах реального времени
 
Tokyo Cabinet
Tokyo CabinetTokyo Cabinet
Tokyo Cabinet
 
Smalltalk: первое знакомство
Smalltalk: первое знакомствоSmalltalk: первое знакомство
Smalltalk: первое знакомство
 
Smalltalk в распределенных бизнес-приложениях
Smalltalk в распределенных бизнес-приложенияхSmalltalk в распределенных бизнес-приложениях
Smalltalk в распределенных бизнес-приложениях
 
КИТ 2013
КИТ 2013КИТ 2013
КИТ 2013
 

Similaire à MongoDB

Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLRichard Schneeman
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBSean Laurent
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataRoger Xia
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQLYan Cui
 
Oracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data ArchitectureOracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data ArchitectureArthur Gimpel
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Chris Richardson
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsHabilelabs
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxRahul Borate
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxRahul Borate
 
MongoDB London PHP
MongoDB London PHPMongoDB London PHP
MongoDB London PHPMike Dirolf
 
No SQL : Which way to go? Presented at DDDMelbourne 2015
No SQL : Which way to go?  Presented at DDDMelbourne 2015No SQL : Which way to go?  Presented at DDDMelbourne 2015
No SQL : Which way to go? Presented at DDDMelbourne 2015Himanshu Desai
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Javasunnygleason
 
SDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and modelsSDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and modelsKorea Sdec
 

Similaire à MongoDB (20)

Drop acid
Drop acidDrop acid
Drop acid
 
MongoDB
MongoDBMongoDB
MongoDB
 
Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQL
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
Oracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data ArchitectureOracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data Architecture
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
MongoDB SF Ruby
MongoDB SF RubyMongoDB SF Ruby
MongoDB SF Ruby
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptx
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptx
 
MongoDB London PHP
MongoDB London PHPMongoDB London PHP
MongoDB London PHP
 
No sql Database
No sql DatabaseNo sql Database
No sql Database
 
KeyValue Stores
KeyValue StoresKeyValue Stores
KeyValue Stores
 
No SQL : Which way to go? Presented at DDDMelbourne 2015
No SQL : Which way to go?  Presented at DDDMelbourne 2015No SQL : Which way to go?  Presented at DDDMelbourne 2015
No SQL : Which way to go? Presented at DDDMelbourne 2015
 
NoSQL, which way to go?
NoSQL, which way to go?NoSQL, which way to go?
NoSQL, which way to go?
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
 
SDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and modelsSDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and models
 

Plus de ФПС СПбГПУ

День откртых дверей ФПС СПбГПУ 2009
День откртых дверей ФПС СПбГПУ 2009День откртых дверей ФПС СПбГПУ 2009
День откртых дверей ФПС СПбГПУ 2009ФПС СПбГПУ
 
Обзор программ обучения в области СХД
Обзор программ обучения в области СХДОбзор программ обучения в области СХД
Обзор программ обучения в области СХДФПС СПбГПУ
 
Семинар «Windows Server 2003 R2»
Семинар «Windows Server 2003 R2»Семинар «Windows Server 2003 R2»
Семинар «Windows Server 2003 R2»ФПС СПбГПУ
 

Plus de ФПС СПбГПУ (6)

КИТ-2010
КИТ-2010КИТ-2010
КИТ-2010
 
День откртых дверей ФПС СПбГПУ 2009
День откртых дверей ФПС СПбГПУ 2009День откртых дверей ФПС СПбГПУ 2009
День откртых дверей ФПС СПбГПУ 2009
 
КИТ2009
КИТ2009КИТ2009
КИТ2009
 
Обзор программ обучения в области СХД
Обзор программ обучения в области СХДОбзор программ обучения в области СХД
Обзор программ обучения в области СХД
 
Windows Server 2003 Seminar
Windows Server  2003 SeminarWindows Server  2003 Seminar
Windows Server 2003 Seminar
 
Семинар «Windows Server 2003 R2»
Семинар «Windows Server 2003 R2»Семинар «Windows Server 2003 R2»
Семинар «Windows Server 2003 R2»
 

Dernier

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

MongoDB

  • 1. nonSQL databases alexey gaziev
  • 2. RDBMS • Great for many apps • Shortcomings • Scalability • Flexibility
  • 3. Other DBMS • Flat file • Hierarchical • Network • Document-oriented • Object-oriented
  • 4. CAP Theorem Pick two С A • Consistency • Availability P • Tolerance to network Partitions http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf
  • 5. ACID & BASE • Atomicity • Basically Available • Consistency • Soft state • Isolation • Eventually consistent • Durability
  • 6. ACID vs. BASE ACID BASE • Strong consistency • Weak consistency • Isolation • Availability first • Focus on “commit” • Best effort • Nested transactions • Approximate answers • Availability? • Agressive (optimistic) • Conservative • Simpler! • Difficult evolution • Faster (schema) • Easier evolution
  • 7.
  • 8. Scalability & Intro Performance memcached Key/Values store RDBMS Depth of Functionality
  • 9. Features • Collection oriented storage: easy storage of object/ JSON -style data • Dynamic queries • Full index support, including on inner objects and embedded arrays • Query profiling • Replication and fail-over support • Efficient storage of binary data including large objects (e.g. photos and videos) • Auto-sharding for cloud-level scalability (currently in alpha) • Commercial support available
  • 10. Great for • Websites • Caching • High volume, low value • High scalability • Storage of program objects and json
  • 11. Not as great for • Highly transactional • Ad-hoc business intelligence • Problems requiring SQL
  • 13. Collection • Think table, but with no schema • For grouping into smaller query sets (speed) • Each top entity in your app would have its own collection (users, articles, etc.) • Full index support
  • 14. Document • Stored in collection, think record or row • Can have _id key that works like primary key in MySQL • Two options for relationships: subdocument or db reference
  • 15. Storage (BSON) { author: 'joe', created: Date('03-28-2009'), title: 'Yet another blog post', text: 'Here is the text...', tags: [ 'example', 'joe' ], comments: [ { author: 'jim', comment: 'I disagree' }, { author: 'nancy', comment: 'Good post' } ] }
  • 16. Basics $ bin/mongod & $ bin/mongo ... > use mydb > j = { name: "mongo"}; {"name" : "mongo"} > t = { x : 3 }; { "x" : 3 } > db.things.save(j); > db.things.save(t); > db.things.find(); in cursor for : DBQuery: example.things -> {"name" : "mongo" , "_id" : "497cf60751712cf7758+dbb"} {"x" : 3 , "_id" : "497cf61651712cf7758+dbc"} >
  • 17. Querying • db.collection.find({‘first_name’: ‘John’}) # finds all Johns • db.collection.find({‘first_name’: /^J/}) # regex • db.collection.find_first({‘_id’:1}) # finds first with _id of 1 • db.collection.find({‘age’: {‘$gt’: 21}}) # finds possible drinkers • db.collection.find({‘author.first_name’:‘John’}) # subdocument • db.collection.find({$where:‘this.age >= 6 && this.age <= 18’})
  • 18. Querying 2 • $in, $nin, $all, $ne, $gt, $gte, $lt, $lte, $size, $where • :fields (like :select in active record) • :limit, :offset for pagination • :sort ascending or descending [[‘foo’, 1], [‘bar’, -1]] • count and group (uses map/reduce)
  • 20. Ruby support • mongo-ruby-driver • Pure Ruby, with optional C extension • MongoRecord • ORM like functionality • Other mappers
  • 21. Ruby basics • Connect: • db = Mongo.new.db(‘my-database’) • coll = db.collection(‘players’) • Insert: • coll.insert (“name” => “mike”, “age” => ... • Query: • coll.find (“age” => 35)
  • 22. Grid FS • File storage in MongoDB • IO-like API for Ruby
  • 23. Other cool stuff • Capped collections • Upserts • Multikeys
  • 24. Resources • http://spitfiresky.com/blog/recap-of-my-sdruby- presentation-on-mongodb.html • http://railstips.org/2009/6/3/what-if-a-key- value-store-mated-with-a-relational-database- system • http://www.mongodb.org/display/DOCS/ Production+Deployments • http://www.mongohq.com/home
  • 25. Resources 2 • http://api.mongodb.org/ruby/0.15.1/index.html • http://www.engineyard.com/blog/2009/ mongodb-a-light-in-the-darkness-key-value- stores-part-5 • http://queue.acm.org/detail.cfm?id=1394128