SlideShare a Scribd company logo
1 of 105
Download to read offline
Who am I ?

                                -> My Name: João Cerdeira
                                -> Team Leader
                                -> An Agile enthusiast:
                                     Scrum / Kanban / Lean
                                -> A true believer in
                                OpenSource

http://twitter.com/jacerdeira              cerdeira@gmail.com
Disclamer

-> I understand your questions, but
sometimes I don't have answers

-> I'm not a NoSQL Dogmatic, just an
enthusiast about the new
ways of storing information

-> I have worked with
RDBMS for 12 years
Everyone has their
   preferences
I don't care if I/you will
 use SQL or NoSQL. I
 just want to deliver
         better
Services/Aplications to
   the clients/users.
Concepts & Theory
Scale up vs Scale Down
Performance VS Scalability


 Latency VS Throughput


Availability VS Consistency
Brewer's



CAP
Theorem
Choose only 2:



         C onsistency
         A vailability
         P artition      Tolerance

At a given time in certain enviroment
Consistency




                MS
                 B
              RD
                           Availability

                N
                 oS
                   Q
                       L
    Partition
   Tolerance
Centralized System

In a centralized system (RDBMS) we
don't have network partition
        P    in CAP


So we get:
        A vailability
        C onsistency
-> A tomicity
-> C onsistency
-> I solated
-> D urability
Distr ibuted System

In a distr ibuted system we (might) have
network partition
        P   in CAP


So you can only pick one:
        A vailability
        C onsistency
CAP in practice

We have only two types of Systems
      CP == CA (very similar)
      AP


So in a network partition we have only
one choice
      C onsistency
      A vailability
-> B asically A vailable
-> S oft   state

-> E ventually     consistent
Eventual Consistency
How to
Scale Out
RDBMS ?
http://capellaniaprimaria.blogspot.com/2011/02/concurso-deportivo-4-pregunta.html
Partition
Partition + Replication
ORM Problems
ORM Problems

What you want ?

Find/read a record/object
ORM Problems

What you want ?

Find/read a record/object



What you get ?

A huge underground complexity
Let Validate
our Thoughts
Let Validate
           our Thoughts

Do we need ACID for all solutions?
Let Validate
           our Thoughts

Do we need ACID for all solutions?


When is Eventually Consistent enough ?
Let Validate
           our Thoughts

Do we need ACID for all solutions?


When is Eventually Consistent enough ?


Different solutions require different needs
Why NoSQL Appears ?

Because New Dr ivers
         Appears

  (business or technical demand)
New Dr ivers Behind NoSQL


        Large amount of data
        Commodity hardware
         Scale Fast And Cheap
  Constantly changing request (data)
Why RDBMS aren't good
      enough ?
Why RDBMS aren't good
          enough ?

Scalling reads in a RDBMS is hard
Why RDBMS aren't good
          enough ?

Scalling reads in a RDBMS is hard



  Scalling wr ites is impossible
Think again

Do we really need a RDBMS ?
Think again

Do we really need a RDBMS ?



   Sometimes !
Think again

  Do we really need a RDBMS ?



     Sometimes !
But a lot of times we
          don't !
NoSQL
How did NoSQL start ?

      Google: Bigtable
     Amazon: Dynamo
    Facebook: Cassandra
    LinkedIn: Valdemort
   Yahoo: HBase (hadoop)
Or igins
 Google : “How can we build a DB on top of Google File
                       System”


   Paper: Bigtable → A distributed store system for
                structured data, 2006


Amazon: “How can we build a distributed hash table for
                   the data center”


Paper : Dynamo → Amazon's highly available key-value
                        store
Different Types of NoSQL


      Key-Value Stores

     Document Databases

      Column Databases

      Graph Databases
Key-Value Stores

Or igin: Amazon's Dynamo paper
Data model: Collections of KV pairs
Implementations: Dynamo, Voldemort, Membase,
                     Riak, Redis
Good For:
        - Large amount of data
        - Scale writes and reads
        - Fast
        - Programmer friendly
Document Databases

Or igin: Lotus Notes
Data model: Collections of Documents
Implementations: CouchDB, MongoDB,
                       Amazon SimpleDB
Good For:
        - Human Data Structure
        - Programmer friendly
        - Rapid Development
        - Web friendly
        - CRUD
Column Databases

Or igin: Google's BigTable Paper
Data model: Column family – each row (at least in
              theory) can have different configuration
Implementations: BigTable, HBase, Cassandra
Good For:
        - Large amount of data
        - scale writes like no other
        - High availability
Graph Databases

Or igin: Graph Theory
Data model: Nodes and Relations,
                 both can have KV pairs
Implementations: Neo4j, FlockDB
Good For:
        - resolve graph problems
        - Fast
Why I'd choose CouchDB ?

 -> Easy to understand documents
 -> Use standards web technologies
 -> Simple to install and configure
 -> Small footprint     (works on mobile platforms)

 -> Scales well   (not for huge amount of data)

 -> Replication in the core
CouchDB Main Pr incipals

   Document Oriented Database


       No rows or columns


   Collection of JSON Documents


           Schema-Free
In CouchDB HTTP Rules

-> Everything is a HTTP Request
-> We are used to know GET and POST
-> But there are others:
     -> PUT
     -> DELETE
     -> COPY


     RESTful HTTP API
Why JSON ?

-> Light and text-based data format
-> Simple to parse
-> Not verbose   (comparing to xml)

-> Suitable for javascript frameworks   (jquery)

-> Parsers available in almost all
  programming languages
