SlideShare ist ein Scribd-Unternehmen logo
1 von 32
MongoDB

2011/6/28
•                  @nobu_k

    •   Preferred Infrastructure (PFI)
    •   Sedue

•   Sedue        MongoDB(1.6)

    •                 CT○

        •   http://slidesha.re/hl8PyL
        •   MongoDB as Search Engine Repository
• oplog
•
• MongoDB
  • https://github.com/mongodb/mongo/
     commits/master/
•                 2011/6/26

    •2
•        pull
oplog


•
•                       2

    • createOplog
    • logOp
    • db/oplog[h,cpp]
•
createOplog


• oplog
•
createOplog
void createOplog() {                                 > use local
  dblock lk;     // DB                               switched to db local
                                                     > show collections
                             // DB.                  me
  const char * ns = "local.oplog.$main";             oplog.$main
                                                     pair.sync
                                                     slaves
                                                     sources
                                                     system.indexes
  bool rs = !cmdLine._replSet.empty();
  if( rs )
      ns = rsoplog;      // "local.oplog.rs";
                         // in db/repl/rs_optime.h


                                 NS
oplog

Client::Context ctx(ns);         //         NS

NamespaceDetails * nsd = nsdetails( ns );

if ( nsd ) {    // oplog
   ...              ...
    ...                    ...
}
• oplog
• ReplicaSet

 •
oplog
•         oplog

•
    1. oplog

    2. BSON       NS

      •                BSON!!

    3. oplog
•
    • Mac
• oplog     capped collection
createOplog
•
    •   db/repl.cpp
    •   db/repl/rs_initialsync.cpp
    •   db/repl/rs_initiate.cpp
•   ReplicaSet



    •
•
    •   dblock
    •   CmdLine
    •   Context
    •   DBDirectClient
    •   NamespaceDetails, nsdetails
•
dblock
•   DB

    •   db/concurrency.h
•   Deprecated
    •                 writelock

•                  dbMutex

    •   scoped_lock

    •   RAII
CmdLine
•
    •   db/cmdline.[h, cpp]
•                                  boost::program_options



•   extern                            2

    •   db/db.cpp //

    •   client/clientOnly.cpp //
Client::Context
•
    •            NS

    •   Client

    •   db/client.[h,cpp]
•   RAII

•   DB
currentClient
•                                   Client

    •            Thread Local

    • boost::thread_specific_ptr<Client>
    • cc(), currenctClient, Context::getClient
•                            DB
DBDirectClient
•
•   DBClientInterface (client/dbclient.h)
•   DBConnector (client/dbclient.h)
•   DBClientWithCommands : public DBClientInterface
    •   DBClientBase : public DBClientWithCommands, public DBConnector
        •   DBDirectClient : public DBClientBase
•   findOne

    •   c.findOne→DBClientInterface::findOne→DBClientInterface::findN→(virtual
           )DBDirectClient::query→DBClientBase::query

        •               DBClientCursor

•
NamespaceDetails
• .ns               (1   )

•
  • Database
  • MongoDataFile
  • Record
•
nsdetails
•           Context NamespaceDetails

    •   db/pdfile.h
•   cc().database()->namespaceIndex->details
•   NamespaceIndex
    •   map<string, NamespaceDetails>

    •
logOp


•
•
oplog
{
    ts:                • oplog   BSON
    op:
    ns:       NS       •
    o: BSON

    o2:
}                      •          o2
•   i : insert
•   u : update
•   d : delete
•   c : db cmd? userCreateNS?
•   db : declares presence of a database
•   n : no op (              )

    •
    •   keep alive
•
logOp
_logOp

void logOp(const char *opstr, const char *ns,
 const BSONObj& obj, BSONObj *patt, bool *b) {
 if ( replSettings.master ) {
   _logOp(opstr, ns, 0, obj, patt, b);
 }

    logOpForSharding( opstr , ns , obj , patt );
}
_logOp
•
    • _logOpOld
    • _logOpRS
    • etc?
•
_logOpOld
•
• Record theDataFileMgr
  • fast_oplog_insert!!
•               (       mmap
    )
append_O_Obj
• partial ”o”+
•        BSONBuilder



 •
 • repeatedly          ed
_logOpRS


•
logOp


•
• grep it!
• applyOperation_inlock
• pretouch
We are hiring           !
•
    •
    •
•
    •
•
    •
    •   OSS

    •
•             (´   ω   `)

Weitere ähnliche Inhalte

Was ist angesagt?

Clojure + MongoDB on Heroku
Clojure + MongoDB on HerokuClojure + MongoDB on Heroku
Clojure + MongoDB on HerokuNaoyuki Kakuda
 
N hidden gems you didn't know hippo delivery tier and hippo (forge) could give
N hidden gems you didn't know hippo delivery tier and hippo (forge) could giveN hidden gems you didn't know hippo delivery tier and hippo (forge) could give
N hidden gems you didn't know hippo delivery tier and hippo (forge) could giveWoonsan Ko
 
Владимир Мигуро "Дао Node.js"
Владимир Мигуро "Дао Node.js"Владимир Мигуро "Дао Node.js"
Владимир Мигуро "Дао Node.js"EPAM Systems
 
Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and Pierre Joye
 
NoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDBNoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDBSqreen
 
37562259 top-consuming-process
37562259 top-consuming-process37562259 top-consuming-process
37562259 top-consuming-processskumner
 
Extending php (7), the basics
Extending php (7), the basicsExtending php (7), the basics
Extending php (7), the basicsPierre Joye
 
Security Challenges in Node.js
Security Challenges in Node.jsSecurity Challenges in Node.js
Security Challenges in Node.jsWebsecurify
 
Sample file processing
Sample file processingSample file processing
Sample file processingIssay Meii
 
PyCon KR 2019 sprint - RustPython by example
PyCon KR 2019 sprint  - RustPython by examplePyCon KR 2019 sprint  - RustPython by example
PyCon KR 2019 sprint - RustPython by exampleYunWon Jeong
 
PuppetDB, Puppet Explorer and puppetdbquery
PuppetDB, Puppet Explorer and puppetdbqueryPuppetDB, Puppet Explorer and puppetdbquery
PuppetDB, Puppet Explorer and puppetdbqueryPuppet
 
Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Hiroki Mizuno
 
Fast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambdaFast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambdaMila Frerichs
 
The Art of Command Line (2021)
The Art of Command Line (2021)The Art of Command Line (2021)
The Art of Command Line (2021)Kenta Yamamoto
 
Docker tips & tricks
Docker  tips & tricksDocker  tips & tricks
Docker tips & tricksDharmit Shah
 

Was ist angesagt? (19)

Clojure + MongoDB on Heroku
Clojure + MongoDB on HerokuClojure + MongoDB on Heroku
Clojure + MongoDB on Heroku
 
Redis
RedisRedis
Redis
 
N hidden gems you didn't know hippo delivery tier and hippo (forge) could give
N hidden gems you didn't know hippo delivery tier and hippo (forge) could giveN hidden gems you didn't know hippo delivery tier and hippo (forge) could give
N hidden gems you didn't know hippo delivery tier and hippo (forge) could give
 
Владимир Мигуро "Дао Node.js"
Владимир Мигуро "Дао Node.js"Владимир Мигуро "Дао Node.js"
Владимир Мигуро "Дао Node.js"
 
Mongodb
MongodbMongodb
Mongodb
 
Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and
 
NoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDBNoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDB
 
37562259 top-consuming-process
37562259 top-consuming-process37562259 top-consuming-process
37562259 top-consuming-process
 
Extending php (7), the basics
Extending php (7), the basicsExtending php (7), the basics
Extending php (7), the basics
 
Security Challenges in Node.js
Security Challenges in Node.jsSecurity Challenges in Node.js
Security Challenges in Node.js
 
Sample file processing
Sample file processingSample file processing
Sample file processing
 
PyCon KR 2019 sprint - RustPython by example
PyCon KR 2019 sprint  - RustPython by examplePyCon KR 2019 sprint  - RustPython by example
PyCon KR 2019 sprint - RustPython by example
 
Jk rubyslava 25
Jk rubyslava 25Jk rubyslava 25
Jk rubyslava 25
 
PuppetDB, Puppet Explorer and puppetdbquery
PuppetDB, Puppet Explorer and puppetdbqueryPuppetDB, Puppet Explorer and puppetdbquery
PuppetDB, Puppet Explorer and puppetdbquery
 
Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02
 
Fast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambdaFast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambda
 
The Art of Command Line (2021)
The Art of Command Line (2021)The Art of Command Line (2021)
The Art of Command Line (2021)
 
Docker tips & tricks
Docker  tips & tricksDocker  tips & tricks
Docker tips & tricks
 
Etcd terraform by Alex Somesan
Etcd terraform by Alex SomesanEtcd terraform by Alex Somesan
Etcd terraform by Alex Somesan
 

Ähnlich wie 第一回MongoDBソースコードリーディング

MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewAntonio Pintus
 
Blocks & GCD
Blocks & GCDBlocks & GCD
Blocks & GCDrsebbe
 
MongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsMongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsServer Density
 
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!Daniel Cousineau
 
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...MongoDB
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHPichikaway
 
Mongodb intro
Mongodb introMongodb intro
Mongodb introchristkv
 
Functional Hostnames and Why they are Bad
Functional Hostnames and Why they are BadFunctional Hostnames and Why they are Bad
Functional Hostnames and Why they are BadPuppet
 
Take advantage of C++ from Python
Take advantage of C++ from PythonTake advantage of C++ from Python
Take advantage of C++ from PythonYung-Yu Chen
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryMongoDB
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryMongoDB
 
MongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in BavariaMongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in BavariaMongoDB
 
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...Comsysto Reply GmbH
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongoMichael Bright
 

Ähnlich wie 第一回MongoDBソースコードリーディング (20)

MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overview
 
Blocks & GCD
Blocks & GCDBlocks & GCD
Blocks & GCD
 
Full metal mongo
Full metal mongoFull metal mongo
Full metal mongo
 
MongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsMongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & Analytics
 
MongoDB at GUL
MongoDB at GULMongoDB at GUL
MongoDB at GUL
 
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
 
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 
Latinoware
LatinowareLatinoware
Latinoware
 
Kyotoproducts
KyotoproductsKyotoproducts
Kyotoproducts
 
Rails with mongodb
Rails with mongodbRails with mongodb
Rails with mongodb
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
Functional Hostnames and Why they are Bad
Functional Hostnames and Why they are BadFunctional Hostnames and Why they are Bad
Functional Hostnames and Why they are Bad
 
Take advantage of C++ from Python
Take advantage of C++ from PythonTake advantage of C++ from Python
Take advantage of C++ from Python
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
 
MongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in BavariaMongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in Bavaria
 
Kiosk / PHP
Kiosk / PHP Kiosk / PHP
Kiosk / PHP
 
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo
 

Mehr von nobu_k

Elasticsearchと機械学習を実際に連携させる
Elasticsearchと機械学習を実際に連携させるElasticsearchと機械学習を実際に連携させる
Elasticsearchと機械学習を実際に連携させるnobu_k
 
機械学習を利用したちょっとリッチな検索
機械学習を利用したちょっとリッチな検索機械学習を利用したちょっとリッチな検索
機械学習を利用したちょっとリッチな検索nobu_k
 
4th PFI System reading
4th PFI System reading4th PFI System reading
4th PFI System readingnobu_k
 
Goraft and InfluxDB
Goraft and InfluxDBGoraft and InfluxDB
Goraft and InfluxDBnobu_k
 
Transactional Information Systems入門
Transactional Information Systems入門Transactional Information Systems入門
Transactional Information Systems入門nobu_k
 
Riak Source Code Reading #2: Erlang Client
Riak Source Code Reading #2: Erlang ClientRiak Source Code Reading #2: Erlang Client
Riak Source Code Reading #2: Erlang Clientnobu_k
 
Suffix Array@Solr勉強会
Suffix Array@Solr勉強会Suffix Array@Solr勉強会
Suffix Array@Solr勉強会nobu_k
 

Mehr von nobu_k (8)

Elasticsearchと機械学習を実際に連携させる
Elasticsearchと機械学習を実際に連携させるElasticsearchと機械学習を実際に連携させる
Elasticsearchと機械学習を実際に連携させる
 
機械学習を利用したちょっとリッチな検索
機械学習を利用したちょっとリッチな検索機械学習を利用したちょっとリッチな検索
機械学習を利用したちょっとリッチな検索
 
4th PFI System reading
4th PFI System reading4th PFI System reading
4th PFI System reading
 
Goraft and InfluxDB
Goraft and InfluxDBGoraft and InfluxDB
Goraft and InfluxDB
 
Transactional Information Systems入門
Transactional Information Systems入門Transactional Information Systems入門
Transactional Information Systems入門
 
Riak Source Code Reading #2: Erlang Client
Riak Source Code Reading #2: Erlang ClientRiak Source Code Reading #2: Erlang Client
Riak Source Code Reading #2: Erlang Client
 
Paxos
PaxosPaxos
Paxos
 
Suffix Array@Solr勉強会
Suffix Array@Solr勉強会Suffix Array@Solr勉強会
Suffix Array@Solr勉強会
 

Kürzlich hochgeladen

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

第一回MongoDBソースコードリーディング

  • 2. @nobu_k • Preferred Infrastructure (PFI) • Sedue • Sedue MongoDB(1.6) • CT○ • http://slidesha.re/hl8PyL • MongoDB as Search Engine Repository
  • 4. • MongoDB • https://github.com/mongodb/mongo/ commits/master/ • 2011/6/26 •2 • pull
  • 6. 2 • createOplog • logOp • db/oplog[h,cpp] •
  • 8. createOplog void createOplog() { > use local dblock lk; // DB switched to db local > show collections // DB. me const char * ns = "local.oplog.$main"; oplog.$main pair.sync slaves sources system.indexes bool rs = !cmdLine._replSet.empty(); if( rs ) ns = rsoplog; // "local.oplog.rs"; // in db/repl/rs_optime.h NS
  • 9. oplog Client::Context ctx(ns); // NS NamespaceDetails * nsd = nsdetails( ns ); if ( nsd ) { // oplog ... ... ... ... }
  • 11. oplog • oplog • 1. oplog 2. BSON NS • BSON!! 3. oplog
  • 12. • Mac • oplog capped collection
  • 13. createOplog • • db/repl.cpp • db/repl/rs_initialsync.cpp • db/repl/rs_initiate.cpp • ReplicaSet •
  • 14. • dblock • CmdLine • Context • DBDirectClient • NamespaceDetails, nsdetails •
  • 15. dblock • DB • db/concurrency.h • Deprecated • writelock • dbMutex • scoped_lock • RAII
  • 16. CmdLine • • db/cmdline.[h, cpp] • boost::program_options • extern 2 • db/db.cpp // • client/clientOnly.cpp //
  • 17. Client::Context • • NS • Client • db/client.[h,cpp] • RAII • DB
  • 18. currentClient • Client • Thread Local • boost::thread_specific_ptr<Client> • cc(), currenctClient, Context::getClient • DB
  • 19. DBDirectClient • • DBClientInterface (client/dbclient.h) • DBConnector (client/dbclient.h) • DBClientWithCommands : public DBClientInterface • DBClientBase : public DBClientWithCommands, public DBConnector • DBDirectClient : public DBClientBase • findOne • c.findOne→DBClientInterface::findOne→DBClientInterface::findN→(virtual )DBDirectClient::query→DBClientBase::query • DBClientCursor •
  • 20. NamespaceDetails • .ns (1 ) • • Database • MongoDataFile • Record •
  • 21. nsdetails • Context NamespaceDetails • db/pdfile.h • cc().database()->namespaceIndex->details • NamespaceIndex • map<string, NamespaceDetails> •
  • 23. oplog { ts: • oplog BSON op: ns: NS • o: BSON o2: } • o2
  • 24. i : insert • u : update • d : delete • c : db cmd? userCreateNS? • db : declares presence of a database • n : no op ( ) • • keep alive •
  • 25. logOp _logOp void logOp(const char *opstr, const char *ns, const BSONObj& obj, BSONObj *patt, bool *b) { if ( replSettings.master ) { _logOp(opstr, ns, 0, obj, patt, b); } logOpForSharding( opstr , ns , obj , patt ); }
  • 26. _logOp • • _logOpOld • _logOpRS • etc? •
  • 27. _logOpOld • • Record theDataFileMgr • fast_oplog_insert!! • ( mmap )
  • 28. append_O_Obj • partial ”o”+ • BSONBuilder • • repeatedly ed
  • 32. We are hiring ! • • • • • • • • OSS • • (´ ω `)

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n