SlideShare una empresa de Scribd logo
1 de 27
Descargar para leer sin conexión
Superficial MongoDB


            charsyam@naver.com
MongoDB
           NoSQL
Document
           BSON
Document-Oriented Storage
Full Index Support
Replication & High Availability
Auto Sharding
Querying
Fast In-Place Updates
Map/Reduce
GridFS
Document-Oriented Storage
Full Index Support
Replication & High Availability
Auto Sharding
Querying
Fast In-Place Updates
Map/Reduce
GridFS
Document-Oriented
 > db.users.insert( { _id : "alex", name: { first:"Alex", last:"Benisson" }, karma : 1.0 } )


> db.posts.findOne() {
   _id : ObjectId("4e77bb3b8a3e000000004f7a"),
   when : Date("2011-09-19T02:10:11.3Z",
   author : "alex",
   title : "No Free Lunch",
   text : "This is the text of the post. It could be very long.",
   tags : [ "business", "ramblings" ],
   votes : 5,
   voters : [ "jane", "joe", "spencer", "phyllis", "li" ],
   comments : [
       { who : "jane", when : Date("2011-09-19T04:00:10.112Z"),
         comment : "I agree." },
       { who : "meghan", when : Date("2011-09-20T14:36:06.958Z"),
         comment : "You must be joking. etc etc ..." } ] }
Full-Index Support
> db.things.ensureIndex({j:1});

> db.things.ensureIndex({"address.city": 1})

> db.things.ensureIndex({j:1, name:-1});

> db.factories.insert( { name: "xyz", metro: { city: "New York", state: "NY" } } );
> db.factories.ensureIndex( { metro : 1 } ); // this query can use the above index: >
> db.factories.find( { metro: { city: "New York", state: "NY" } } );
// this one too, as {city:"New York"} < {city:"New York",state:"NY"}
> db.factories.find( { metro: { $gte : { city: "New York" } } } );
// this query does not match the document because the order of fields is significant
> db.factories.find( { metro: { state: "NY" , city: "New York" } } );
Replication
   Asynchronous Replication
HA & FailOver
Only Write to Primary
Can read from Secondary
Op Ordinal:
Increasing ordinal to represent each operation

Using Server ID + Op Ordinal
Picking Primary
1. Get Max LocalOpOrdinal from each Server
2. if a majority of servers are not up (from
this server's POV), remain in Secondary
mode and stop.
3. if the last op time seems very old, stop
and await human intervention.
4. else, using a consensus protocol, pick the
server with the highest maxLocalOpOrdinal
as the Primary.
TIPs.
Use 64bit Machine
MongoDB Use Memory-Mapped File
In 32bit. DB Size can’t over 2.5GB
MongoDB is needed Big Memory
Use Replica Set
Use Replica Set and Journaling
Use Lastest Version
2.0.2 is better than 1.8.x
MongoDB has global Lock
1.8.x uses global Write Lock
2.0.x uses write with yield.
Not supports db or collection lock
Use Big Memory
Disk Op is slower than
                         Memory Op
Shard
Shard Architecture
Basic
Data is split up into Chunks
Chunk: 64mb or 100,000 objects
    Replication unit is chunk.
     Chunk Count > 9
Mongod
Data Store
      Replica Set(3 mongod)
Mongos
Proxy
  StateLess
      Routing to Shard
Mongod configSvr
mongod
Can’t use Replica Set or M/A
1(test) or 3(real)
Mongod configSvr
Changes are made with 2PC
If any are down, meta data
goes read only
System is online as long as 1/3
is up
Use Scale Up than Sharding

Difficult to find good Shard Key.
Not Support Data Center
awareness
Add memory and hdd, ssd
Object Id_
Object Id_
12 bytes
Replica Set
Operations

Default: Write/read operation
goes to master
Can read from slaves.
Thank you!

Más contenido relacionado

La actualidad más candente

MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & IntroductionJerwin Roy
 
Automated Slow Query Analysis: Dex the Index Robot
Automated Slow Query Analysis: Dex the Index RobotAutomated Slow Query Analysis: Dex the Index Robot
Automated Slow Query Analysis: Dex the Index RobotMongoDB
 
Social Analytics with MongoDB
Social Analytics with MongoDBSocial Analytics with MongoDB
Social Analytics with MongoDBPatrick Stokes
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationBack to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationMongoDB
 
mongoDB Performance
mongoDB PerformancemongoDB Performance
mongoDB PerformanceMoshe Kaplan
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for BeginnersEnoch Joshua
 
Back to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQLBack to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQLMongoDB
 
Introduction to CouchDB - LA Hacker News
Introduction to CouchDB - LA Hacker NewsIntroduction to CouchDB - LA Hacker News
Introduction to CouchDB - LA Hacker NewsMichael Parker
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive GuideWildan Maulana
 
Mongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMetatagg Solutions
 
PhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHPPhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHPichikaway
 
Mongo db – document oriented database
Mongo db – document oriented databaseMongo db – document oriented database
Mongo db – document oriented databaseWojciech Sznapka
 

La actualidad más candente (20)

MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & Introduction
 
Automated Slow Query Analysis: Dex the Index Robot
Automated Slow Query Analysis: Dex the Index RobotAutomated Slow Query Analysis: Dex the Index Robot
Automated Slow Query Analysis: Dex the Index Robot
 
Social Analytics with MongoDB
Social Analytics with MongoDBSocial Analytics with MongoDB
Social Analytics with MongoDB
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationBack to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB Application
 
mongoDB Performance
mongoDB PerformancemongoDB Performance
mongoDB Performance
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
 
Back to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQLBack to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQL
 
Indexing In MongoDB
Indexing In MongoDBIndexing In MongoDB
Indexing In MongoDB
 
Introduction to CouchDB - LA Hacker News
Introduction to CouchDB - LA Hacker NewsIntroduction to CouchDB - LA Hacker News
Introduction to CouchDB - LA Hacker News
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive Guide
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
Mongo db
Mongo dbMongo db
Mongo db
 
Mongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg Solutions
 
PhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHPPhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHP
 
Mongo db – document oriented database
Mongo db – document oriented databaseMongo db – document oriented database
Mongo db – document oriented database
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 

Destacado

Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...
Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...
Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...Сергей Иванов
 
اللمبات الموفره نوبل الفيزياء 2014
اللمبات الموفره نوبل الفيزياء 2014اللمبات الموفره نوبل الفيزياء 2014
اللمبات الموفره نوبل الفيزياء 2014Mohamed Alashram
 
Tips Hasilkan Uang Melalui Affiliate Marketing Bagi Generasi Millenials
Tips Hasilkan Uang Melalui Affiliate Marketing Bagi Generasi MillenialsTips Hasilkan Uang Melalui Affiliate Marketing Bagi Generasi Millenials
Tips Hasilkan Uang Melalui Affiliate Marketing Bagi Generasi MillenialsAbdurrahman Karim Zaidan
 
Osservatorio Socio Digitale Major Appliances 2015
Osservatorio Socio Digitale Major Appliances 2015Osservatorio Socio Digitale Major Appliances 2015
Osservatorio Socio Digitale Major Appliances 2015TEIA
 
Studiekeuzeconferentie 2016: Decentrale selectie - de toegankelijkheid waarbo...
Studiekeuzeconferentie 2016: Decentrale selectie - de toegankelijkheid waarbo...Studiekeuzeconferentie 2016: Decentrale selectie - de toegankelijkheid waarbo...
Studiekeuzeconferentie 2016: Decentrale selectie - de toegankelijkheid waarbo...Studiekeuzeconferentie
 
Научная коммуникация в цифровую эпоху
Научная коммуникация в цифровую эпохуНаучная коммуникация в цифровую эпоху
Научная коммуникация в цифровую эпохуAlexandra Gorbenko
 
Verden trenger mer sjømat - langsiktig megatrend - Holberg Fondene
Verden trenger mer sjømat - langsiktig megatrend - Holberg FondeneVerden trenger mer sjømat - langsiktig megatrend - Holberg Fondene
Verden trenger mer sjømat - langsiktig megatrend - Holberg FondeneNordnet Norge
 
Karbala Ki Yadgar Pyaas - Syedul Ulema Syed Ali Naqi Naqvi Sahab t.s.
Karbala Ki Yadgar Pyaas - Syedul Ulema Syed Ali Naqi Naqvi Sahab t.s.Karbala Ki Yadgar Pyaas - Syedul Ulema Syed Ali Naqi Naqvi Sahab t.s.
Karbala Ki Yadgar Pyaas - Syedul Ulema Syed Ali Naqi Naqvi Sahab t.s.Jamal Mirza
 
Митна вартість. Як оформити товар за справедливою вартістю?
Митна вартість. Як оформити товар за справедливою вартістю?Митна вартість. Як оформити товар за справедливою вартістю?
Митна вартість. Як оформити товар за справедливою вартістю?Святослав Бартош
 
3D printing Impresa&Imprese InnovationRunner Simone Azzellini
3D printing Impresa&Imprese InnovationRunner Simone Azzellini3D printing Impresa&Imprese InnovationRunner Simone Azzellini
3D printing Impresa&Imprese InnovationRunner Simone AzzelliniSimone Azzellini
 
Reportazh per parkun kombetar te Qafe Shtamaes
Reportazh per parkun kombetar te Qafe Shtamaes Reportazh per parkun kombetar te Qafe Shtamaes
Reportazh per parkun kombetar te Qafe Shtamaes Fatjon Cane
 
Oppervlaktetechnieken november 2016
Oppervlaktetechnieken november 2016Oppervlaktetechnieken november 2016
Oppervlaktetechnieken november 2016TUVRheinlandNL
 
Building innovative organization
Building innovative organizationBuilding innovative organization
Building innovative organizationSophia Opatska
 
Syllabus leertraject koninkrijkszaken
Syllabus leertraject koninkrijkszakenSyllabus leertraject koninkrijkszaken
Syllabus leertraject koninkrijkszakenSibrenne Wagenaar
 
괴델(Godel)의 불완전성 정리 증명의 이해.
괴델(Godel)의 불완전성 정리 증명의 이해.괴델(Godel)의 불완전성 정리 증명의 이해.
괴델(Godel)의 불완전성 정리 증명의 이해.Jinseob Kim
 
مذكرة The future للصف الثالث الابتدائى الترم الثانى
مذكرة The future للصف الثالث الابتدائى الترم الثانىمذكرة The future للصف الثالث الابتدائى الترم الثانى
مذكرة The future للصف الثالث الابتدائى الترم الثانىSalah Abdelsalam
 

Destacado (19)

Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...
Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...
Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...
 
اللمبات الموفره نوبل الفيزياء 2014
اللمبات الموفره نوبل الفيزياء 2014اللمبات الموفره نوبل الفيزياء 2014
اللمبات الموفره نوبل الفيزياء 2014
 
Tips Hasilkan Uang Melalui Affiliate Marketing Bagi Generasi Millenials
Tips Hasilkan Uang Melalui Affiliate Marketing Bagi Generasi MillenialsTips Hasilkan Uang Melalui Affiliate Marketing Bagi Generasi Millenials
Tips Hasilkan Uang Melalui Affiliate Marketing Bagi Generasi Millenials
 
кружок!!!
кружок!!!кружок!!!
кружок!!!
 
Osservatorio Socio Digitale Major Appliances 2015
Osservatorio Socio Digitale Major Appliances 2015Osservatorio Socio Digitale Major Appliances 2015
Osservatorio Socio Digitale Major Appliances 2015
 
Studiekeuzeconferentie 2016: Decentrale selectie - de toegankelijkheid waarbo...
Studiekeuzeconferentie 2016: Decentrale selectie - de toegankelijkheid waarbo...Studiekeuzeconferentie 2016: Decentrale selectie - de toegankelijkheid waarbo...
Studiekeuzeconferentie 2016: Decentrale selectie - de toegankelijkheid waarbo...
 
Научная коммуникация в цифровую эпоху
Научная коммуникация в цифровую эпохуНаучная коммуникация в цифровую эпоху
Научная коммуникация в цифровую эпоху
 
Verden trenger mer sjømat - langsiktig megatrend - Holberg Fondene
Verden trenger mer sjømat - langsiktig megatrend - Holberg FondeneVerden trenger mer sjømat - langsiktig megatrend - Holberg Fondene
Verden trenger mer sjømat - langsiktig megatrend - Holberg Fondene
 
Karbala Ki Yadgar Pyaas - Syedul Ulema Syed Ali Naqi Naqvi Sahab t.s.
Karbala Ki Yadgar Pyaas - Syedul Ulema Syed Ali Naqi Naqvi Sahab t.s.Karbala Ki Yadgar Pyaas - Syedul Ulema Syed Ali Naqi Naqvi Sahab t.s.
Karbala Ki Yadgar Pyaas - Syedul Ulema Syed Ali Naqi Naqvi Sahab t.s.
 
Митна вартість. Як оформити товар за справедливою вартістю?
Митна вартість. Як оформити товар за справедливою вартістю?Митна вартість. Як оформити товар за справедливою вартістю?
Митна вартість. Як оформити товар за справедливою вартістю?
 
3D printing Impresa&Imprese InnovationRunner Simone Azzellini
3D printing Impresa&Imprese InnovationRunner Simone Azzellini3D printing Impresa&Imprese InnovationRunner Simone Azzellini
3D printing Impresa&Imprese InnovationRunner Simone Azzellini
 
Reportazh per parkun kombetar te Qafe Shtamaes
Reportazh per parkun kombetar te Qafe Shtamaes Reportazh per parkun kombetar te Qafe Shtamaes
Reportazh per parkun kombetar te Qafe Shtamaes
 
Oppervlaktetechnieken november 2016
Oppervlaktetechnieken november 2016Oppervlaktetechnieken november 2016
Oppervlaktetechnieken november 2016
 
Building innovative organization
Building innovative organizationBuilding innovative organization
Building innovative organization
 
Syllabus leertraject koninkrijkszaken
Syllabus leertraject koninkrijkszakenSyllabus leertraject koninkrijkszaken
Syllabus leertraject koninkrijkszaken
 
Big Data y Salud. Un enfoque orientado a resultados
Big Data y Salud. Un enfoque orientado a resultadosBig Data y Salud. Un enfoque orientado a resultados
Big Data y Salud. Un enfoque orientado a resultados
 
괴델(Godel)의 불완전성 정리 증명의 이해.
괴델(Godel)의 불완전성 정리 증명의 이해.괴델(Godel)의 불완전성 정리 증명의 이해.
괴델(Godel)의 불완전성 정리 증명의 이해.
 
O frio pode ser quente?
O frio pode ser quente?O frio pode ser quente?
O frio pode ser quente?
 
مذكرة The future للصف الثالث الابتدائى الترم الثانى
مذكرة The future للصف الثالث الابتدائى الترم الثانىمذكرة The future للصف الثالث الابتدائى الترم الثانى
مذكرة The future للصف الثالث الابتدائى الترم الثانى
 

Similar a Superficial mongo db

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBAlex Bilbie
 
MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup
MongoDB at the Silicon Valley iPhone and iPad Developers' MeetupMongoDB at the Silicon Valley iPhone and iPad Developers' Meetup
MongoDB at the Silicon Valley iPhone and iPad Developers' MeetupMongoDB
 
MongoDB Auto-Sharding at Mongo Seattle
MongoDB Auto-Sharding at Mongo SeattleMongoDB Auto-Sharding at Mongo Seattle
MongoDB Auto-Sharding at Mongo SeattleMongoDB
 
Webinar: Was ist neu in MongoDB 2.4
Webinar: Was ist neu in MongoDB 2.4Webinar: Was ist neu in MongoDB 2.4
Webinar: Was ist neu in MongoDB 2.4MongoDB
 
About elasticsearch
About elasticsearchAbout elasticsearch
About elasticsearchMinsoo Jun
 
DBVersity MongoDB Online Training Presentations
DBVersity MongoDB Online Training PresentationsDBVersity MongoDB Online Training Presentations
DBVersity MongoDB Online Training PresentationsSrinivas Mutyala
 
Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDBMongoDB
 
Mongo db Quick Guide
Mongo db Quick GuideMongo db Quick Guide
Mongo db Quick GuideSourabh Sahu
 
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
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongoMichael Bright
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and PythonMike Bright
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDBMongoDB
 
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)Uwe Printz
 
Mongodb intro
Mongodb introMongodb intro
Mongodb introchristkv
 
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 behlTO THE NEW | Technology
 

Similar a Superficial mongo db (20)

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup
MongoDB at the Silicon Valley iPhone and iPad Developers' MeetupMongoDB at the Silicon Valley iPhone and iPad Developers' Meetup
MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup
 
MongoDB Auto-Sharding at Mongo Seattle
MongoDB Auto-Sharding at Mongo SeattleMongoDB Auto-Sharding at Mongo Seattle
MongoDB Auto-Sharding at Mongo Seattle
 
Webinar: Was ist neu in MongoDB 2.4
Webinar: Was ist neu in MongoDB 2.4Webinar: Was ist neu in MongoDB 2.4
Webinar: Was ist neu in MongoDB 2.4
 
About elasticsearch
About elasticsearchAbout elasticsearch
About elasticsearch
 
MongoDB (Advanced)
MongoDB (Advanced)MongoDB (Advanced)
MongoDB (Advanced)
 
DBVersity MongoDB Online Training Presentations
DBVersity MongoDB Online Training PresentationsDBVersity MongoDB Online Training Presentations
DBVersity MongoDB Online Training Presentations
 
Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDB
 
Latinoware
LatinowareLatinoware
Latinoware
 
Mongo db Quick Guide
Mongo db Quick GuideMongo db Quick Guide
Mongo db Quick Guide
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 
introtomongodb
introtomongodbintrotomongodb
introtomongodb
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and Python
 
Einführung in MongoDB
Einführung in MongoDBEinführung in MongoDB
Einführung in MongoDB
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with 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)
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
MongoDB
MongoDBMongoDB
MongoDB
 
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
 

