NoSQL in der Cloud – Why?


Andreas Hartmann




19.11.2012
Quelle: http://res.sys-con.com/story/mar12/2188748/CloudBigData_0_0.jpg


19.11.2012   2   NoSQL in der Cloud – Why?
Why Cloud???




19.11.2012   3   NoSQL in der Cloud – Why?
What does Big Data mean???




19.11.2012   4   NoSQL in der Cloud – Why?
Why NoSQL???




         BigData                         Connectivity    P2P Knowledge




      Concurrencey                           Diversity      Cloud

19.11.2012   5   NoSQL in der Cloud – Why?
What is the Problem with Big Data


                                                                 ►   Caching

                                                                 ►   Master/Slave

                                                                 ►   Master/Master

                                                                 ►   Cluster

                                                                 ►   Table Partitioning

                                                                 ►   Federated Tables

                                                                 ►   Sharding




                                             Quelle: http://www.codefutures.com/database-sharding/


19.11.2012   6   NoSQL in der Cloud – Why?
NoSQL Basics – CAP Theorem


                                                                        Consistency

                                                                        Each client always
                                                                        has the same view of
                                                                        the data

                                                                        Availability

                                                                        All clients can always
                                                                        read and write

                                                                        Partition tolerance

                                                                        The System continues
                                                                        to operate despite
                                                                        arbitrary message
                                                                        loss

                                             Quelle: http://blog.nahurst.com/visual-guide-to-nosql-systems


19.11.2012   7   NoSQL in der Cloud – Why?
ACID-BASE


  ACID                                               BASE
  Atomicity                                          Basically Available
  ►   all or nothing rule                            ►   the system does guarantee availability, in
                                                         terms of the CAP theorem
  Consistency
                                                     Soft-State
  ►   any transaction the database performs
      will take it from one consistent state to      ►   the state of the system may change over
      another                                            time, even without input

  Isolation                                          Eventual Consistency
                                                     ►   the system will become consistent over
  ►   no transaction should be able to interfere
                                                         time, given that the system doesn't
      with another transaction at all
                                                         receive input during that time
  Durability
  ►   once a transaction has been committed,
      it will remain so                            Quelle:
                                                   http://stackoverflow.com/questions/3342497/explanation-of-
Quelle: http://en.wikipedia.org/wiki/ACID          base-terminology




19.11.2012   8      NoSQL in der Cloud – Why?
Things to think about!!!


                                                                                     ►    Scalability
                                                                                     ►    High Availability
                                                                                     ►    Caching
                                                                                     ►    Architecture
                                                                                     ►    Load Balancing
                                                                                     ►    Queuing
                                                                                     ►    Data Handling
                                                                                     ►    Federation
                                                                                     ►    Serving Files
                                                                                     ►    Storing Files



                              Quelle: http://cloudscaling.com/blog/cloud-computing/up-out-centralized-and-decentralized


19.11.2012   9   NoSQL in der Cloud – Why?
Open Your Mind;-)




                        Quelle: http://images.tribe.net/tribe/upload/photo/deb/074/deb074db-81fc-4b8a-bfbd-b18b922885cb


19.11.2012   10   NoSQL in der Cloud – Why?
NoSQL Tagcloud




19.11.2012   11   NoSQL in der Cloud – Why?
Datastore Types




                                  Key/Value    Document
                                    Store        Store




                                Extensible
                                  Record
                                                Graph
                               Stores (Wide-
                                               Database
                                  column
                                  Stores)




19.11.2012   12   NoSQL in der Cloud – Why?
What ist means


  Query                                          Developer
  Data is easily and quickly read/stored         More technologies to have fun with
   using primary key

                                                 Broader choice of persistence stores
  Denormalize data for commonly used
   queries
                                                 Probably Cross Store Persistence
                                                 ►   Store name, firstname etc in RDBMS
  ►   Shema Design is optimized for the most
      common Use-Cases                           ►   Store followers in Graph database


                                                 ►   Store Content in RDBMS
                                                 ►   Store User Generated Content in
                                                     Document database



                                               Quelle: http://www.slideshare.net/adessoAG/no-sql-9355109


19.11.2012   13   NoSQL in der Cloud – Why?
Wich is the right one




                   Quelle: http://www.slideshare.net/emileifrem/nosql-east-a-nosql-overview-and-the-benefits-of-graph-databases


19.11.2012   14   NoSQL in der Cloud – Why?
Wich is the right one




                                              Quelle: http://martinfowler.com/articles/nosql-intro.pdf


19.11.2012   15   NoSQL in der Cloud – Why?
Architecture Case Study



                     Business Critical
                     Data Read/Write




                                                         Data should be
                                                           consistent
                                               Rarley Changed Data /
                                               Various Reads / Slight
                                              inconsistencies are OK




19.11.2012   16   NoSQL in der Cloud – Why?
mongoDB as an Example




                                 Document-
                                                 JSON like
                                  oriented &
                                                documents
                                 schemaless




                                                Open Source
                               written in C++   with a AGPL-
                                                Licence v.3.0




