SlideShare una empresa de Scribd logo
1 de 30
NoSQL Solutions

  Byeongweon Moon
   tasyblue@gmail.com
     2012.01.26
Redis, Couchbase, MongoDB, Membase
Memory Base Cache vs.
       Database
NoSQL
• Collections (versus tables)
• Documents (versus rows)
• Loosely defined fields (versus
  columns)
• Scale out (versus scale up)
• Denormalization (versus
  normalization)
Data Model
•   Relational
•   Key-value
•   Column-oriented
•   Document-oriented
Relational
Key-value
Column-oriented
Document-oriented

    FirstName="Jonathan",
    Address="15 Wanamassa Point
    Road",
K   Children=[
E        {Name:"Michael",Age:10},
Y        {Name:"Jennifer", Age:8},
         {Name:"Samantha", Age:5},
         {Name:"Elena", Age:2}
         ]
Memory Base Cache
•   Weak Persistence
•   Weak Consistency
•   Strong Performance
•   Low Latency
Membase
• Based on Memcached
• Written by C++(Memcached),
  Erlang(Membase)
• Distributed, in-memory key-value
  database management system
• Optimized for storing data behind
  web applications
Membase (cont’)
• Persistence
  – Asynchronously writes data to disk after
    acknowledging write to client
  – Guarantees data consistency
• Replication and failover (server
  failures recoverable in under 100ms)
• Scalability and performance
  –   Distributed object store
  –   Dynamic cluster resizing and rebalancing
  –   Guaranteed data consistency
  –   High sustained throughput
  –   Low, predictable latency
Redis
• In-memory, key-value data store
• Written by ANSI C, support various
  client
Redis (cont’)
• Various Data Models
  – List, Set, Sorted Set, Hash
  – Support atomic operation about data types
• Persistence
  – Data is held in memory but written to disk
   asynchronously
• Replication
  – Master-Slave replication
• Performance
  – Non-blocking I/O. Single threaded
• Publish/Subscribe
Membase vs. Redis
         Membase               Redis
String                 Set, List, Sorted List,
                       Hash..

Master-Master          Master-Slave
Storing, inc/dec API   Various operations
                       includes pop, push,
                       extract …

Web management UI      Console management
                       tool
How to use…
• Normally use …

$key = md5('SELECT * FROM rest_of_sql_statement_goes_here');
if ($memcache->get($key)) {
 return $memcache->get($key);
}
else {
 $result = $query_results_mangled_into_most_likely_an_array
 $memcache->set($key, $result, TRUE, 86400);
 return $result;
}
How to use … (cont’)
• Structured Data (array, struct…)
  – Serialize
       KEY                     VALUE

  user:$user_id        name:문병원|call:하겐다즈|…



  – Normalization
          KEY                    VALUE
  user:$user_id:name             문병원

  user:$user_id:call            하겐다즈
Application Design using
            Membase
• Cache result other than SQL data!
• Use a cache hierarchy
• Update membase as your data
  updates
• Race conditions and stale data
• Pre warm your cache
• Storing lists with keys
• Batch your requests with get_multi
                          From memcached FAQ
Database
•   Persistence
•   Reliable
•   Scalable
•   Distributed
•   Clustered
MongoDB
•   Document-oriented Storage
•   High Write Performance
•   Full index support
•   Master/Slave Replication
•   Support Map/Reduce
•   Auto-Sharding
•   Querying
•   GridFS
•   Written in C++
CouchDB
• Document-oriented Storage
• High Read Performance
• ACID Semantics
• Map/Reduce View and Indexes
• Distributed Architecture with
  Replication
• REST API
• Eventual Consistency
• Written in Erlang
CASE STUDY
Twitter
Facebook Timeline
APPENDIX
CouchDB              MongoDB            MySQL
              Document-Oriented (JS Document-Oriented
Data Model                                              Relational
              ON)                   (BSON)
                                    string, int, doubl
              string, number, boole e, boolean, date, Various Types L
