SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
MongoDB Sunum
Tarık YILMAZ
MongoDB Sunum

MongoDB Nedir?
MongoDB Nedir?

MongoDB, Doküman tabanlı, C++ ile
geliştirilen bir NoSQL veri tabanıdır. Bilinen
en yaygın NoSQL veri tabanıdır. Veriler
BSON (Binary JSON) türünde
dokümanlarda tutulur. Tablo yoktur,
tasarım yoktur, ilişki yoktur. [Schema-less]
MongoDB Nedir?

Yayılmasında etken olan durumlar;
•
hızlı R/W kapasitesi
•
dinamik veri yapısı
•
yatay ölçeklenebilme
•
aggregation ve map-reduce desteği
•
GridFS ile dosya ve metadata saklama
•
C++, PHP, Java, Python, JS, C#, Perl, ...
MongoDB Sunum

SQL ve NoSQL arasındaki
farklar nelerdir ?
SQL vs NoSQL

SQL
•
•
•
•

Sabit tablo yapısı vardır
Kalıp veriler için uygundur
Genelde küçük ve orta çaplı veriler için tasarlanmıştır
Dağıtık yapı için pek uygun değildir

NoSQL
•
•
•
•

Şemasız dinamik tasarım vardır
Esnek veriler için uygundur
Orta ve büyük veriler için tasarlanmıştır
Dağıtık yapıya önem verilir
MongoDB Sunum

Hangi Durumlarda MongoDB
Kullanılmalı?
MongoDB Kullanım Durumu

•
•
•
•
•
•

Yüksek R/W trafiği
Karmaşık sorgu & analiz ihtiyacı
Kullanıcı IO, haber, duyuru verileri
Log verileri
Ürün, katalog verileri saklanması
Resim, video saklanması (GridFS)
MongoDB Sunum

Kimler Kullanıyor?
Kimler Kullanıyor?
MySQL vs MongoDB

MySQL

MongoDB

Database
Table
Row
Column

DB
Collection
Document
Field

Column Name => Value

Key => Value
MongoDB Sunum

PHP ve MongoDB
PHP MongoDB
Örnek veri :
{

}

“username” : “trK.54.Ylmz”,
“password” : “a123ay346ADQ2asd”,
“logged” : false,
“activated” : true,
“regdate” : new MongoDate(),
“age” : 22,
“sales” : {“electronic”: [“ipod”, “iphone”]},
“comment” : [1,13,34,76,122]
PHP MongoDB
User collection :
{
}

“username” : “tarik54”,
“comment” : [1,13,34,76,122]

Comment collection:
{
}

relation
“id” : 34
“content” : “Hello World!”
PHP MongoDB

PHP Classes & Objects
•
•
•
•
•
•

MongoClient
MongoDB
MongoCollection
MongoCursor
MongoGridFS
MongoGridFSCursor
PHP MongoDB

•
•
•
•

•
•

$con
$con
$con
$con

=
=
=
=