JSON Example
{
    make: "Ford",
    model: "Mustang",
    year: 2009,
    body: "Coupe",
    color: "Red",
    engine: {
         gas_type: "Petrol",
         cubic_capacity: 4600
    },
    previous_owners: [
         {
                name: "John Smith",
                mileage: 1000
         },
         {
                name: "Jane Hunt",
                mileage: 2500
         }
    ]
}
JSON Example
{
    make: "Ford",
    model: "Mustang",
    year: 2009,
    body: "Coupe",
    color: "Red",
    engine: {
         gas_type: "Petrol",
         cubic_capacity: 4600
    },
    previous_owners: [
         {
                name: "John Smith",
                mileage: 1000
         },
         {
                name: "Jane Hunt",
                mileage: 2500
         }
    ]
}
JSON Example
{
    make: "Ford",
    model: "Mustang",
    year: 2009,
    body: "Coupe",
    color: "Red",
    engine: {
         gas_type: "Petrol",
         cubic_capacity: 4600
    },
    previous_owners: [
         {
                name: "John Smith",
                mileage: 1000
         },
         {
                name: "Jane Hunt",
                mileage: 2500
         }
    ]
}
JSON Example
{
    make: "Ford",
    model: "Mustang",
    year: 2009,
    body: "Coupe",
    color: "Red",
    engine: {
         gas_type: "Petrol",
         cubic_capacity: 4600
    },
    previous_owners: [
         {
                name: "John Smith",
                mileage: 1000
         },
         {
                name: "Jane Hunt",
                mileage: 2500
         }
    ]
}
Example
Create / Delete Database

  $ curl http://127.0.0.1:5984

  {"couchdb":"Welcome","version":"1.0.1"}

  $ curl -X PUT http://127.0.0.1:5984/contacts

  {"ok":true}

  $ curl -X GET http://127.0.0.1:5984/_all_dbs

  ["contacts","_users"]

  $ curl -X DELETE http://127.0.0.1:5984/contacts

  {"ok":true}
Manage Documents

$ curl -X PUT http://127.0.0.1:5984/contacts/joaocerdeira -d '{}'