Data Types
              an, array, object     byte array, object ink
                                    , array, others
Large Object
             Yes (attachments)       Yes (GridFS)       BlobZ
s (Files)
Horizontal p
artitioning CouchDB Lounge           Auto-sharding      Partitioning
scheme
                                                       Master-slave, m
              Master-master (with d
                                    Master-slave and r ulti-master, an
Replication   eveloper supplied con
                                    eplica sets        d circular repl
              flict resolution)
                                                       ication

Object(row)
              One large repository   Collection-based   Table-based
Storage
Map/reduce of ja
                    vascript functio Dynamic; object-
Query Method        ns to lazily bui based query lang Dynamic; SQL
                    ld an index per uage
                    query
Secondary Indexes   Yes                Yes                Yes
Atomicity           Single document    Single document    Yes - advanced
                                       Native drivers ;
Interface           REST                                Native drivers
                                       REST add-on
                                       Map/Reduce, serv
Server-side batch d
                    Map/Reduce         er-side javascri Yes (SQL)
ata manipulation
                                       pt
Written in          Erlang             C++                C++
                    Eventually consi   Strong consisten   Strong consiste
                    stent (master-ma   cy. Eventually     ncy. Eventuall
Distributed Consist ster replication   consistent reads   y consistent re
ency Model          with versioning    from secondaries   ads from second
                    and version reco   are available.     aries are avail
                    nciliation)                           able.
References
•   NoSQL solutions: Membase, Redis, CouchDB and MongoDB :
    http://blog.fedecarg.com/2011/01/25/nosql-solutions-membase-redis-
    couchdb-and-mongodb/
•   Visual Guide to NoSQL Systems : http://blog.nahurst.com/visual-guide-to-
    nosql-systems
•   MongoDB, CouchDB, MySQL Compare Grid :
    http://www.mongodb.org/display/DOCS/MongoDB,+CouchDB,+MySQL+Compare+Grid
•   SQL to Mongo Mapping Chart :
    http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart
•   Memcached FAQ :
    http://code.google.com/p/memcached/wiki/FAQ#Simple_query_result_caching
•   Couchbase 2.0 Manual : http://docs.couchbase.org/couchbase-manual-2.0.pdf
•   Building Timeline : Facebook http://www.facebook.com/notes/facebook-
    engineering/building-timeline-scaling-up-to-hold-your-life-
    story/10150468255628920

Más contenido relacionado

La actualidad más candente

HBase: Just the Basics
HBase: Just the BasicsHBase: Just the Basics
HBase: Just the BasicsHBaseCon
 
Millions of Regions in HBase: Size Matters
Millions of Regions in HBase: Size MattersMillions of Regions in HBase: Size Matters
Millions of Regions in HBase: Size MattersDataWorks Summit
 
HBase for Architects
HBase for ArchitectsHBase for Architects
HBase for ArchitectsNick Dimiduk
 
HBaseCon 2012 | Content Addressable Storages for Fun and Profit - Berk Demir,...
HBaseCon 2012 | Content Addressable Storages for Fun and Profit - Berk Demir,...HBaseCon 2012 | Content Addressable Storages for Fun and Profit - Berk Demir,...
HBaseCon 2012 | Content Addressable Storages for Fun and Profit - Berk Demir,...Cloudera, Inc.
 
HBase Advanced Schema Design - Berlin Buzzwords - June 2012
HBase Advanced Schema Design - Berlin Buzzwords - June 2012HBase Advanced Schema Design - Berlin Buzzwords - June 2012
HBase Advanced Schema Design - Berlin Buzzwords - June 2012larsgeorge
 
Evaluating NoSQL Performance: Time for Benchmarking
Evaluating NoSQL Performance: Time for BenchmarkingEvaluating NoSQL Performance: Time for Benchmarking
Evaluating NoSQL Performance: Time for BenchmarkingSergey Bushik
 
Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)
Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)
Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)Gruter
 