new MongoClient();
new MongoClient(“mongodb://localhost:27017”);
new MongoClient(“mongodb://user:pass@67.169.147/test”)
new MongoClient(
“mongodb://localhost:12345,serv1.example.com/dbtest”);

$coll = $con->selectCollection(“test”, “testColl”);
$coll = $con->selectDB(“test”)->selectCollection(“testColl”);
PHP MongoDB

•

•

•

•

$data = $coll->findOne(array(“username” => “tarik54”));
$datas = $coll->find(
array(“logged” => true),
array(“username” => true));
$datas = $coll->find(array(“logged” => true,
'$or' => [“age” => 22, “activated” => true]));
$datas = $coll->find(array(“logged“ => true))
->sort(array(“username” => -1))
->skip(10)
->limit(10);
PHP MongoDB

•

•

•
•
•
•

•

$object = array(“username” => “tarik54”,
“password” => “2312aa”,
“logged” => false);
$result = $coll->insert($object);
$object2 = new UserObject();
$object2->setUsername(“tarik54”);
$object2->setPassword(“2312aa”);
$object2->setLogStatus(false);
$result = $coll->insert($object);
PHP MongoDB

•

•

•

•

$coll->update(array(“username” => “tarik54”),
array('$set' => array('logged' => true)));
$coll->update(array(“uid” => 12561211),
array('$inc' => array(“age” => 1)));
$coll->update(array(“uid” => 12561211),
array(“$push” => array(“comment” => 152)));
$coll->remove(array(“activated” => false));
MongoDB vs MySQL

MongoDB ve MySQL
Benchmark
MySQL vs MongoDB

MySQL
v5.5.35
Mysqli

vs.

MongoDB
v2.4.9
PHPMongo

PHP Client
100000 adet veri
Insert + Get + Increment
Sync requests
MySQL vs MongoDB

MySQL

vs.

Get : 23.7655899525352
Insert : 607.1592478752136
Increm. : 439.2179238796234
sonuçlar sn türündedir.

MongoDB
8.2969670295715
11.084399938583
19.202459096909
MongoDB Sunum

Sorular?

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Inside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source DatabaseInside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source Database
 
Mongo DB 성능최적화 전략
Mongo DB 성능최적화 전략Mongo DB 성능최적화 전략
Mongo DB 성능최적화 전략
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
Webscale PostgreSQL - JSONB and Horizontal Scaling Strategies
Webscale PostgreSQL - JSONB and Horizontal Scaling StrategiesWebscale PostgreSQL - JSONB and Horizontal Scaling Strategies
Webscale PostgreSQL - JSONB and Horizontal Scaling Strategies
 
computer language - Html frames
computer language - Html framescomputer language - Html frames
computer language - Html frames
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
HTML
HTMLHTML
HTML
 
java script json
java script jsonjava script json
java script json
 
Mongo db 최범균
Mongo db 최범균Mongo db 최범균
Mongo db 최범균
 
JSON-LD and MongoDB
JSON-LD and MongoDBJSON-LD and MongoDB
JSON-LD and MongoDB
 
Migrating to MongoDB: Best Practices
Migrating to MongoDB: Best PracticesMigrating to MongoDB: Best Practices
Migrating to MongoDB: Best Practices
 
When to Use MongoDB
When to Use MongoDBWhen to Use MongoDB
When to Use MongoDB
 
Module 3 - Intro to Bootstrap
Module 3 - Intro to BootstrapModule 3 - Intro to Bootstrap
Module 3 - Intro to Bootstrap
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
[124]네이버에서 사용되는 여러가지 Data Platform, 그리고 MongoDB
[124]네이버에서 사용되는 여러가지 Data Platform, 그리고 MongoDB[124]네이버에서 사용되는 여러가지 Data Platform, 그리고 MongoDB
[124]네이버에서 사용되는 여러가지 Data Platform, 그리고 MongoDB
 
NodeJS
NodeJSNodeJS
NodeJS
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
 

Andere mochten auch (6)

NoSQL Sunumu
NoSQL SunumuNoSQL Sunumu
NoSQL Sunumu
 
MongoDB
MongoDBMongoDB
MongoDB
 
NoSQL - Yazılımcı Bakışıyla
NoSQL - Yazılımcı BakışıylaNoSQL - Yazılımcı Bakışıyla
NoSQL - Yazılımcı Bakışıyla
 
MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of view
 
Conceptos básicos. seminario web 3 : Diseño de esquema pensado para documentos
Conceptos básicos. seminario web 3 : Diseño de esquema pensado para documentosConceptos básicos. seminario web 3 : Diseño de esquema pensado para documentos
Conceptos básicos. seminario web 3 : Diseño de esquema pensado para documentos
 
NoSQL: Introducción a las Bases de Datos no estructuradas
NoSQL: Introducción a las Bases de Datos no estructuradasNoSQL: Introducción a las Bases de Datos no estructuradas
NoSQL: Introducción a las Bases de Datos no estructuradas
 

Ähnlich wie Mongo sunum

AnkaraJUG Haziran 2013 - No SQL / Big Data
AnkaraJUG Haziran 2013 - No SQL / Big DataAnkaraJUG Haziran 2013 - No SQL / Big Data
AnkaraJUG Haziran 2013 - No SQL / Big Data
Ankara JUG
 
Mongodb Ödev- İnternet programcılığı- IP2-Vize 2
Mongodb Ödev- İnternet programcılığı- IP2-Vize 2Mongodb Ödev- İnternet programcılığı- IP2-Vize 2
Mongodb Ödev- İnternet programcılığı- IP2-Vize 2
gulindasdan
 
Vhdl dokumani
Vhdl dokumaniVhdl dokumani
Vhdl dokumani
sersld80
 

Ähnlich wie Mongo sunum (20)

MongoDB ve C# Driver'ı
MongoDB ve C# Driver'ıMongoDB ve C# Driver'ı
MongoDB ve C# Driver'ı
 
Nosql & MongoDB
Nosql & MongoDBNosql & MongoDB
Nosql & MongoDB
 
AnkaraJUG Haziran 2013 - No SQL / Big Data
AnkaraJUG Haziran 2013 - No SQL / Big DataAnkaraJUG Haziran 2013 - No SQL / Big Data
AnkaraJUG Haziran 2013 - No SQL / Big Data
 
MongoDB Overview
MongoDB OverviewMongoDB Overview
MongoDB Overview
 
Mongodb Ödev- İnternet programcılığı- IP2-Vize 2
Mongodb Ödev- İnternet programcılığı- IP2-Vize 2Mongodb Ödev- İnternet programcılığı- IP2-Vize 2
Mongodb Ödev- İnternet programcılığı- IP2-Vize 2
 
Modern Frontend
Modern FrontendModern Frontend
Modern Frontend
 
Riak ve RiakCS
Riak ve RiakCSRiak ve RiakCS
Riak ve RiakCS
 
React.js Web Programlama
React.js Web ProgramlamaReact.js Web Programlama
React.js Web Programlama
 
Spring Data MongoDB Webiner
Spring Data MongoDB WebinerSpring Data MongoDB Webiner
Spring Data MongoDB Webiner
 
Serverless ile istegelsin
Serverless ile istegelsin Serverless ile istegelsin
Serverless ile istegelsin
 
Nosql ve mongoDB
Nosql ve mongoDBNosql ve mongoDB
Nosql ve mongoDB
 
Berkeley Data Analytics Stack Genel Bakış
Berkeley Data Analytics Stack Genel Bakış Berkeley Data Analytics Stack Genel Bakış
Berkeley Data Analytics Stack Genel Bakış
 
Berkeley Data Analytics Stack Genel Bakış
Berkeley Data Analytics Stack Genel BakışBerkeley Data Analytics Stack Genel Bakış
Berkeley Data Analytics Stack Genel Bakış
 
Hadoop @ devveri.com
Hadoop @ devveri.comHadoop @ devveri.com
Hadoop @ devveri.com
 
Jstanbul, Node.js based Socket.IO, Express and HTML5 based Bingo Game
Jstanbul, Node.js based Socket.IO, Express and HTML5 based Bingo GameJstanbul, Node.js based Socket.IO, Express and HTML5 based Bingo Game
Jstanbul, Node.js based Socket.IO, Express and HTML5 based Bingo Game
 
TBD Bilişim 2014 Veri Analitiği
TBD Bilişim 2014 Veri AnalitiğiTBD Bilişim 2014 Veri Analitiği
TBD Bilişim 2014 Veri Analitiği
 
MongoDB - JSON'a Genel Bakış
MongoDB - JSON'a Genel BakışMongoDB - JSON'a Genel Bakış
MongoDB - JSON'a Genel Bakış
 
Veri işleme üzerine, Hakan Sarıbıyık
Veri işleme üzerine, Hakan SarıbıyıkVeri işleme üzerine, Hakan Sarıbıyık
Veri işleme üzerine, Hakan Sarıbıyık
 
Vhdl dokumani
Vhdl dokumaniVhdl dokumani
Vhdl dokumani
 
Pig ve Hive ile Hadoop üzerinde Veri Analizi
Pig ve Hive ile Hadoop üzerinde Veri AnaliziPig ve Hive ile Hadoop üzerinde Veri Analizi
Pig ve Hive ile Hadoop üzerinde Veri Analizi
 

Mongo sunum