19.11.2012   17   NoSQL in der Cloud – Why?
mongoDB in Detail


                  MongoDB Basics

                     Security and Authentication – Indexes

                         Replication – Scaling

                         Map/Reduce – Binary Data Sets

                     Monitoring – Backup

                  Schema Design – Connectivity – Ecosystem

19.11.2012   18    NoSQL in der Cloud – Why?
mongoDB – Replication

Replica Sets
►   A replica set consists of two or more nodes that are copies of each other
►   The replica set automatically selects a primary (master).
►   Drivers can automatically detect when a replica set primary changes and will
    begin sending writes to the new primary


Why Replica Sets
►   Automated Failover
►   Read Scaling (slaveOkay Method)
►   Maintenance
►   Disaster Recovery



                                              Quelle: http://www.mongodb.org/display/DOCS/Replica+Sets


19.11.2012   19   NoSQL in der Cloud – Why?
mongoDB – Scaling

Sharding
►   Horizontal scaling across multiple nodes


Sharding Key




19.11.2012   20   NoSQL in der Cloud – Why?
mongoDB – Scaling

Replica Sets comes together with Sharding




                                              Quelle: http://www.mongodb.org/display/DOCS/Sharding+Introduction


19.11.2012   21   NoSQL in der Cloud – Why?
mongoDB – Map/Reduce

Parallel processing huge datasets on distributed systems


                   Data                  Data         Data   Data



                                                MAP




                                              REDUCE




19.11.2012   22   NoSQL in der Cloud – Why?
mongoDB – Map/Reduce

                                                   Map   Reduce   Execute
Map
► XXX
 var map = function()                          {

             emit( this.author,
                { pages: this.pages } );
 };




19.11.2012    23   NoSQL in der Cloud – Why?
mongoDB – Map/Reduce

                                                        Map   Reduce   Execute
Reduce




 var reduce = function( key, values )           {
        var sum = 0;

              values.forEach( function( doc )       {
                           sum += doc.pages;
              } );

              return { "pages": sum };
 };




19.11.2012   24   NoSQL in der Cloud – Why?
mongoDB – Map/Reduce

                                              Map   Reduce   Execute
Execute


 db.bookstore.mapReduce( map, reduce,
        { out: "myresultcollection" } );
 {
        "result" : "myresultcollection",
        "timeMillis" : 156,
        "counts" : {
               "input" : 7,
               "emit" : 7,
               "reduce" : 3,
               "output" : 3
        },
        "ok" : 1,
 }




19.11.2012   25   NoSQL in der Cloud – Why?
Quelle: http://res.sys-con.com/story/mar12/2188748/CloudBigData_0_0.jpg
                                         Quelle: http://www.techweekeurope.co.uk/wp-content/uploads/2011/03/Big-Data.jpg

19.11.2012   26   NoSQL in der Cloud – Why?
Thank you for your attention!




info@adesso.de
www.adesso.de