Couchbase Performance Benchmarking
Couchbase Performance BenchmarkingCouchbase Performance Benchmarking
Couchbase Performance BenchmarkingRenat Khasanshyn
 
Migrating to postgresql
Migrating to postgresqlMigrating to postgresql
Migrating to postgresqlbotsplash.com
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Tim Lossen
 
Sept 17 2013 - THUG - HBase a Technical Introduction
Sept 17 2013 - THUG - HBase a Technical IntroductionSept 17 2013 - THUG - HBase a Technical Introduction
Sept 17 2013 - THUG - HBase a Technical IntroductionAdam Muise
 
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLTen Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLanandology
 
Ceph and RocksDB
Ceph and RocksDBCeph and RocksDB
Ceph and RocksDBSage Weil
 
Some key value stores using log-structure
Some key value stores using log-structureSome key value stores using log-structure
Some key value stores using log-structureZhichao Liang
 
Microsoft azure database offerings
Microsoft azure database offeringsMicrosoft azure database offerings
Microsoft azure database offeringsGuruprasad Vijayarao
 
What's New Tajo 0.10 and Its Beyond
What's New Tajo 0.10 and Its BeyondWhat's New Tajo 0.10 and Its Beyond
What's New Tajo 0.10 and Its BeyondGruter
 
Hadoop and Cassandra at Rackspace
Hadoop and Cassandra at RackspaceHadoop and Cassandra at Rackspace
Hadoop and Cassandra at RackspaceStu Hood
 

La actualidad más candente (20)

HBase: Just the Basics
HBase: Just the BasicsHBase: Just the Basics
HBase: Just the Basics
 
Millions of Regions in HBase: Size Matters
Millions of Regions in HBase: Size MattersMillions of Regions in HBase: Size Matters
Millions of Regions in HBase: Size Matters
 
HBase for Architects
HBase for ArchitectsHBase for Architects
HBase for Architects
 
HBaseCon 2012 | Content Addressable Storages for Fun and Profit - Berk Demir,...
HBaseCon 2012 | Content Addressable Storages for Fun and Profit - Berk Demir,...HBaseCon 2012 | Content Addressable Storages for Fun and Profit - Berk Demir,...
HBaseCon 2012 | Content Addressable Storages for Fun and Profit - Berk Demir,...
 
HBase Advanced Schema Design - Berlin Buzzwords - June 2012
HBase Advanced Schema Design - Berlin Buzzwords - June 2012HBase Advanced Schema Design - Berlin Buzzwords - June 2012
HBase Advanced Schema Design - Berlin Buzzwords - June 2012
 
Apache hadoop hbase
Apache hadoop hbaseApache hadoop hbase
Apache hadoop hbase
 
Evaluating NoSQL Performance: Time for Benchmarking
Evaluating NoSQL Performance: Time for BenchmarkingEvaluating NoSQL Performance: Time for Benchmarking
Evaluating NoSQL Performance: Time for Benchmarking
 
Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)
Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)
Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)
 
Couchbase Performance Benchmarking
Couchbase Performance BenchmarkingCouchbase Performance Benchmarking
Couchbase Performance Benchmarking
 
Migrating to postgresql
Migrating to postgresqlMigrating to postgresql
Migrating to postgresql
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?
 
Sept 17 2013 - THUG - HBase a Technical Introduction
Sept 17 2013 - THUG - HBase a Technical IntroductionSept 17 2013 - THUG - HBase a Technical Introduction
Sept 17 2013 - THUG - HBase a Technical Introduction
 
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLTen Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
 
Ceph and RocksDB
Ceph and RocksDBCeph and RocksDB
Ceph and RocksDB
 
Some key value stores using log-structure
Some key value stores using log-structureSome key value stores using log-structure
Some key value stores using log-structure
 
Apache HBase™
Apache HBase™Apache HBase™
Apache HBase™
 
