SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
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?

Mais conteúdo relacionado

Mais procurados

[D13] Disaster Recovery環境をOracle Standard Editionでつくる by Miyuki Ohasi
[D13] Disaster Recovery環境をOracle Standard Editionでつくる by Miyuki Ohasi[D13] Disaster Recovery環境をOracle Standard Editionでつくる by Miyuki Ohasi
[D13] Disaster Recovery環境をOracle Standard Editionでつくる by Miyuki Ohasi
Insight Technology, Inc.
 

Mais procurados (20)

Yahoo! JAPANにおけるApache Cassandraへの取り組み
Yahoo! JAPANにおけるApache Cassandraへの取り組みYahoo! JAPANにおけるApache Cassandraへの取り組み
Yahoo! JAPANにおけるApache Cassandraへの取り組み
 
MongoDB Overview
MongoDB OverviewMongoDB Overview
MongoDB Overview
 
Hadoop -NameNode HAの仕組み-
Hadoop -NameNode HAの仕組み-Hadoop -NameNode HAの仕組み-
Hadoop -NameNode HAの仕組み-
 
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesNot Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
 
OrientDB for real & Web App development
OrientDB for real & Web App developmentOrientDB for real & Web App development
OrientDB for real & Web App development
 
A Technical Introduction to WiredTiger
A Technical Introduction to WiredTigerA Technical Introduction to WiredTiger
A Technical Introduction to WiredTiger
 
Redis overview for Software Architecture Forum
Redis overview for Software Architecture ForumRedis overview for Software Architecture Forum
Redis overview for Software Architecture Forum
 
Streaming Event Time Partitioning with Apache Flink and Apache Iceberg - Juli...
Streaming Event Time Partitioning with Apache Flink and Apache Iceberg - Juli...Streaming Event Time Partitioning with Apache Flink and Apache Iceberg - Juli...
Streaming Event Time Partitioning with Apache Flink and Apache Iceberg - Juli...
 
SQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBSQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDB
 
[D13] Disaster Recovery環境をOracle Standard Editionでつくる by Miyuki Ohasi
[D13] Disaster Recovery環境をOracle Standard Editionでつくる by Miyuki Ohasi[D13] Disaster Recovery環境をOracle Standard Editionでつくる by Miyuki Ohasi
[D13] Disaster Recovery環境をOracle Standard Editionでつくる by Miyuki Ohasi
 
FOOPS!: An Ontology Pitfall Scanner for the FAIR principles
FOOPS!: An Ontology Pitfall Scanner for the FAIR principlesFOOPS!: An Ontology Pitfall Scanner for the FAIR principles
FOOPS!: An Ontology Pitfall Scanner for the FAIR principles
 
How We Optimize Spark SQL Jobs With parallel and sync IO
How We Optimize Spark SQL Jobs With parallel and sync IOHow We Optimize Spark SQL Jobs With parallel and sync IO
How We Optimize Spark SQL Jobs With parallel and sync IO
 
What is Hadoop | Introduction to Hadoop | Hadoop Tutorial | Hadoop Training |...
What is Hadoop | Introduction to Hadoop | Hadoop Tutorial | Hadoop Training |...What is Hadoop | Introduction to Hadoop | Hadoop Tutorial | Hadoop Training |...
What is Hadoop | Introduction to Hadoop | Hadoop Tutorial | Hadoop Training |...
 
SQL on everything, in memory
SQL on everything, in memorySQL on everything, in memory
SQL on everything, in memory
 
Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...
 
OrientDB Distributed Architecture v2.0
OrientDB Distributed Architecture v2.0OrientDB Distributed Architecture v2.0
OrientDB Distributed Architecture v2.0
 
HDFSネームノードのHAについて #hcj13w
HDFSネームノードのHAについて #hcj13wHDFSネームノードのHAについて #hcj13w
HDFSネームノードのHAについて #hcj13w
 
Presentation oracle super cluster t5-8 technical deep dive
Presentation   oracle super cluster t5-8 technical deep divePresentation   oracle super cluster t5-8 technical deep dive
Presentation oracle super cluster t5-8 technical deep dive
 
Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...
Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...
Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 

Destaque

Destaque (7)

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
 
When to Use MongoDB
When to Use MongoDBWhen to Use MongoDB
When to Use MongoDB
 
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
 

Semelhante a 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
 

Semelhante a 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 Ö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
 
Yazılım Yetekenleri İle Teknik SEO Dünyasında Harikalar Yaratın
Yazılım Yetekenleri İle Teknik SEO Dünyasında Harikalar YaratınYazılım Yetekenleri İle Teknik SEO Dünyasında Harikalar Yaratın
Yazılım Yetekenleri İle Teknik SEO Dünyasında Harikalar Yaratın
 

Mongo sunum