NoSQL in der Cloud - Why?

  • 1.
    NoSQL in derCloud – Why? Andreas Hartmann 19.11.2012
  • 2.
  • 3.
    Why Cloud??? 19.11.2012 3 NoSQL in der Cloud – Why?
  • 4.
    What does BigData mean??? 19.11.2012 4 NoSQL in der Cloud – Why?
  • 5.
    Why NoSQL??? BigData Connectivity P2P Knowledge Concurrencey Diversity Cloud 19.11.2012 5 NoSQL in der Cloud – Why?
  • 6.
    What is theProblem with Big Data ► Caching ► Master/Slave ► Master/Master ► Cluster ► Table Partitioning ► Federated Tables ► Sharding Quelle: http://www.codefutures.com/database-sharding/ 19.11.2012 6 NoSQL in der Cloud – Why?
  • 7.
    NoSQL Basics –CAP Theorem Consistency Each client always has the same view of the data Availability All clients can always read and write Partition tolerance The System continues to operate despite arbitrary message loss Quelle: http://blog.nahurst.com/visual-guide-to-nosql-systems 19.11.2012 7 NoSQL in der Cloud – Why?
  • 8.
    ACID-BASE ACID BASE Atomicity Basically Available ► all or nothing rule ► the system does guarantee availability, in terms of the CAP theorem Consistency Soft-State ► any transaction the database performs will take it from one consistent state to ► the state of the system may change over another time, even without input Isolation Eventual Consistency ► the system will become consistent over ► no transaction should be able to interfere time, given that the system doesn't with another transaction at all receive input during that time Durability ► once a transaction has been committed, it will remain so Quelle: http://stackoverflow.com/questions/3342497/explanation-of- Quelle: http://en.wikipedia.org/wiki/ACID base-terminology 19.11.2012 8 NoSQL in der Cloud – Why?
  • 9.
    Things to thinkabout!!! ► Scalability ► High Availability ► Caching ► Architecture ► Load Balancing ► Queuing ► Data Handling ► Federation ► Serving Files ► Storing Files Quelle: http://cloudscaling.com/blog/cloud-computing/up-out-centralized-and-decentralized 19.11.2012 9 NoSQL in der Cloud – Why?
  • 10.
    Open Your Mind;-) Quelle: http://images.tribe.net/tribe/upload/photo/deb/074/deb074db-81fc-4b8a-bfbd-b18b922885cb 19.11.2012 10 NoSQL in der Cloud – Why?
  • 11.
    NoSQL Tagcloud 19.11.2012 11 NoSQL in der Cloud – Why?
  • 12.
    Datastore Types Key/Value Document Store Store Extensible Record Graph Stores (Wide- Database column Stores) 19.11.2012 12 NoSQL in der Cloud – Why?
  • 13.
    What ist means Query Developer Data is easily and quickly read/stored More technologies to have fun with using primary key Broader choice of persistence stores Denormalize data for commonly used queries Probably Cross Store Persistence ► Store name, firstname etc in RDBMS ► Shema Design is optimized for the most common Use-Cases ► Store followers in Graph database ► Store Content in RDBMS ► Store User Generated Content in Document database Quelle: http://www.slideshare.net/adessoAG/no-sql-9355109 19.11.2012 13 NoSQL in der Cloud – Why?
  • 14.
    Wich is theright one Quelle: http://www.slideshare.net/emileifrem/nosql-east-a-nosql-overview-and-the-benefits-of-graph-databases 19.11.2012 14 NoSQL in der Cloud – Why?
  • 15.
    Wich is theright one Quelle: http://martinfowler.com/articles/nosql-intro.pdf 19.11.2012 15 NoSQL in der Cloud – Why?
  • 16.
    Architecture Case Study Business Critical Data Read/Write Data should be consistent Rarley Changed Data / Various Reads / Slight inconsistencies are OK 19.11.2012 16 NoSQL in der Cloud – Why?
  • 17.
    mongoDB as anExample Document- JSON like oriented & documents schemaless Open Source written in C++ with a AGPL- Licence v.3.0 19.11.2012 17 NoSQL in der Cloud – Why?
  • 18.
    mongoDB in Detail MongoDB Basics Security and Authentication – Indexes Replication – Scaling Map/Reduce – Binary Data Sets Monitoring – Backup Schema Design – Connectivity – Ecosystem 19.11.2012 18 NoSQL in der Cloud – Why?
  • 19.
    mongoDB – Replication ReplicaSets ► A replica set consists of two or more nodes that are copies of each other ► The replica set automatically selects a primary (master). ► Drivers can automatically detect when a replica set primary changes and will begin sending writes to the new primary Why Replica Sets ► Automated Failover ► Read Scaling (slaveOkay Method) ► Maintenance ► Disaster Recovery Quelle: http://www.mongodb.org/display/DOCS/Replica+Sets 19.11.2012 19 NoSQL in der Cloud – Why?
  • 20.
    mongoDB – Scaling Sharding ► Horizontal scaling across multiple nodes Sharding Key 19.11.2012 20 NoSQL in der Cloud – Why?
  • 21.
    mongoDB – Scaling ReplicaSets comes together with Sharding Quelle: http://www.mongodb.org/display/DOCS/Sharding+Introduction 19.11.2012 21 NoSQL in der Cloud – Why?
  • 22.
    mongoDB – Map/Reduce Parallelprocessing huge datasets on distributed systems Data Data Data Data MAP REDUCE 19.11.2012 22 NoSQL in der Cloud – Why?
  • 23.
    mongoDB – Map/Reduce Map Reduce Execute Map ► XXX var map = function() { emit( this.author, { pages: this.pages } ); }; 19.11.2012 23 NoSQL in der Cloud – Why?
  • 24.
    mongoDB – Map/Reduce Map Reduce Execute Reduce var reduce = function( key, values ) { var sum = 0; values.forEach( function( doc ) { sum += doc.pages; } ); return { "pages": sum }; }; 19.11.2012 24 NoSQL in der Cloud – Why?
  • 25.
    mongoDB – Map/Reduce Map Reduce Execute Execute db.bookstore.mapReduce( map, reduce, { out: "myresultcollection" } ); { "result" : "myresultcollection", "timeMillis" : 156, "counts" : { "input" : 7, "emit" : 7, "reduce" : 3, "output" : 3 }, "ok" : 1, } 19.11.2012 25 NoSQL in der Cloud – Why?
  • 26.
    Quelle: http://res.sys-con.com/story/mar12/2188748/CloudBigData_0_0.jpg Quelle: http://www.techweekeurope.co.uk/wp-content/uploads/2011/03/Big-Data.jpg 19.11.2012 26 NoSQL in der Cloud – Why?
  • 27.
    Thank you foryour attention! info@adesso.de www.adesso.de