Microsoft azure database offerings
Microsoft azure database offeringsMicrosoft azure database offerings
Microsoft azure database offerings
 
In-memory database
In-memory databaseIn-memory database
In-memory database
 
What's New Tajo 0.10 and Its Beyond
What's New Tajo 0.10 and Its BeyondWhat's New Tajo 0.10 and Its Beyond
What's New Tajo 0.10 and Its Beyond
 
Hadoop and Cassandra at Rackspace
Hadoop and Cassandra at RackspaceHadoop and Cassandra at Rackspace
Hadoop and Cassandra at Rackspace
 

Similar a No sql solutions - 공개용

Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataRoger Xia
 
Scaling data on public clouds
Scaling data on public cloudsScaling data on public clouds
Scaling data on public cloudsLiran Zelkha
 
Navigating NoSQL in cloudy skies
Navigating NoSQL in cloudy skiesNavigating NoSQL in cloudy skies
Navigating NoSQL in cloudy skiesshnkr_rmchndrn
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Javasunnygleason
 
NoSQL: Why, When, and How
NoSQL: Why, When, and HowNoSQL: Why, When, and How
NoSQL: Why, When, and HowBigBlueHat
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBJustin Smestad
 
DynamoDB Gluecon 2012
DynamoDB Gluecon 2012DynamoDB Gluecon 2012
DynamoDB Gluecon 2012Appirio
 
Gluecon 2012 - DynamoDB
Gluecon 2012 - DynamoDBGluecon 2012 - DynamoDB
Gluecon 2012 - DynamoDBJeff Douglas
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Chris Richardson
 
Large Scale Machine Learning with Apache Spark
Large Scale Machine Learning with Apache SparkLarge Scale Machine Learning with Apache Spark
Large Scale Machine Learning with Apache SparkCloudera, Inc.
 
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...Felix Gessert
 
No SQL - A Simple Intro
No SQL - A Simple IntroNo SQL - A Simple Intro
No SQL - A Simple IntroKarthi Keyan
 
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL ServicesAmazon Web Services
 

Similar a No sql solutions - 공개용 (20)

Nosql seminar
Nosql seminarNosql seminar
Nosql seminar
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
Scaling data on public clouds
Scaling data on public cloudsScaling data on public clouds
Scaling data on public clouds
 
Navigating NoSQL in cloudy skies
Navigating NoSQL in cloudy skiesNavigating NoSQL in cloudy skies
Navigating NoSQL in cloudy skies
 
Intro to RavenDB
Intro to RavenDBIntro to RavenDB
Intro to RavenDB
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
 
NoSQL
NoSQLNoSQL
NoSQL
 
Drop acid
Drop acidDrop acid
Drop acid
 
NoSQL: Why, When, and How
NoSQL: Why, When, and HowNoSQL: Why, When, and How
NoSQL: Why, When, and How
 
NoSQL
NoSQLNoSQL
NoSQL
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
DynamoDB Gluecon 2012
DynamoDB Gluecon 2012DynamoDB Gluecon 2012
DynamoDB Gluecon 2012
 
Gluecon 2012 - DynamoDB
Gluecon 2012 - DynamoDBGluecon 2012 - DynamoDB
Gluecon 2012 - DynamoDB
 
Mongodb lab
Mongodb labMongodb lab
Mongodb lab
 
מיכאל
מיכאלמיכאל
מיכאל
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
Large Scale Machine Learning with Apache Spark
Large Scale Machine Learning with Apache SparkLarge Scale Machine Learning with Apache Spark
Large Scale Machine Learning with Apache Spark
 
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
 
No SQL - A Simple Intro
No SQL - A Simple IntroNo SQL - A Simple Intro
No SQL - A Simple Intro
 
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services
 

Más de Byeongweon Moon

실시간 인벤트 처리
실시간 인벤트 처리실시간 인벤트 처리
실시간 인벤트 처리Byeongweon Moon
 