{"ok":true,"id":"joaocerdeira","rev":"1-
967a00dff5e02add41819138abb3284d"}

$ curl -X GET http://127.0.0.1:5984/contacts/joaocerdeira

{"_id":"joaocerdeira","_rev":"1-
967a00dff5e02add41819138abb3284d"}


$ curl -X DELETE http://127.0.0.1:5984/contacts/joaocerdeira?rev=1-
967a00dff5e02add41819138abb3284d

{"ok":true,"id":"joaocerdeira","rev":"2-
eec205a9d413992850a6e32678485900"}
Manage Documents

$ curl -X PUT http://127.0.0.1:5984/contacts/joaocerdeira -d
'{"firstName":"Joao","lastName":"Cerdeira","email":"
cerdeira@gmail.com"}'

{"ok":true,"id":"joaocerdeira","rev":"1-
186fe12b748c40559e8f234d8e566c18"}


$ curl -X GET http://127.0.0.1:5984/contacts/joaocerdeira

{"_id":"joaocerdeira","_rev":"1-
186fe12b748c40559e8f234d8e566c18","firstName":"Joao","lastNam
e":"Cerdeira","email":"cerdeira@gmail.com"}
Copy Documents

$ curl -X COPY http://127.0.0.1:5984/contacts/joaocerdeira -H
"Destination: batatinha"

{"id":"batatinha","rev":"1-186fe12b748c40559e8f234d8e566c18"}



$ curl -X GET http://127.0.0.1:5984/contacts/batatinha

{"_id":"batatinha","_rev":"1-
186fe12b748c40559e8f234d8e566c18","firstName":"Joao","lastNam
e":"Cerdeira","email":"cerdeira@gmail.com"}
Changing Documents
$ curl -X PUT http://127.0.0.1:5984/contacts/batatinha -d '{"_rev":"1-
186fe12b748c40559e8f234d8e566c18","firstName":"Clown","lastNa
me":"Batatinha","email":["batatinha@bataton.pt
","batatinha@first.to.exit@rtp.pt"], "phone":"93 1234567"}'

{"ok":true,"id":"batatinha","rev":"2-
b7079a6d71179b1571652059355d84c3"}



$ curl -X GET http://127.0.0.1:5984/contacts/batatinha

{"_id":"batatinha","_rev":"2-
b7079a6d71179b1571652059355d84c3","firstName":"Clown","lastNa
me":"Batatinha","email":["batatinha@bataton.pt
","batatinha@first.to.exit@rtp.pt"], "phone":"93 1234567"}
MVCC




  CouchDB never blocks


Append Mode Only
Designing Documents
 {
     "_id":"joaocerdeira",
     "_rev":"1-186fe12b748c40559e8f234d8e566c18",

     “doctype”:”contact”

     "firstName":"Joao",
     "lastName":"Cerdeira",
     “company”:”MULTICERT”

     "emails":[
            {
                  “type”:”personal”,
                  “email”:"cerdeira@gmail.com“
            },
            {
                  “type”:”business”,
                  “email”:"joao.cerdeira@multicert.com“
           }
     ],
     “phones”:[
           {
                  “type”:”personal”,
                  “phone”:"93 1234567“
            },
            {
                  “type”:”business”,
                  “phone”:"93 7654321“
            }
     ]
 }
Designing Documents
 {
     "_id":"joaocerdeira",
     "_rev":"1-186fe12b748c40559e8f234d8e566c18",

     “doctype”:”contact”

     "firstName":"Joao",
     "lastName":"Cerdeira",
     “company”:”MULTICERT”

     "emails":[
            {
                  “type”:”personal”,
                  “email”:"cerdeira@gmail.com“
            },
            {
                  “type”:”business”,
                  “email”:"joao.cerdeira@multicert.com“
           }
     ],
     “phones”:[
           {
                  “type”:”personal”,
                  “phone”:"93 1234567“
            },
            {
                  “type”:”business”,
                  “phone”:"93 7654321“
            }
     ]
 }
Designing Documents
 {
     "_id":"joaocerdeira",
     "_rev":"1-186fe12b748c40559e8f234d8e566c18",

     “doctype”:”contact”

     "firstName":"Joao",
     "lastName":"Cerdeira",
     “company”:”MULTICERT”

     "emails":[
            {
                  “type”:”personal”,
                  “email”:"cerdeira@gmail.com“
            },
            {
                  “type”:”business”,
                  “email”:"joao.cerdeira@multicert.com“
           }
     ],
     “phones”:[
           {
                  “type”:”personal”,
                  “phone”:"93 1234567“
            },
            {
                  “type”:”business”,
                  “phone”:"93 7654321“
            }
     ]
 }
Designing Documents
 {
     "_id":"joaocerdeira",
     "_rev":"1-186fe12b748c40559e8f234d8e566c18",

     “doctype”:”contact”

     "firstName":"Joao",
     "lastName":"Cerdeira",
     “company”:”MULTICERT”

     "emails":[
            {
                  “type”:”personal”,
                  “email”:"cerdeira@gmail.com“
            },
            {
                  “type”:”business”,
                  “email”:"joao.cerdeira@multicert.com“
           }
     ],
     “phones”:[
           {
                  “type”:”personal”,
                  “phone”:"93 1234567“
            },
            {
                  “type”:”business”,
                  “phone”:"93 7654321“
            }
     ]
 }
Futon Web Interface
Views
Quer ing CouchDB

       Quer ies in JavaScr ipt


    Use Map/Reduce for quer ing


For simple quer ies Map/Reduce isn't
             needed


  Don't have joins   (but you can have similar)
Simple Views
  List All Documents
function(doc){
    emit(doc._id,doc);
}


  List All Documents
        Of type 'vip'
function(doc){
    If (doc.type=='vip'){
         emit(doc._id,doc);
    }
}
Temp Views
$ curl -X POST -H "Content-type: application/json"
http://127.0.0.1:5984/contacts/_temp_view -d '{"map":"function(doc)
{emit(doc._id,doc);}"}'


{"total_rows":2,"offset":0,"rows":[

{"id":"batatinha","key":"batatinha","value":{"_id":"batatinha","_rev":"2-
b7079a6d71179b1571652059355d84c3","firstName":"Palhaco","lastName
":"Batatinha","email":
["batatinha@bataton.pt","batatinha@first.to.exit@rtp.pt"],"phone":"93
1234567"}},
{"id":"joaocerdeira","key":"joaocerdeira","value":
{"_id":"joaocerdeira","_rev":"1-
186fe12b748c40559e8f234d8e566c18","firstName":"Joao","lastName":"C
erdeira","email":"cerdeira@gmail.com","_deleted_conflicts":["2-
eec205a9d413992850a6e32678485900"]}}
Normal Views

      {
          "_id" : "_design/example",
          "views" : {
               "foo" : {
                     "map":"function(doc){emit(doc._id,doc);}"
               }
          }
      }



$ curl -X PUT -H "Content-type: application/json"
http://127.0.0.1:5984/contacts/_design/example -d @design_simple1.json
Normal Views

$ curl -X GET http://127.0.0.1:5984/contacts/_design/example/_view/foo

{"total_rows":2,"offset":0,"rows":[

{"id":"batatinha","key":"batatinha","value":{"_id":"batatinha","_rev":"2-
b7079a6d71179b1571652059355d84c3","firstName":"Palhaco","lastName"
:"Batatinha","email":
["batatinha@bataton.pt","batatinha@primeiro.a.sair@rtp.pt"],"phone":"93
1234567"}},
{"id":"joaocerdeira","key":"joaocerdeira","value":
{"_id":"joaocerdeira","_rev":"1-
186fe12b748c40559e8f234d8e566c18","firstName":"Jou00e3o","lastNam
e":"Cerdeira","email":"cerdeira@gmail.com","_deleted_conflicts":["2-
eec205a9d413992850a6e32678485900"]}}
]}
Map/Reduce
Google patent from the paper: http://labs.google.com/papers/mapreduce.html




                     image source: http://map-reduce.wikispaces.asu.edu/
Map/Reduce Views

{"_id" : "_design/example",
     "views" : {
     …...................................
           "bar" : {
                  "map":"function(doc){emit(doc,1);}",
                  "reduce":"function(keys, values, rereduce) {
                                          return sum(values);}"
     }}}


$ curl -X GET http://127.0.0.1:5984/contacts/_design/example/_view/bar

{"rows":[
{"key":null,"value":7}
]}
Map/Reduce Views
{"_id" : "_design/example",
     "views" : {
     …...................................
            ""aggreg" : {
                "map":"function(doc){if(doc.country){emit(doc.country,1);}}",
                "reduce":"function(keys, values, rereduce) {return sum(values);}"
          }


$ curl -X GET
http://127.0.0.1:5984/contacts/_design/example/_view/aggreg?group=true

{"rows":[
{"key":"England","value":1},
{"key":"Portugal","value":2},
{"key":"US","value":2}
]}
Replication
Wr ite




Read
Wr ite




Read            Read
Wr ite



                Read




         Read      Read
One Time Replication
$ curl -H "Content-type: application/json
 -X POST http://127.0.0.1:5984/_replicate
-d '{"source":"contacts","target":"contacts-replica"}'

{"ok":true,
     "session_id":"00872a440fdda973d6a9a18f2f571bb8",
     "source_last_seq":19,
     "history": [{"session_id":"00872a440fdda973d6a9a18f2f571bb8",
     "start_time":"Tue, 05 Jul 2011 23:03:32 GMT",
     "end_time":"Tue, 05 Jul 2011 23:03:32 GMT",
     "start_last_seq":0,
     "end_last_seq":19,
     "recorded_seq":19,
     "missing_checked":0,
     "missing_found":8,
     "docs_read":12,
     "docs_written":12,
     "doc_write_failures":0}]}
Wr ite   Wr ite
Continuous Replication


  $ curl -vX POST http://127.0.0.1:5984/_replicate
      -d '{
            "source":"http://127.0.0.1:5984/contacts",
            "target":"http://127.0.0.1:5984/contacts-replica",
            "continuous":true
      }'
Read        Wr ite




Wr ite                        Wr ite




                Wr ite
 White                           Read
Load Balancing
             Caching

It's HTTP. So use the tools you know
       -> NGINX
       -> Squid
       -> Apache mod_proxy
       -> …....
Conflict Resolution



   Library


   http://thetowersofjacksonville.com/photogallery/photo12411/real.html
   http://thetowersofjacksonville.com/photogallery/photo12411/real.htm
Conflicts Resolution
function(doc) {
    if(doc._conflicts) {
         emit(doc._conflicts, null);}
}

{"total_rows":1,"offset":0,"rows":[
{"id":"identifier","key":["2-
7c971bb974251ae8541b8fe045964219"],"value":null}
]}

$ curl -X DELETE $HOST/db-replica/identifier?rev=2-
de0ea16f8621cbac506d23a0fbbde08a

{"ok":true,"id":"identifier","rev":"3-bfe83a296b0445c4d526ef35ef62ac14"}

$ curl -X PUT $HOST/db-replica/identifier
-d '{"count":3,"_rev":"2-7c971bb974251ae8541b8fe045964219"}'

{"ok":true,"id":"identifier","rev":"3-5d0319b075a21b095719bc561def7122"}
Library


http://thetowersofjacksonville.com/photogallery/photo12411/real.htm
Clients
JavaScript : Jquery CouchDB Library
.Net : Relax
Java : CouchDB4J
Perl : CouchDB::Client Net::CouchDb
Ruby : CouchRest
Python : couchdb-python
Scala : scouchdb
And so much more ...
CouchDB
       In
Mobile

  http://www.digitaljournal.com/article/261153
Mobile Platforms
   Supported
Simply Works
PhoneGAP   LawnChair
Own Your Data

 I like services like google but what about
               my privacy ?!




I think CouchDB is the way to own my data
Partition                          with                      Cluster




      http://thetowersofjacksonville.com/photogallery/photo12411/real.htm
Solutions
“CouchDB is built of
the Web to the
Web”
       – Jacob Kaplan-Moss
We need a MindSet
     Change

          Stop seing all
          the data in the
              world as
          relational data
Don't trust me ... or others
          Try it !
And the Future…

Probably will be
     polyglot

Using RDBMS and more
   than one NoSQL
 Database per solution
Success Stor ies
NoSQL and CouchDB
NoSQL and CouchDB

More Related Content

What's hot

Developing polyglot persistence applications #javaone 2012
Developing polyglot persistence applications  #javaone 2012Developing polyglot persistence applications  #javaone 2012
Developing polyglot persistence applications #javaone 2012Chris Richardson
 
MongoDB and Ecommerce : A perfect combination
MongoDB and Ecommerce : A perfect combinationMongoDB and Ecommerce : A perfect combination
MongoDB and Ecommerce : A perfect combinationSteven Francia
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialSteven Francia
 
Zh Tw Introduction To H Base
Zh Tw Introduction To H BaseZh Tw Introduction To H Base
Zh Tw Introduction To H Basekevin liao
 
MyHeritage Cassandra meetup 2016
MyHeritage Cassandra meetup 2016MyHeritage Cassandra meetup 2016
MyHeritage Cassandra meetup 2016Ran Peled
 
Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, Informatica
Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, InformaticaHadoop World 2011: Practical HBase - Ravi Veeramchaneni, Informatica
Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, InformaticaCloudera, Inc.
 
NoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learnedNoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learnedLa FeWeb
 
Facebook keynote-nicolas-qcon
Facebook keynote-nicolas-qconFacebook keynote-nicolas-qcon
Facebook keynote-nicolas-qconYiwei Ma
 
Blending MongoDB and RDBMS for ecommerce
Blending MongoDB and RDBMS for ecommerceBlending MongoDB and RDBMS for ecommerce
Blending MongoDB and RDBMS for ecommerceSteven Francia
 
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...CUBRID
 
Scaling Rails with Memcached
Scaling Rails with MemcachedScaling Rails with Memcached
Scaling Rails with Memcachedguest2259ea
 
Compaction and Splitting in Apache Accumulo
Compaction and Splitting in Apache AccumuloCompaction and Splitting in Apache Accumulo
Compaction and Splitting in Apache AccumuloHortonworks
 
HBase and Accumulo | Washington DC Hadoop User Group
HBase and Accumulo | Washington DC Hadoop User GroupHBase and Accumulo | Washington DC Hadoop User Group
HBase and Accumulo | Washington DC Hadoop User GroupCloudera, Inc.
 
Non Relational Databases
Non Relational DatabasesNon Relational Databases
Non Relational DatabasesChris Baglieri
 
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.
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB RoadmapMongoDB
 
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - Facebook
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - FacebookHadoop World 2011: Apache HBase Road Map - Jonathan Gray - Facebook
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - FacebookCloudera, Inc.
 
BIS and COM in Action
BIS and COM in ActionBIS and COM in Action
BIS and COM in ActionJerry Merrill
 
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...Simplilearn
 

What's hot (20)

Hbase: an introduction
Hbase: an introductionHbase: an introduction
Hbase: an introduction
 
Developing polyglot persistence applications #javaone 2012
Developing polyglot persistence applications  #javaone 2012Developing polyglot persistence applications  #javaone 2012
Developing polyglot persistence applications #javaone 2012
 
MongoDB and Ecommerce : A perfect combination
MongoDB and Ecommerce : A perfect combinationMongoDB and Ecommerce : A perfect combination
MongoDB and Ecommerce : A perfect combination
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
 
Zh Tw Introduction To H Base
Zh Tw Introduction To H BaseZh Tw Introduction To H Base
Zh Tw Introduction To H Base
 
MyHeritage Cassandra meetup 2016
MyHeritage Cassandra meetup 2016MyHeritage Cassandra meetup 2016
MyHeritage Cassandra meetup 2016
 
Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, Informatica
Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, InformaticaHadoop World 2011: Practical HBase - Ravi Veeramchaneni, Informatica
Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, Informatica
 
NoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learnedNoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learned
 
Facebook keynote-nicolas-qcon
Facebook keynote-nicolas-qconFacebook keynote-nicolas-qcon
Facebook keynote-nicolas-qcon
 
Blending MongoDB and RDBMS for ecommerce
Blending MongoDB and RDBMS for ecommerceBlending MongoDB and RDBMS for ecommerce
Blending MongoDB and RDBMS for ecommerce
 
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...
Database Sharding the Right Way: Easy, Reliable, and Open source - HighLoad++...
 
Scaling Rails with Memcached
Scaling Rails with MemcachedScaling Rails with Memcached
Scaling Rails with Memcached
 
Compaction and Splitting in Apache Accumulo
Compaction and Splitting in Apache AccumuloCompaction and Splitting in Apache Accumulo
Compaction and Splitting in Apache Accumulo
 
HBase and Accumulo | Washington DC Hadoop User Group
HBase and Accumulo | Washington DC Hadoop User GroupHBase and Accumulo | Washington DC Hadoop User Group
HBase and Accumulo | Washington DC Hadoop User Group
 
Non Relational Databases
Non Relational DatabasesNon Relational Databases
Non Relational Databases
 
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,...
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
 
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - Facebook
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - FacebookHadoop World 2011: Apache HBase Road Map - Jonathan Gray - Facebook
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - Facebook
 
BIS and COM in Action
BIS and COM in ActionBIS and COM in Action
BIS and COM in Action
 
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
 

Viewers also liked

SOLID design principles in Ruby
SOLID design principles in RubySOLID design principles in Ruby
SOLID design principles in RubyAnil Wadghule
 
Geecon09: SOLID Design Principles
Geecon09: SOLID Design PrinciplesGeecon09: SOLID Design Principles
Geecon09: SOLID Design PrinciplesBruno Bossola
 
Refactoring Applications using SOLID Principles
Refactoring Applications using SOLID PrinciplesRefactoring Applications using SOLID Principles
Refactoring Applications using SOLID PrinciplesSteven Smith
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design PrinciplesAndreas Enbohm
 
The SOLID Principles Illustrated by Design Patterns
The SOLID Principles Illustrated by Design PatternsThe SOLID Principles Illustrated by Design Patterns
The SOLID Principles Illustrated by Design PatternsHayim Makabee
 

Viewers also liked (9)

Relax, it's spa time
Relax, it's spa timeRelax, it's spa time
Relax, it's spa time
 
SOLID design principles in Ruby
SOLID design principles in RubySOLID design principles in Ruby
SOLID design principles in Ruby
 
Geecon09: SOLID Design Principles
Geecon09: SOLID Design PrinciplesGeecon09: SOLID Design Principles
Geecon09: SOLID Design Principles
 
SOLID Design principles
SOLID Design principlesSOLID Design principles
SOLID Design principles
 
Solid principles
Solid principlesSolid principles
Solid principles
 
SOLID PRINCIPLES
SOLID PRINCIPLESSOLID PRINCIPLES
SOLID PRINCIPLES
 
Refactoring Applications using SOLID Principles
Refactoring Applications using SOLID PrinciplesRefactoring Applications using SOLID Principles
Refactoring Applications using SOLID Principles
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
The SOLID Principles Illustrated by Design Patterns
The SOLID Principles Illustrated by Design PatternsThe SOLID Principles Illustrated by Design Patterns
The SOLID Principles Illustrated by Design Patterns
 

Similar to NoSQL and CouchDB

Using Cassandra with your Web Application
Using Cassandra with your Web ApplicationUsing Cassandra with your Web Application
Using Cassandra with your Web Applicationsupertom
 
If NoSQL is your answer, you are probably asking the wrong question.
If NoSQL is your answer, you are probably asking the wrong question.If NoSQL is your answer, you are probably asking the wrong question.
If NoSQL is your answer, you are probably asking the wrong question.Lukas Smith
 
Data Replication Options in AWS
Data Replication Options in AWSData Replication Options in AWS
Data Replication Options in AWSIrawan Soetomo
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandrazznate
 
Amazon RedShift - Ianni Vamvadelis
Amazon RedShift - Ianni VamvadelisAmazon RedShift - Ianni Vamvadelis
Amazon RedShift - Ianni Vamvadelishuguk
 
Introduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopIntroduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopAhmedabadJavaMeetup
 
http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151xlight
 
MongoDB performance
MongoDB performanceMongoDB performance
MongoDB performanceMydbops
 
MongoDB Tips and Tricks
MongoDB Tips and TricksMongoDB Tips and Tricks
MongoDB Tips and TricksM Malai
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteDr Nic Williams
 
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...Amazon Web Services
 
DAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL PerformanceDAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL PerformanceAmazon Web Services
 
Quick trip around the Cosmos - Things every astronaut supposed to know
Quick trip around the Cosmos - Things every astronaut supposed to knowQuick trip around the Cosmos - Things every astronaut supposed to know
Quick trip around the Cosmos - Things every astronaut supposed to knowRafał Hryniewski
 
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...Amazon Web Services
 
Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...
Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...
Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...Amazon Web Services
 
Best Practices for Building Open Source Data Layers
Best Practices for Building Open Source Data LayersBest Practices for Building Open Source Data Layers
Best Practices for Building Open Source Data LayersIBMCompose
 
In-Memory Data Grids - Ampool (1)
In-Memory Data Grids - Ampool (1)In-Memory Data Grids - Ampool (1)
In-Memory Data Grids - Ampool (1)Chinmay Kulkarni
 
Scale, baby, scale!
Scale, baby, scale!Scale, baby, scale!
Scale, baby, scale!Julien SIMON
 
Building High Performance Apps with In-memory Data
Building High Performance Apps with In-memory DataBuilding High Performance Apps with In-memory Data
Building High Performance Apps with In-memory DataAmazon Web Services
 
Use Performance Insights To Enhance MongoDB Performance - (Manosh Malai - Myd...
Use Performance Insights To Enhance MongoDB Performance - (Manosh Malai - Myd...Use Performance Insights To Enhance MongoDB Performance - (Manosh Malai - Myd...
Use Performance Insights To Enhance MongoDB Performance - (Manosh Malai - Myd...Mydbops
 

Similar to NoSQL and CouchDB (20)

Using Cassandra with your Web Application
Using Cassandra with your Web ApplicationUsing Cassandra with your Web Application
Using Cassandra with your Web Application
 
If NoSQL is your answer, you are probably asking the wrong question.
If NoSQL is your answer, you are probably asking the wrong question.If NoSQL is your answer, you are probably asking the wrong question.
If NoSQL is your answer, you are probably asking the wrong question.
 
Data Replication Options in AWS
Data Replication Options in AWSData Replication Options in AWS
Data Replication Options in AWS
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandra
 
Amazon RedShift - Ianni Vamvadelis
Amazon RedShift - Ianni VamvadelisAmazon RedShift - Ianni Vamvadelis
Amazon RedShift - Ianni Vamvadelis
 
Introduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopIntroduction to MongoDB and Workshop
Introduction to MongoDB and Workshop
 
http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151
 
MongoDB performance
MongoDB performanceMongoDB performance
MongoDB performance
 
MongoDB Tips and Tricks
MongoDB Tips and TricksMongoDB Tips and Tricks
MongoDB Tips and Tricks
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - Keynote
 
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
 
DAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL PerformanceDAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL Performance
 
Quick trip around the Cosmos - Things every astronaut supposed to know
Quick trip around the Cosmos - Things every astronaut supposed to knowQuick trip around the Cosmos - Things every astronaut supposed to know
Quick trip around the Cosmos - Things every astronaut supposed to know
 
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
 
Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...
Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...
Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...
 
Best Practices for Building Open Source Data Layers
Best Practices for Building Open Source Data LayersBest Practices for Building Open Source Data Layers
Best Practices for Building Open Source Data Layers
 
In-Memory Data Grids - Ampool (1)
In-Memory Data Grids - Ampool (1)In-Memory Data Grids - Ampool (1)
In-Memory Data Grids - Ampool (1)
 
Scale, baby, scale!
Scale, baby, scale!Scale, baby, scale!
Scale, baby, scale!
 
Building High Performance Apps with In-memory Data
Building High Performance Apps with In-memory DataBuilding High Performance Apps with In-memory Data
Building High Performance Apps with In-memory Data
 
Use Performance Insights To Enhance MongoDB Performance - (Manosh Malai - Myd...
Use Performance Insights To Enhance MongoDB Performance - (Manosh Malai - Myd...Use Performance Insights To Enhance MongoDB Performance - (Manosh Malai - Myd...
Use Performance Insights To Enhance MongoDB Performance - (Manosh Malai - Myd...
 

Recently uploaded

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

NoSQL and CouchDB

  • 1.
  • 2. Who am I ? -> My Name: João Cerdeira -> Team Leader -> An Agile enthusiast: Scrum / Kanban / Lean -> A true believer in OpenSource http://twitter.com/jacerdeira cerdeira@gmail.com
  • 3. Disclamer -> I understand your questions, but sometimes I don't have answers -> I'm not a NoSQL Dogmatic, just an enthusiast about the new ways of storing information -> I have worked with RDBMS for 12 years
  • 4. Everyone has their preferences
  • 5. I don't care if I/you will use SQL or NoSQL. I just want to deliver better Services/Aplications to the clients/users.
  • 7. Scale up vs Scale Down
  • 8. Performance VS Scalability Latency VS Throughput Availability VS Consistency
  • 10. Choose only 2: C onsistency A vailability P artition Tolerance At a given time in certain enviroment
  • 11. Consistency MS B RD Availability N oS Q L Partition Tolerance
  • 12. Centralized System In a centralized system (RDBMS) we don't have network partition P in CAP So we get: A vailability C onsistency
  • 13. -> A tomicity -> C onsistency -> I solated -> D urability
  • 14. Distr ibuted System In a distr ibuted system we (might) have network partition P in CAP So you can only pick one: A vailability C onsistency
  • 15. CAP in practice We have only two types of Systems CP == CA (very similar) AP So in a network partition we have only one choice C onsistency A vailability
  • 16. -> B asically A vailable -> S oft state -> E ventually consistent
  • 18. How to Scale Out RDBMS ? http://capellaniaprimaria.blogspot.com/2011/02/concurso-deportivo-4-pregunta.html
  • 22. ORM Problems What you want ? Find/read a record/object
  • 23. ORM Problems What you want ? Find/read a record/object What you get ? A huge underground complexity
  • 25. Let Validate our Thoughts Do we need ACID for all solutions?
  • 26. Let Validate our Thoughts Do we need ACID for all solutions? When is Eventually Consistent enough ?
  • 27. Let Validate our Thoughts Do we need ACID for all solutions? When is Eventually Consistent enough ? Different solutions require different needs
  • 28. Why NoSQL Appears ? Because New Dr ivers Appears (business or technical demand)
  • 29. New Dr ivers Behind NoSQL Large amount of data Commodity hardware Scale Fast And Cheap Constantly changing request (data)
  • 30. Why RDBMS aren't good enough ?
  • 31. Why RDBMS aren't good enough ? Scalling reads in a RDBMS is hard
  • 32. Why RDBMS aren't good enough ? Scalling reads in a RDBMS is hard Scalling wr ites is impossible
  • 33. Think again Do we really need a RDBMS ?
  • 34. Think again Do we really need a RDBMS ? Sometimes !
  • 35. Think again Do we really need a RDBMS ? Sometimes ! But a lot of times we don't !
  • 36. NoSQL
  • 37. How did NoSQL start ? Google: Bigtable Amazon: Dynamo Facebook: Cassandra LinkedIn: Valdemort Yahoo: HBase (hadoop)
  • 38. Or igins Google : “How can we build a DB on top of Google File System” Paper: Bigtable → A distributed store system for structured data, 2006 Amazon: “How can we build a distributed hash table for the data center” Paper : Dynamo → Amazon's highly available key-value store
  • 39. Different Types of NoSQL Key-Value Stores Document Databases Column Databases Graph Databases
  • 40. Key-Value Stores Or igin: Amazon's Dynamo paper Data model: Collections of KV pairs Implementations: Dynamo, Voldemort, Membase, Riak, Redis Good For: - Large amount of data - Scale writes and reads - Fast - Programmer friendly
  • 41. Document Databases Or igin: Lotus Notes Data model: Collections of Documents Implementations: CouchDB, MongoDB, Amazon SimpleDB Good For: - Human Data Structure - Programmer friendly - Rapid Development - Web friendly - CRUD
  • 42. Column Databases Or igin: Google's BigTable Paper Data model: Column family – each row (at least in theory) can have different configuration Implementations: BigTable, HBase, Cassandra Good For: - Large amount of data - scale writes like no other - High availability
  • 43. Graph Databases Or igin: Graph Theory Data model: Nodes and Relations, both can have KV pairs Implementations: Neo4j, FlockDB Good For: - resolve graph problems - Fast
  • 44.
  • 45. Why I'd choose CouchDB ? -> Easy to understand documents -> Use standards web technologies -> Simple to install and configure -> Small footprint (works on mobile platforms) -> Scales well (not for huge amount of data) -> Replication in the core
  • 46. CouchDB Main Pr incipals Document Oriented Database No rows or columns Collection of JSON Documents Schema-Free
  • 47. In CouchDB HTTP Rules -> Everything is a HTTP Request -> We are used to know GET and POST -> But there are others: -> PUT -> DELETE -> COPY RESTful HTTP API
  • 48. Why JSON ? -> Light and text-based data format -> Simple to parse -> Not verbose (comparing to xml) -> Suitable for javascript frameworks (jquery) -> Parsers available in almost all programming languages
  • 49. JSON Example { make: "Ford", model: "Mustang", year: 2009, body: "Coupe", color: "Red", engine: { gas_type: "Petrol", cubic_capacity: 4600 }, previous_owners: [ { name: "John Smith", mileage: 1000 }, { name: "Jane Hunt", mileage: 2500 } ] }
  • 50. JSON Example { make: "Ford", model: "Mustang", year: 2009, body: "Coupe", color: "Red", engine: { gas_type: "Petrol", cubic_capacity: 4600 }, previous_owners: [ { name: "John Smith", mileage: 1000 }, { name: "Jane Hunt", mileage: 2500 } ] }
  • 51. JSON Example { make: "Ford", model: "Mustang", year: 2009, body: "Coupe", color: "Red", engine: { gas_type: "Petrol", cubic_capacity: 4600 }, previous_owners: [ { name: "John Smith", mileage: 1000 }, { name: "Jane Hunt", mileage: 2500 } ] }
  • 52. JSON Example { make: "Ford", model: "Mustang", year: 2009, body: "Coupe", color: "Red", engine: { gas_type: "Petrol", cubic_capacity: 4600 }, previous_owners: [ { name: "John Smith", mileage: 1000 }, { name: "Jane Hunt", mileage: 2500 } ] }
  • 54. Create / Delete Database $ curl http://127.0.0.1:5984 {"couchdb":"Welcome","version":"1.0.1"} $ curl -X PUT http://127.0.0.1:5984/contacts {"ok":true} $ curl -X GET http://127.0.0.1:5984/_all_dbs ["contacts","_users"] $ curl -X DELETE http://127.0.0.1:5984/contacts {"ok":true}
  • 55. Manage Documents $ curl -X PUT http://127.0.0.1:5984/contacts/joaocerdeira -d '{}' {"ok":true,"id":"joaocerdeira","rev":"1- 967a00dff5e02add41819138abb3284d"} $ curl -X GET http://127.0.0.1:5984/contacts/joaocerdeira {"_id":"joaocerdeira","_rev":"1- 967a00dff5e02add41819138abb3284d"} $ curl -X DELETE http://127.0.0.1:5984/contacts/joaocerdeira?rev=1- 967a00dff5e02add41819138abb3284d {"ok":true,"id":"joaocerdeira","rev":"2- eec205a9d413992850a6e32678485900"}
  • 56. Manage Documents $ curl -X PUT http://127.0.0.1:5984/contacts/joaocerdeira -d '{"firstName":"Joao","lastName":"Cerdeira","email":" cerdeira@gmail.com"}' {"ok":true,"id":"joaocerdeira","rev":"1- 186fe12b748c40559e8f234d8e566c18"} $ curl -X GET http://127.0.0.1:5984/contacts/joaocerdeira {"_id":"joaocerdeira","_rev":"1- 186fe12b748c40559e8f234d8e566c18","firstName":"Joao","lastNam e":"Cerdeira","email":"cerdeira@gmail.com"}
  • 57. Copy Documents $ curl -X COPY http://127.0.0.1:5984/contacts/joaocerdeira -H "Destination: batatinha" {"id":"batatinha","rev":"1-186fe12b748c40559e8f234d8e566c18"} $ curl -X GET http://127.0.0.1:5984/contacts/batatinha {"_id":"batatinha","_rev":"1- 186fe12b748c40559e8f234d8e566c18","firstName":"Joao","lastNam e":"Cerdeira","email":"cerdeira@gmail.com"}
  • 58. Changing Documents $ curl -X PUT http://127.0.0.1:5984/contacts/batatinha -d '{"_rev":"1- 186fe12b748c40559e8f234d8e566c18","firstName":"Clown","lastNa me":"Batatinha","email":["batatinha@bataton.pt ","batatinha@first.to.exit@rtp.pt"], "phone":"93 1234567"}' {"ok":true,"id":"batatinha","rev":"2- b7079a6d71179b1571652059355d84c3"} $ curl -X GET http://127.0.0.1:5984/contacts/batatinha {"_id":"batatinha","_rev":"2- b7079a6d71179b1571652059355d84c3","firstName":"Clown","lastNa me":"Batatinha","email":["batatinha@bataton.pt ","batatinha@first.to.exit@rtp.pt"], "phone":"93 1234567"}
  • 59. MVCC CouchDB never blocks Append Mode Only
  • 60. Designing Documents { "_id":"joaocerdeira", "_rev":"1-186fe12b748c40559e8f234d8e566c18", “doctype”:”contact” "firstName":"Joao", "lastName":"Cerdeira", “company”:”MULTICERT” "emails":[ { “type”:”personal”, “email”:"cerdeira@gmail.com“ }, { “type”:”business”, “email”:"joao.cerdeira@multicert.com“ } ], “phones”:[ { “type”:”personal”, “phone”:"93 1234567“ }, { “type”:”business”, “phone”:"93 7654321“ } ] }
  • 61. Designing Documents { "_id":"joaocerdeira", "_rev":"1-186fe12b748c40559e8f234d8e566c18", “doctype”:”contact” "firstName":"Joao", "lastName":"Cerdeira", “company”:”MULTICERT” "emails":[ { “type”:”personal”, “email”:"cerdeira@gmail.com“ }, { “type”:”business”, “email”:"joao.cerdeira@multicert.com“ } ], “phones”:[ { “type”:”personal”, “phone”:"93 1234567“ }, { “type”:”business”, “phone”:"93 7654321“ } ] }
  • 62. Designing Documents { "_id":"joaocerdeira", "_rev":"1-186fe12b748c40559e8f234d8e566c18", “doctype”:”contact” "firstName":"Joao", "lastName":"Cerdeira", “company”:”MULTICERT” "emails":[ { “type”:”personal”, “email”:"cerdeira@gmail.com“ }, { “type”:”business”, “email”:"joao.cerdeira@multicert.com“ } ], “phones”:[ { “type”:”personal”, “phone”:"93 1234567“ }, { “type”:”business”, “phone”:"93 7654321“ } ] }
  • 63. Designing Documents { "_id":"joaocerdeira", "_rev":"1-186fe12b748c40559e8f234d8e566c18", “doctype”:”contact” "firstName":"Joao", "lastName":"Cerdeira", “company”:”MULTICERT” "emails":[ { “type”:”personal”, “email”:"cerdeira@gmail.com“ }, { “type”:”business”, “email”:"joao.cerdeira@multicert.com“ } ], “phones”:[ { “type”:”personal”, “phone”:"93 1234567“ }, { “type”:”business”, “phone”:"93 7654321“ } ] }
  • 65. Views
  • 66. Quer ing CouchDB Quer ies in JavaScr ipt Use Map/Reduce for quer ing For simple quer ies Map/Reduce isn't needed Don't have joins (but you can have similar)
  • 67. Simple Views List All Documents function(doc){ emit(doc._id,doc); } List All Documents Of type 'vip' function(doc){ If (doc.type=='vip'){ emit(doc._id,doc); } }
  • 68. Temp Views $ curl -X POST -H "Content-type: application/json" http://127.0.0.1:5984/contacts/_temp_view -d '{"map":"function(doc) {emit(doc._id,doc);}"}' {"total_rows":2,"offset":0,"rows":[ {"id":"batatinha","key":"batatinha","value":{"_id":"batatinha","_rev":"2- b7079a6d71179b1571652059355d84c3","firstName":"Palhaco","lastName ":"Batatinha","email": ["batatinha@bataton.pt","batatinha@first.to.exit@rtp.pt"],"phone":"93 1234567"}}, {"id":"joaocerdeira","key":"joaocerdeira","value": {"_id":"joaocerdeira","_rev":"1- 186fe12b748c40559e8f234d8e566c18","firstName":"Joao","lastName":"C erdeira","email":"cerdeira@gmail.com","_deleted_conflicts":["2- eec205a9d413992850a6e32678485900"]}}
  • 69. Normal Views { "_id" : "_design/example", "views" : { "foo" : { "map":"function(doc){emit(doc._id,doc);}" } } } $ curl -X PUT -H "Content-type: application/json" http://127.0.0.1:5984/contacts/_design/example -d @design_simple1.json
  • 70. Normal Views $ curl -X GET http://127.0.0.1:5984/contacts/_design/example/_view/foo {"total_rows":2,"offset":0,"rows":[ {"id":"batatinha","key":"batatinha","value":{"_id":"batatinha","_rev":"2- b7079a6d71179b1571652059355d84c3","firstName":"Palhaco","lastName" :"Batatinha","email": ["batatinha@bataton.pt","batatinha@primeiro.a.sair@rtp.pt"],"phone":"93 1234567"}}, {"id":"joaocerdeira","key":"joaocerdeira","value": {"_id":"joaocerdeira","_rev":"1- 186fe12b748c40559e8f234d8e566c18","firstName":"Jou00e3o","lastNam e":"Cerdeira","email":"cerdeira@gmail.com","_deleted_conflicts":["2- eec205a9d413992850a6e32678485900"]}} ]}
  • 71. Map/Reduce Google patent from the paper: http://labs.google.com/papers/mapreduce.html image source: http://map-reduce.wikispaces.asu.edu/
  • 72. Map/Reduce Views {"_id" : "_design/example", "views" : { …................................... "bar" : { "map":"function(doc){emit(doc,1);}", "reduce":"function(keys, values, rereduce) { return sum(values);}" }}} $ curl -X GET http://127.0.0.1:5984/contacts/_design/example/_view/bar {"rows":[ {"key":null,"value":7} ]}
  • 73. Map/Reduce Views {"_id" : "_design/example", "views" : { …................................... ""aggreg" : { "map":"function(doc){if(doc.country){emit(doc.country,1);}}", "reduce":"function(keys, values, rereduce) {return sum(values);}" } $ curl -X GET http://127.0.0.1:5984/contacts/_design/example/_view/aggreg?group=true {"rows":[ {"key":"England","value":1}, {"key":"Portugal","value":2}, {"key":"US","value":2} ]}
  • 76. Wr ite Read Read
  • 77. Wr ite Read Read Read
  • 78. One Time Replication $ curl -H "Content-type: application/json -X POST http://127.0.0.1:5984/_replicate -d '{"source":"contacts","target":"contacts-replica"}' {"ok":true, "session_id":"00872a440fdda973d6a9a18f2f571bb8", "source_last_seq":19, "history": [{"session_id":"00872a440fdda973d6a9a18f2f571bb8", "start_time":"Tue, 05 Jul 2011 23:03:32 GMT", "end_time":"Tue, 05 Jul 2011 23:03:32 GMT", "start_last_seq":0, "end_last_seq":19, "recorded_seq":19, "missing_checked":0, "missing_found":8, "docs_read":12, "docs_written":12, "doc_write_failures":0}]}
  • 79. Wr ite Wr ite
  • 80. Continuous Replication $ curl -vX POST http://127.0.0.1:5984/_replicate -d '{ "source":"http://127.0.0.1:5984/contacts", "target":"http://127.0.0.1:5984/contacts-replica", "continuous":true }'
  • 81. Read Wr ite Wr ite Wr ite Wr ite White Read
  • 82. Load Balancing Caching It's HTTP. So use the tools you know -> NGINX -> Squid -> Apache mod_proxy -> …....
  • 83. Conflict Resolution Library http://thetowersofjacksonville.com/photogallery/photo12411/real.html http://thetowersofjacksonville.com/photogallery/photo12411/real.htm
  • 84.
  • 85.
  • 86.
  • 87.
  • 88. Conflicts Resolution function(doc) { if(doc._conflicts) { emit(doc._conflicts, null);} } {"total_rows":1,"offset":0,"rows":[ {"id":"identifier","key":["2- 7c971bb974251ae8541b8fe045964219"],"value":null} ]} $ curl -X DELETE $HOST/db-replica/identifier?rev=2- de0ea16f8621cbac506d23a0fbbde08a {"ok":true,"id":"identifier","rev":"3-bfe83a296b0445c4d526ef35ef62ac14"} $ curl -X PUT $HOST/db-replica/identifier -d '{"count":3,"_rev":"2-7c971bb974251ae8541b8fe045964219"}' {"ok":true,"id":"identifier","rev":"3-5d0319b075a21b095719bc561def7122"}
  • 90. Clients JavaScript : Jquery CouchDB Library .Net : Relax Java : CouchDB4J Perl : CouchDB::Client Net::CouchDb Ruby : CouchRest Python : couchdb-python Scala : scouchdb And so much more ...
  • 91. CouchDB In Mobile http://www.digitaljournal.com/article/261153
  • 92. Mobile Platforms Supported
  • 94. PhoneGAP LawnChair
  • 95. Own Your Data I like services like google but what about my privacy ?! I think CouchDB is the way to own my data
  • 96. Partition with Cluster http://thetowersofjacksonville.com/photogallery/photo12411/real.htm
  • 98.
  • 99. “CouchDB is built of the Web to the Web” – Jacob Kaplan-Moss
  • 100. We need a MindSet Change Stop seing all the data in the world as relational data
  • 101. Don't trust me ... or others Try it !
  • 102. And the Future… Probably will be polyglot Using RDBMS and more than one NoSQL Database per solution