Más de DaeMyung Kang

How to use redis well
How to use redis wellHow to use redis well
How to use redis wellDaeMyung Kang
 
The easiest consistent hashing
The easiest consistent hashingThe easiest consistent hashing
The easiest consistent hashingDaeMyung Kang
 
How to name a cache key
How to name a cache keyHow to name a cache key
How to name a cache keyDaeMyung Kang
 
Integration between Filebeat and logstash
Integration between Filebeat and logstash Integration between Filebeat and logstash
Integration between Filebeat and logstash DaeMyung Kang
 
How to build massive service for advance
How to build massive service for advanceHow to build massive service for advance
How to build massive service for advanceDaeMyung Kang
 
Massive service basic
Massive service basicMassive service basic
Massive service basicDaeMyung Kang
 
Data Engineering 101
Data Engineering 101Data Engineering 101
Data Engineering 101DaeMyung Kang
 
How To Become Better Engineer
How To Become Better EngineerHow To Become Better Engineer
How To Become Better EngineerDaeMyung Kang
 
Kafka timestamp offset_final
Kafka timestamp offset_finalKafka timestamp offset_final
Kafka timestamp offset_finalDaeMyung Kang
 
Kafka timestamp offset
Kafka timestamp offsetKafka timestamp offset
Kafka timestamp offsetDaeMyung Kang
 