3GPP UICC Spec. differences
3GPP UICC Spec. differences3GPP UICC Spec. differences
3GPP UICC Spec. differencesByeongweon Moon
 
USAT : USIM Application Toolkit
USAT : USIM Application ToolkitUSAT : USIM Application Toolkit
USAT : USIM Application ToolkitByeongweon Moon
 
공개SW공모대전 2009 기술캠프 강의자료
공개SW공모대전 2009 기술캠프 강의자료공개SW공모대전 2009 기술캠프 강의자료
공개SW공모대전 2009 기술캠프 강의자료Byeongweon Moon
 
미스터리쇼핑 발표
미스터리쇼핑 발표미스터리쇼핑 발표
미스터리쇼핑 발표Byeongweon Moon
 
Google Summer Of Code 2008
Google Summer Of Code 2008Google Summer Of Code 2008
Google Summer Of Code 2008Byeongweon Moon
 
한양대 문병원 최종
한양대 문병원 최종한양대 문병원 최종
한양대 문병원 최종Byeongweon Moon
 

Más de Byeongweon Moon (11)

Introduction to HBase
Introduction to HBaseIntroduction to HBase
Introduction to HBase
 
Redis
RedisRedis
Redis
 
실시간 인벤트 처리
실시간 인벤트 처리실시간 인벤트 처리
실시간 인벤트 처리
 
Refactoring Seminar
Refactoring SeminarRefactoring Seminar
Refactoring Seminar
 
SIM Initialization
SIM InitializationSIM Initialization
SIM Initialization
 
3GPP UICC Spec. differences
3GPP UICC Spec. differences3GPP UICC Spec. differences
3GPP UICC Spec. differences
 
USAT : USIM Application Toolkit
USAT : USIM Application ToolkitUSAT : USIM Application Toolkit
USAT : USIM Application Toolkit
 
공개SW공모대전 2009 기술캠프 강의자료
공개SW공모대전 2009 기술캠프 강의자료공개SW공모대전 2009 기술캠프 강의자료
공개SW공모대전 2009 기술캠프 강의자료
 
미스터리쇼핑 발표
미스터리쇼핑 발표미스터리쇼핑 발표
미스터리쇼핑 발표
 
Google Summer Of Code 2008
Google Summer Of Code 2008Google Summer Of Code 2008
Google Summer Of Code 2008
 
한양대 문병원 최종
한양대 문병원 최종한양대 문병원 최종
한양대 문병원 최종
 

