SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
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!

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...
Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...
Расширенный анализ начисленных налогов и страховых взносов для конфигурации «...Сергей Иванов
 
اللمبات الموفره نوبل الفيزياء 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
 

Andere mochten auch (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 للصف الثالث الابتدائى الترم الثانى
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
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
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
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
 
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 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
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
 
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
 
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
 

Kürzlich hochgeladen (20)

Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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, ...
 
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 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
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
 
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
 
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
 

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.