Data pipeline and data lake
Data pipeline and data lakeData pipeline and data lake
Data pipeline and data lakeDaeMyung Kang
 
webservice scaling for newbie
webservice scaling for newbiewebservice scaling for newbie
webservice scaling for newbieDaeMyung Kang
 

Más de DaeMyung Kang (20)

Count min sketch
Count min sketchCount min sketch
Count min sketch
 
Redis
RedisRedis
Redis
 
Ansible
AnsibleAnsible
Ansible
 
Why GUID is needed
Why GUID is neededWhy GUID is needed
Why GUID is needed
 
How to use redis well
How to use redis wellHow to use redis well
How to use redis well
 
The easiest consistent hashing
The easiest consistent hashingThe easiest consistent hashing
The easiest consistent hashing
 
How to name a cache key
How to name a cache keyHow to name a cache key
How to name a cache key
 
Integration between Filebeat and logstash
Integration between Filebeat and logstash Integration between Filebeat and logstash
Integration between Filebeat and logstash
 
How to build massive service for advance
How to build massive service for advanceHow to build massive service for advance
How to build massive service for advance
 
Massive service basic
Massive service basicMassive service basic
Massive service basic
 
Data Engineering 101
Data Engineering 101Data Engineering 101
Data Engineering 101
 
How To Become Better Engineer
How To Become Better EngineerHow To Become Better Engineer
How To Become Better Engineer
 
