mongodb is the new mysql

21
MongoDB is the New MySQL Friday, July 23, 2010

Upload: radamanthus

Post on 05-Dec-2014

985 views

Category:

Documents


0 download

DESCRIPTION

Talk given before the July 22 Philippine Ruby Users Group meetup

TRANSCRIPT

Page 1: MongoDB is the new MySQL

MongoDB is the New MySQL

Friday, July 23, 2010

Page 2: MongoDB is the new MySQL

MongoDB is...

• a schema-less, document-oriented database

• open-source (server: GPL, drivers: Apache)

• built on C++

• supported commercially by 10gen

Friday, July 23, 2010

Page 3: MongoDB is the new MySQL

Why MongoDB?

• Fast

• Highly scalable: replication, sharding

• Open-source• runs on Windows

Friday, July 23, 2010

Page 4: MongoDB is the new MySQL

Trade-offs

Friday, July 23, 2010

Page 5: MongoDB is the new MySQL

ACID

• Atomicity - A transaction is all or nothing

• Consistency - Only valid data is written to the database

• Isolation - Pretend all transactions are happening serially and the data is correct

• Durability - What you write is what you get

Friday, July 23, 2010

Page 6: MongoDB is the new MySQL

BASE

• Basically Available - system seems to work all the time

• Soft state - it doesn’t have to be consistent all the time

• Eventually consistent - becomes consistent at some later time

Friday, July 23, 2010

Page 7: MongoDB is the new MySQL

Scal

abili

ty &

Per

form

ance

Depth of Functionality

memcached

key-value stores mongoDB

RDBMS

Friday, July 23, 2010

Page 8: MongoDB is the new MySQL

Programming

Friday, July 23, 2010

Page 9: MongoDB is the new MySQL

ActiveModel?

Friday, July 23, 2010

Page 10: MongoDB is the new MySQL

Persistence

Friday, July 23, 2010

Page 11: MongoDB is the new MySQL

Querying

Friday, July 23, 2010

Page 12: MongoDB is the new MySQL

Named Scopes!

Friday, July 23, 2010

Page 13: MongoDB is the new MySQL

Named Scopes!

Friday, July 23, 2010

Page 14: MongoDB is the new MySQL

Named Scopes!

Friday, July 23, 2010

Page 15: MongoDB is the new MySQL

Callbacksbefore_createbefore_destroybefore_savebefore_updatebefore_validationafter_createafter_destroyafter_saveafter_updateafter_validation

Friday, July 23, 2010

Page 16: MongoDB is the new MySQL

Validation

Friday, July 23, 2010

Page 17: MongoDB is the new MySQL

Administration

Friday, July 23, 2010

Page 18: MongoDB is the new MySQL

Replication

• M -> S

• M -> S*

• Replica sets [aka clusters] coming in v.1.6

Friday, July 23, 2010

Page 19: MongoDB is the new MySQL

Sharding

Friday, July 23, 2010

Page 20: MongoDB is the new MySQL

Questions?Radamanthus Batnag

[email protected]

Friday, July 23, 2010