Title: No SQL Database
1No SQL Database
- Astharina W 7408040036
- Archi W 7408040048
- Mas Dodik 7408040059
2Outlines
- Apa itu No Sql Database ?
- Sejarah dan perkembangan
- Mengapa Menggunakan No Sql Database
- Klasifikasi No SQL Database
- Perbedaan SQL dan No SQL Database
- Etc.
3Apa Itu No SQL Database
- Dapat juga disebut Not Only SQL adalah sistem
manajemen database alternatif yang berbeda jauh
dari model tradisional dari sistem manajemen
database relasional (RDBMS) ataupun sistem
manajemen database berbasis object(ODBMS). - Penyimpanan data ini tidak memerlukan skema
tabel tetap, biasanya menghindari joins operation
dan skala horizontal, merupakan open source, cara
penyimpanannya- pun tidak memerlukan inisialisasi
terlebih dahulu. - Dalam arti luas,cara penyimpanan data yang tidak
menggunakan sql atau database relasional untuk
menyimpan data. - Di Populerkan oleh website besar seperti Google
dan Facebook.
4Sejarah dan Perkembangan NoSql
- Coined in 1998 by Carlos Strozzi to describe a
database that did not expose a SQL interface - In 2008, Eric Evans reintroduced the term to
describe the growing non-RDBMS movement - Popularized by large web sites such as Google,
Facebook and Digg - http//en.wikipedia.org/wiki/NoSQL_28RDBMS29
5Sejarah dan Perkembangan NoSql
- - Perkembangan dari situs media sosial (Facebook,
Twitter) dengan kebutuhan data yang besar. - - Kebutuhan akan penyimpanan data yang besar di
situs web besar seperti Google, Yahoo ( Banyak
data yang tidak file ). - - Munculnya solusi berbasis cloud seperti Amazon
S3 (solusi penyimpanan yang sederhana) - - Untuk tipe data dinamis dengan seringnya
perubahan skema. - - Komunitas open-source.
6Sejarah dan Perkembangan NoSql
- Ada tiga bahasan besar yang mendorong
perkembangan NoSql - BigTable (Google)
- Dynamo (Amazon)
- CAP Theorem
7No Sql Database Karakteristik
- Large data volumes
- Googles big data
- Queries need to return answers quickly
- Mostly query, few updates
- Asynchronous Inserts Updates
- Schema-less
- ACID transaction properties are not needed
- BASE transaction
- CAP Theorem
- Open source development
8Transactions ACID Properties
- Atomic All of the work in a transaction
completes (commit) or none of it completes - Consistent A transaction transforms the
database from one consistent state to another
consistent state. Consistency is defined in terms
of constraints. - Isolated The results of any changes made during
a transaction are not visible until the
transaction has committed. - Durable The results of a committed transaction
survive failures
9BASE Transactions
- Acronym contrived to be the opposite of ACID
- Basically Available,
- Soft state,
- Eventually Consistent
- Characteristics
- Weak consistency stale data OK
- Availability first
- Best effort
- Approximate answers OK
- Aggressive (optimistic)
- Simpler and faster
10Keuntungan
- Cheap, easy to implement (open source)
- Data are replicated to multiple nodes (therefore
identical and fault-tolerant) and can be
partitioned - Down nodes easily replaced
- No single point of failure
- Easy to distribute
- Don't require a schema
- Can scale up and down
- Relax the data consistency requirement (CAP)
11NoSQL Products
- Cassandra
- CouchDB
- Hadoop Hbase
- MongoDB
- StupidDB
- Etc.
12Perbandingan Beberapa Aplikasi NoSQL DataBase
13Perbandingan Beberapa Aplikasi NoSQL DataBase
14Perbandingan Beberapa Aplikasi NoSQL DataBase
15Klasifikasi No Sql Database
- Discussing NoSQL databases is complicated because
there are a variety of types - Column Store Each storage block contains data
from only one column - Document Store stores documents made up of
tagged elements - Key-Value Store Hash table of keys
16Klasifikasi No Sql Database
- XML Databases
- Graph Databases
- Codasyl Databases
- Object Oriented Databases
- Distributed Peer Stores
172 Garis Besar NoSql
- NoSQL solutions fall into two major areas
- Key/Value or the big hash table.
- Amazon S3 (Dynamo)
- Voldemort
- Scalaris
- Schema-less which comes in multiple flavors,
column-based, document-based or graph-based. - Cassandra (column-based)
- CouchDB (document-based)
- Neo4J (graph-based)
- HBase (column-based)
18Key/Value
- Pros
- very fast
- very scalable
- simple model
- able to distribute horizontally
- Cons
- - many data structures (objects) can't be easily
modeled as key value pairs
19Schema-Less
- Pros
- - Schema-less data model is richer than key/value
pairs - eventual consistency
- many are distributed
- still provide excellent performance and
scalability - Cons
- - typically no ACID transactions or joins
20Perbedaan Dengan Database Relasional
- Relational
- Insert data
- sql "INSERT INTO tbl SET login 'coba1',
password '0c50a2d250b30bf01aa0fabf782cb448',
email 'coba1_at_sinaryuda.web.id'"
mysql_query(sql) - No Sql (MongoDB)
- Insert data
- db.mahasiswa.save(namaFadliSaldi,NPM1810901
5',jurusanSistem Informasi,FakultasIlmu
Komputer)
21Perbedaan Dengan Database Relasional
- SQL Databases
- Predefined Schema
- Standard definition and interface language
- Tight consistency
- Well defined semantics
- NoSQL Database
- No predefined Schema
- Per-product definition and interface language
- Getting an answer quickly is more important than
getting a correct answer
22Perbedaan Dengan Database Relasional
- MySQL gt 50 GB Data
- Writes Average 300 ms
- Reads Average 350 ms
- NoSQL gt 50 GB Data
- Writes Average 0.12 ms
- Reads Average 15 ms
23Haruskah Menggunakan No SQL Database ?
- Untuk kita semua menggunakan database relasional
seperti biasanya mungkin adalah pilihan yang
paling tepat. - Sistem penyimpanan data menggunakan No Sql
database cocok untuk aplikasi yang membutuhkan
data tak terstruktur yang sangat besar,seperti - Log Analysis
- Social Networking Feeds
24Introducing MongoDB
- Open source, document-oriented database
- 10gen supports official drivers for many
platforms, but not .NET!
25Introducing MongoDB
- Documents in a MongoDB database are stored in
schema-less collections - Documents are stored in BSON (Binary JSON)
- Each item in a collection has a unique (primary)
key called an ObjectId
26MongoDB Kelebihan
- Memberikan primary key secara otomatis
- Mendukung replikasi yang berguna bagi web yang
memiliki trafik yang tinggi seperti portal
berita,forum,blog,dll. - Mendukung sharding yang digunakan pada data yang
sudah mencapai juta giga. - Mendukung model pemrograman MapReduce
27Instalasi mongodb di windows
- Download the binaries from mongodb.org
- Extract to Program Files directory (or wherever)
- Create a directory c\data\db
- Run mongod.exe from the command line with the
install switch
28Mongodb shell
- Connect to a serverport/database (defaults are
localhost27017/test )
29Mongodb shell cntd
- Insert an item into a collection
30Mongodb shell cntd
- Find items in a collection
31Mongodb shell cntd
- Update an item in a collection
32Mongodb shell cntd
- Remove an item in collection
33Web References
- NoSQL -- Your Ultimate Guide to the Non -
Relational Universe! http//nosql-database.org/l
inks.html - NoSQL (RDBMS)http//en.wikipedia.org/wiki/NoSQL
- http//www.mongodb.org