Kafka timestamp offset_final
Kafka timestamp offset_finalKafka timestamp offset_final
Kafka timestamp offset_final
 
Kafka timestamp offset
Kafka timestamp offsetKafka timestamp offset
Kafka timestamp offset
 
Data pipeline and data lake
Data pipeline and data lakeData pipeline and data lake
Data pipeline and data lake
 
Redis acl
Redis aclRedis acl
Redis acl
 
Coffee store
Coffee storeCoffee store
Coffee store
 
Scalable webservice
Scalable webserviceScalable webservice
Scalable webservice
 
Number system
Number systemNumber system
Number system
 
webservice scaling for newbie
webservice scaling for newbiewebservice scaling for newbie
webservice scaling for newbie
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
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 SavingEdi Saputra
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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, ...apidays
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
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.pdfsudhanshuwaghmare1
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
"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 ...Zilliz
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
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...Jeffrey Haguewood
 
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 Pakistandanishmna97
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Último (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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, ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
"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 ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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...
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Superficial mongo db

  • 1. Superficial MongoDB charsyam@naver.com
  • 2. MongoDB NoSQL Document BSON
  • 3. Document-Oriented Storage Full Index Support Replication & High Availability Auto Sharding Querying Fast In-Place Updates Map/Reduce GridFS
  • 4. Document-Oriented Storage Full Index Support Replication & High Availability Auto Sharding Querying Fast In-Place Updates Map/Reduce GridFS
  • 5. Document-Oriented > db.users.insert( { _id : "alex", name: { first:"Alex", last:"Benisson" }, karma : 1.0 } ) > db.posts.findOne() { _id : ObjectId("4e77bb3b8a3e000000004f7a"), when : Date("2011-09-19T02:10:11.3Z", author : "alex", title : "No Free Lunch", text : "This is the text of the post. It could be very long.", tags : [ "business", "ramblings" ], votes : 5, voters : [ "jane", "joe", "spencer", "phyllis", "li" ], comments : [ { who : "jane", when : Date("2011-09-19T04:00:10.112Z"), comment : "I agree." }, { who : "meghan", when : Date("2011-09-20T14:36:06.958Z"), comment : "You must be joking. etc etc ..." } ] }
  • 6. Full-Index Support > db.things.ensureIndex({j:1}); > db.things.ensureIndex({"address.city": 1}) > db.things.ensureIndex({j:1, name:-1}); > db.factories.insert( { name: "xyz", metro: { city: "New York", state: "NY" } } ); > db.factories.ensureIndex( { metro : 1 } ); // this query can use the above index: > > db.factories.find( { metro: { city: "New York", state: "NY" } } ); // this one too, as {city:"New York"} < {city:"New York",state:"NY"} > db.factories.find( { metro: { $gte : { city: "New York" } } } ); // this query does not match the document because the order of fields is significant > db.factories.find( { metro: { state: "NY" , city: "New York" } } );
  • 7. Replication Asynchronous Replication
  • 8. HA & FailOver Only Write to Primary Can read from Secondary Op Ordinal: Increasing ordinal to represent each operation Using Server ID + Op Ordinal
  • 9. Picking Primary 1. Get Max LocalOpOrdinal from each Server 2. if a majority of servers are not up (from this server's POV), remain in Secondary mode and stop. 3. if the last op time seems very old, stop and await human intervention. 4. else, using a consensus protocol, pick the server with the highest maxLocalOpOrdinal as the Primary.
  • 10. TIPs.
  • 11. Use 64bit Machine MongoDB Use Memory-Mapped File In 32bit. DB Size can’t over 2.5GB MongoDB is needed Big Memory
  • 12. Use Replica Set Use Replica Set and Journaling
  • 13. Use Lastest Version 2.0.2 is better than 1.8.x MongoDB has global Lock 1.8.x uses global Write Lock 2.0.x uses write with yield. Not supports db or collection lock
  • 14. Use Big Memory Disk Op is slower than Memory Op
  • 15. Shard
  • 17. Basic Data is split up into Chunks Chunk: 64mb or 100,000 objects Replication unit is chunk. Chunk Count > 9
  • 18. Mongod Data Store Replica Set(3 mongod)
  • 19. Mongos Proxy StateLess Routing to Shard
  • 20. Mongod configSvr mongod Can’t use Replica Set or M/A 1(test) or 3(real)
  • 21. Mongod configSvr Changes are made with 2PC If any are down, meta data goes read only System is online as long as 1/3 is up
  • 22. Use Scale Up than Sharding Difficult to find good Shard Key. Not Support Data Center awareness Add memory and hdd, ssd
  • 26. Operations Default: Write/read operation goes to master Can read from slaves.