No sql solutions - 공개용

  • 1. NoSQL Solutions Byeongweon Moon tasyblue@gmail.com 2012.01.26
  • 3. Memory Base Cache vs. Database
  • 4.
  • 5. NoSQL • Collections (versus tables) • Documents (versus rows) • Loosely defined fields (versus columns) • Scale out (versus scale up) • Denormalization (versus normalization)
  • 6. Data Model • Relational • Key-value • Column-oriented • Document-oriented
  • 10. Document-oriented FirstName="Jonathan", Address="15 Wanamassa Point Road", K Children=[ E {Name:"Michael",Age:10}, Y {Name:"Jennifer", Age:8}, {Name:"Samantha", Age:5}, {Name:"Elena", Age:2} ]
  • 11. Memory Base Cache • Weak Persistence • Weak Consistency • Strong Performance • Low Latency
  • 12. Membase • Based on Memcached • Written by C++(Memcached), Erlang(Membase) • Distributed, in-memory key-value database management system • Optimized for storing data behind web applications
  • 13. Membase (cont’) • Persistence – Asynchronously writes data to disk after acknowledging write to client – Guarantees data consistency • Replication and failover (server failures recoverable in under 100ms) • Scalability and performance – Distributed object store – Dynamic cluster resizing and rebalancing – Guaranteed data consistency – High sustained throughput – Low, predictable latency
  • 14. Redis • In-memory, key-value data store • Written by ANSI C, support various client
  • 15. Redis (cont’) • Various Data Models – List, Set, Sorted Set, Hash – Support atomic operation about data types • Persistence – Data is held in memory but written to disk asynchronously • Replication – Master-Slave replication • Performance – Non-blocking I/O. Single threaded • Publish/Subscribe
  • 16. Membase vs. Redis Membase Redis String Set, List, Sorted List, Hash.. Master-Master Master-Slave Storing, inc/dec API Various operations includes pop, push, extract … Web management UI Console management tool
  • 17. How to use… • Normally use … $key = md5('SELECT * FROM rest_of_sql_statement_goes_here'); if ($memcache->get($key)) { return $memcache->get($key); } else { $result = $query_results_mangled_into_most_likely_an_array $memcache->set($key, $result, TRUE, 86400); return $result; }
  • 18. How to use … (cont’) • Structured Data (array, struct…) – Serialize KEY VALUE user:$user_id name:문병원|call:하겐다즈|… – Normalization KEY VALUE user:$user_id:name 문병원 user:$user_id:call 하겐다즈
  • 19. Application Design using Membase • Cache result other than SQL data! • Use a cache hierarchy • Update membase as your data updates • Race conditions and stale data • Pre warm your cache • Storing lists with keys • Batch your requests with get_multi From memcached FAQ
  • 20. Database • Persistence • Reliable • Scalable • Distributed • Clustered
  • 21. MongoDB • Document-oriented Storage • High Write Performance • Full index support • Master/Slave Replication • Support Map/Reduce • Auto-Sharding • Querying • GridFS • Written in C++
  • 22. CouchDB • Document-oriented Storage • High Read Performance • ACID Semantics • Map/Reduce View and Indexes • Distributed Architecture with Replication • REST API • Eventual Consistency • Written in Erlang
  • 27.
  • 28. CouchDB MongoDB MySQL Document-Oriented (JS Document-Oriented Data Model Relational ON) (BSON) string, int, doubl string, number, boole e, boolean, date, Various Types L Data Types an, array, object byte array, object ink , array, others Large Object Yes (attachments) Yes (GridFS) BlobZ s (Files) Horizontal p artitioning CouchDB Lounge Auto-sharding Partitioning scheme Master-slave, m Master-master (with d Master-slave and r ulti-master, an Replication eveloper supplied con eplica sets d circular repl flict resolution) ication Object(row) One large repository Collection-based Table-based Storage
  • 29. Map/reduce of ja vascript functio Dynamic; object- Query Method ns to lazily bui based query lang Dynamic; SQL ld an index per uage query Secondary Indexes Yes Yes Yes Atomicity Single document Single document Yes - advanced Native drivers ; Interface REST Native drivers REST add-on Map/Reduce, serv Server-side batch d Map/Reduce er-side javascri Yes (SQL) ata manipulation pt Written in Erlang C++ C++ Eventually consi Strong consisten Strong consiste stent (master-ma cy. Eventually ncy. Eventuall Distributed Consist ster replication consistent reads y consistent re ency Model with versioning from secondaries ads from second and version reco are available. aries are avail nciliation) able.
  • 30. References • NoSQL solutions: Membase, Redis, CouchDB and MongoDB : http://blog.fedecarg.com/2011/01/25/nosql-solutions-membase-redis- couchdb-and-mongodb/ • Visual Guide to NoSQL Systems : http://blog.nahurst.com/visual-guide-to- nosql-systems • MongoDB, CouchDB, MySQL Compare Grid : http://www.mongodb.org/display/DOCS/MongoDB,+CouchDB,+MySQL+Compare+Grid • SQL to Mongo Mapping Chart : http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart • Memcached FAQ : http://code.google.com/p/memcached/wiki/FAQ#Simple_query_result_caching • Couchbase 2.0 Manual : http://docs.couchbase.org/couchbase-manual-2.0.pdf • Building Timeline : Facebook http://www.facebook.com/notes/facebook- engineering/building-timeline-scaling-up-to-hold-your-life- story/10150468255628920