SlideShare ist ein Scribd-Unternehmen logo
1 von 58
Downloaden Sie, um offline zu lesen
Torino, 11 luglio 2011




NoSQL
PHP.TO.START
  David Funaro
What about me ?
• sw engineer
• PHP developer (2002)
• Symfony Framework developer (2009)
• Mobile developer ( iOs / Symbian )
• Senior developer @ dnsee
• PHP user group Rome Founder
• Open Source contributor
Database - logical model


                      Other

      RDBMS




              NOSQL
Relational DB
•   In the *70’s

•   SQL ,relational algebra & set theory

•   excellent for applications such as management
    ( accounting, reservations, management staff)
ACID
Transactions work in the right mode if the
database can satisfy this four properties:

   • Atomic
   • Consistency
   • Isolation
   • Durability
Database - logical model


                      Other

      RDBMS




              NOSQL
Database - logical model
Database - logical model
           Document
           Oriented

                       Column
    Key                Oriented
   Value
            Graph DB



                       NOSql
NOSql !=
NOSql !=
One Size fits all
Not Only Sql
Historical Intro
The concept of “non relational database” is
older than the “relational model” but has been
resumed and improved




                                  technology comes back
New Requirements
New Requirements

half *90’s
New Requirements

half *90’s
with the new internet-based systems the
Consistency and the Security of data are no
longer enough
New Requirements

half *90’s
with the new internet-based systems the
Consistency and the Security of data are no
longer enough
the new need is the Hight availability
Google
• distributed storage system
• scale file dimension up to Petabyte
          Wide applicability
              Scalability
          High performance
           High availability
Google BigTable
                   column - Oriented DB
• Web indexing
• Google Earth
• Google Finance
• Orkut
• Custom Search
• Google Docs
Amazon

• Relational model doesn’t fit requirements
• 10 of thousand of server around the world
• 10 Millions customers

               High Reliability
                 High scale
Amazon Dynamo
                     Key-Value Store Database




• High Reliability
• High Scale
New Trends
Web Company
•       Startup with explosive growth:

    •     DBMS open source

    •     v 1.0 - 1 node , becomes soon inadequate

    •     next version:

         •   Horizontal Partitioning (sharding)

         •   implement the node routing inside the
             application logic
Web Company

•   Re-implement inter-node query

•   Handle inter-node transaction

•   Node failure increasingly likely - less reliability -
    less availability

•   “Hot” Data restructuring and data redistribuition
    becomes hard
Solution
•   Scalability, very simple operations,




                                           }
    but on many nodes
•   Performance, low latency
                                              web
•   Productivity
                                           Application
•   Flexibility (data structure)             needs

•   Skill to distribute data on many
    nodes
Compromise


• SQL Renounce
• less strict transactions
Query Language
Leave a standard query language like SQL, and
embrace a different kind of query language based
on the selected product
• SQL like
• map-reduce
• SparQL
• ...
CAP Theorem(2009)
 • Consistency
 • Availability
 • Partition Tollerance             Eric Brewer
It’s impossibile to have all of them at the same
time in a distributed system.You have to choose
only two.
Consistency
•   Strong: After the update completes any
    subsequent access will return the updated
                                                                   N1
    value.

•   Weak: The system does not guarantee that
    subsequent accesses will return the updated
                                                                            N2
    value.                                              tk
                                                                       tk
•   Eventually: The storage system guarantees that           N6
    if no new updates are made to the object       tk
    eventually (after the inconsistency window
                                                                  tk
    closes) all accesses will return the last  N5
    updated value.                                            N4
Consistency
•   Strong: After the update completes any
    subsequent access will return the updated
                                                                   N1
    value.

•   Weak: The system does not guarantee that
    subsequent accesses will return the updated
                                                                            N2
    value.                                              tk
                                                                       tk
•   Eventually: The storage system guarantees that           N6
    if no new updates are made to the object       tk
    eventually (after the inconsistency window
                                                                  tk
    closes) all accesses will return the last  N5
    updated value.                                            N4
Facebook Cassandra

• Key-Value store
• data model: BigTable
• infrastructure: Amazon-Dynamo
• Eventual Consistency
• High Availability
Search Best Solution




  Just find the right way to
    manage your data-set
context
purpose
                         Technology Focus




Cost of implementation
choose bike => (climb the mountain)
choose bike => (climb the mountain)
choose bike => (climb the mountain)
choose bike => (climb the mountain)
choose bike => (climb the mountain)




       Know available tools
NOSql Families
Key Value Store
One Key -> One Value
it’s like an HASH
db knows information about “key” type
(integer, float, ...), nothing about the value
very fast

        ‘name’        =>       ‘david’
            key                value
Key Value Store
performance        high

 Scalability       high
                                • redis
                                • memcached
 Flexibility       high
                                • dynamo
Complexity         none
                                • voldemort
Functionality variabile(none)
Document Oriented
• key -> document
• structured document
• schema-less        {
                         name: ‘david’,
                         surname: ‘funaro’,
                         age: ’18’,
   user_13 =>            mail: {
                           home : ‘ing.davidino@gmail.com’,
    key                    office: ‘d.funaro@dnsee.com‘
                         }
                     }
                                 document
Document Oriented
performance         high

 Scalability   variable (high)

 Flexibility        high

Complexity          low

Functionality variabile(low)
Graph DB

• composed by Vertices and Edges
• Vertices connected by Edges
• Edge has a Label and Direction
• Edges and Vertices have Properties
Graph DB
           Funaro




                  surname
 David
           na                                    User_2
             me             friend

                User_1
dnsee    work                 friend
                                                 User_3
                                     fri
                                           en
                                             d


                                                 User_3
Graph DB
performance       variable

 Scalability      variable     • neo4J
 Flexibility        high
                               • OrientDB
Complexity          high
                               • infogrid
                               • VertexDB
Functionality   graph theory
Why NOSql

    some case example
A Graph RDBMS
    Users         Followee
id name salary    id_1 id_2
                   2    4
1   ale     200
                   3    1
2 marco     230    3    4
3 david     340    3    2
                   1    5
4 sergio    349
                   5    3
5 andre     200    5    2
A Graph RDBMS
    Users         Followee
id name salary    id_1 id_2
                   2    4     handled as BTree101
1   ale     200
                   3    1
2 marco     230    3    4
3 david     340    3    2
                   1    5
4 sergio    349
                   5    3
5 andre     200    5    2
A Graph RDBMS

     Lookup david’s id [Log(N)]
     N = # users
     Look K Followees [Log(N)]
     Get their names [K*Log(N)]
Graph DB

                 Marco


Sergio                      Lookup David Log(N)
         David
                            Lookup for Followees O(K)


                   Andrea
 Ale
Benchmark
Deph RDBMS       Graph
 1    100ms       30ms                   •     1 Million Vertex
 2   1000ms      500ms                   •     4 Million Edge
 3   10000ms    3000ms                   •     Scale Free Tolopogy

 4   100000ms 50000ms                    •     Postgres VS Neo4J

 5     N/A     100000ms                  •     Both Hash and BTree



               http://markorodriguez.com/2011/02/18/mysql-vs-neo4j-on-a-large-scale-graph-traversal/
Schema
             RDBMS                               NOSql - Documentale
CREATE TABLE `pma_bookmark` (
   `id` int(11) NOT NULL auto_increment,
   `name` varchar(255) NOT NULL default '',
   `surname` varchar(255) NOT NULL default '',
   `mobile` varchar(255) NOT NULL default '',
   `url` text NOT NULL,
...
 `name` varchar(255) NOT NULL default '',
...
                                                 Schema Less
 `telex` varchar(255) NOT NULL default '',
   `fax` varchar(255) NOT NULL default '',
   `office` text NOT NULL,
   PRIMARY KEY (`id`)
);
Schema 2
id       name       surname    mobile           url          ...   telex          office        telex     ...

1        david      funaro     3548       davidfunaro.com   null   null          3548631       null     null
2      alessandro   nadalin    3257            null         null   null           32458         5456    null
3       marco        rossi     3548            null         null   null           null         515648   null

                               too value set to NULL

     user :{                            user :{                            user :{
       name: david,                       name: alessandro,                  name: marco,
       surname: funaro,                   surname: nadalin,                  surname: rossi,
       mobile : 3454,                     mobile : 6262,                     telex: 3434
       url: davidfunaro.com,              office: 342343,                   }
       office: 3423423,                    telex: 3434
     }                                  }


Each Document has only the required fields
Schema less


• flexibility to handle the data model fields
• the model can grow easily
Performance
                    ====== SET ======
                    100007 requests completed in 0.88 seconds
                    50 parallel clients
                    3 bytes payload
                    keep alive: 1



                 ====== GET ======
                   100000 requests completed in 1.23 seconds
                   50 parallel clients
                   3 bytes payload
                   keep alive: 1


                                                     http://redis.io/topics/benchmarks



http://research.yahoo.com/files/ycsb-v4.pdf
NOSql for PHP
✓Redis
✓MongoDB
✓CouchDB
✓Cassandra
✓Memcached
✴OrientDB
OrientDB library for
PHP
      https://github.com/congow/Orient
   A Set of tools to use and manage any OrientDB
   instance from PHP.
   Orient includes:
 •the HTTP protocol binding
 •the query builder
 •the data mapper ( Object Graph Mapper )
Thanks
• David Funaro
• http://davidfunaro.com
• @ingdavidino
• ing.davidino@gmail.com
credits


http://www.slideshare.net/ClaudioMartella/presentation-7398682?from=ss_embed http://
www.slideshare.net/harrikauhanen/nosql-3376398 http://www.slideshare.net/ingdavidino/cmf-a-
pain-in-the-f-phpday-05142011 http://it.wikipedia.org/wiki/Modello_relazionale http://
www.slideshare.net/gabriele.lana/nosql-7405964 http://blog.indigenidigitali.com/l-ecosistema-
nosql/ http://www.dia.uniroma3.it/~torlone/bd2/noSQL-1.pdf http://nosql-database.org/

Weitere ähnliche Inhalte

Was ist angesagt?

Cassandra nyc 2011 ilya maykov - ooyala - scaling video analytics with apac...
Cassandra nyc 2011   ilya maykov - ooyala - scaling video analytics with apac...Cassandra nyc 2011   ilya maykov - ooyala - scaling video analytics with apac...
Cassandra nyc 2011 ilya maykov - ooyala - scaling video analytics with apac...ivmaykov
 
Introduction to Cassandra Architecture
Introduction to Cassandra ArchitectureIntroduction to Cassandra Architecture
Introduction to Cassandra Architecturenickmbailey
 
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scaleHow LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scaleLinkedIn
 
Cassandra: Open Source Bigtable + Dynamo
Cassandra: Open Source Bigtable + DynamoCassandra: Open Source Bigtable + Dynamo
Cassandra: Open Source Bigtable + Dynamojbellis
 
Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Chris Richardson
 
Couchbase presentation
Couchbase presentationCouchbase presentation
Couchbase presentationsharonyb
 
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More FlexibilityNOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More FlexibilityIvan Zoratti
 
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source EffortsCassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source EffortsAcunu
 
Spil Games @ FOSDEM: Galera Replicator IRL
Spil Games @ FOSDEM: Galera Replicator IRLSpil Games @ FOSDEM: Galera Replicator IRL
Spil Games @ FOSDEM: Galera Replicator IRLspil-engineering
 
Hadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and Beyond
Hadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and BeyondHadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and Beyond
Hadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and BeyondErik Krogen
 
Bay area Cassandra Meetup 2011
Bay area Cassandra Meetup 2011Bay area Cassandra Meetup 2011
Bay area Cassandra Meetup 2011mubarakss
 
MySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion QueriesMySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion QueriesBernd Ocklin
 
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
 
Evaluating NoSQL Performance: Time for Benchmarking
Evaluating NoSQL Performance: Time for BenchmarkingEvaluating NoSQL Performance: Time for Benchmarking
Evaluating NoSQL Performance: Time for BenchmarkingSergey Bushik
 
第17回Cassandra勉強会: MyCassandra
第17回Cassandra勉強会: MyCassandra第17回Cassandra勉強会: MyCassandra
第17回Cassandra勉強会: MyCassandraShun Nakamura
 

Was ist angesagt? (20)

Project Voldemort
Project VoldemortProject Voldemort
Project Voldemort
 
Cassandra nyc 2011 ilya maykov - ooyala - scaling video analytics with apac...
Cassandra nyc 2011   ilya maykov - ooyala - scaling video analytics with apac...Cassandra nyc 2011   ilya maykov - ooyala - scaling video analytics with apac...
Cassandra nyc 2011 ilya maykov - ooyala - scaling video analytics with apac...
 
Introduction to Cassandra Architecture
Introduction to Cassandra ArchitectureIntroduction to Cassandra Architecture
Introduction to Cassandra Architecture
 
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scaleHow LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
 
NoSQL_Night
NoSQL_NightNoSQL_Night
NoSQL_Night
 
Cassandra: Open Source Bigtable + Dynamo
Cassandra: Open Source Bigtable + DynamoCassandra: Open Source Bigtable + Dynamo
Cassandra: Open Source Bigtable + Dynamo
 
Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)
 
Couchbase presentation
Couchbase presentationCouchbase presentation
Couchbase presentation
 
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More FlexibilityNOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
 
memcached Distributed Cache
memcached Distributed Cachememcached Distributed Cache
memcached Distributed Cache
 
NoSQL
NoSQLNoSQL
NoSQL
 
Database TCO
Database TCODatabase TCO
Database TCO
 
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source EffortsCassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
 
Spil Games @ FOSDEM: Galera Replicator IRL
Spil Games @ FOSDEM: Galera Replicator IRLSpil Games @ FOSDEM: Galera Replicator IRL
Spil Games @ FOSDEM: Galera Replicator IRL
 
Hadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and Beyond
Hadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and BeyondHadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and Beyond
Hadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and Beyond
 
Bay area Cassandra Meetup 2011
Bay area Cassandra Meetup 2011Bay area Cassandra Meetup 2011
Bay area Cassandra Meetup 2011
 
MySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion QueriesMySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion Queries
 
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
 
Evaluating NoSQL Performance: Time for Benchmarking
Evaluating NoSQL Performance: Time for BenchmarkingEvaluating NoSQL Performance: Time for Benchmarking
Evaluating NoSQL Performance: Time for Benchmarking
 
第17回Cassandra勉強会: MyCassandra
第17回Cassandra勉強会: MyCassandra第17回Cassandra勉強会: MyCassandra
第17回Cassandra勉強会: MyCassandra
 

Andere mochten auch

Graph db: time for serious stuff @ codemotion 23/03/2012
Graph db: time for serious stuff @ codemotion 23/03/2012Graph db: time for serious stuff @ codemotion 23/03/2012
Graph db: time for serious stuff @ codemotion 23/03/2012David Funaro
 
Graph databases in PHP @ PHPCon Poland 10-22-2011
Graph databases in PHP @ PHPCon Poland 10-22-2011Graph databases in PHP @ PHPCon Poland 10-22-2011
Graph databases in PHP @ PHPCon Poland 10-22-2011David Funaro
 
CMF: a pain in the F @ PHPDay 05-14-2011
CMF: a pain in the F @ PHPDay 05-14-2011CMF: a pain in the F @ PHPDay 05-14-2011
CMF: a pain in the F @ PHPDay 05-14-2011David Funaro
 
The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014David Funaro
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013David Funaro
 
Back your app with MySQL and Redis on Cloud Foundry
Back your app with MySQL and Redis on Cloud FoundryBack your app with MySQL and Redis on Cloud Foundry
Back your app with MySQL and Redis on Cloud FoundryKenny Bastani
 

Andere mochten auch (7)

Graph db: time for serious stuff @ codemotion 23/03/2012
Graph db: time for serious stuff @ codemotion 23/03/2012Graph db: time for serious stuff @ codemotion 23/03/2012
Graph db: time for serious stuff @ codemotion 23/03/2012
 
Graph databases in PHP @ PHPCon Poland 10-22-2011
Graph databases in PHP @ PHPCon Poland 10-22-2011Graph databases in PHP @ PHPCon Poland 10-22-2011
Graph databases in PHP @ PHPCon Poland 10-22-2011
 
One size fit All
One size fit AllOne size fit All
One size fit All
 
CMF: a pain in the F @ PHPDay 05-14-2011
CMF: a pain in the F @ PHPDay 05-14-2011CMF: a pain in the F @ PHPDay 05-14-2011
CMF: a pain in the F @ PHPDay 05-14-2011
 
The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013
 
Back your app with MySQL and Redis on Cloud Foundry
Back your app with MySQL and Redis on Cloud FoundryBack your app with MySQL and Redis on Cloud Foundry
Back your app with MySQL and Redis on Cloud Foundry
 

Ähnlich wie NoSQL overview #phptostart turin 11.07.2011

Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQLYan Cui
 
An Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDBAn Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDBWilliam LaForest
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydbDaniel Austin
 
PayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL ClusterPayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL ClusterMat Keep
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataRoger Xia
 
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedInJay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedInLinkedIn
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQLDon Demcsak
 
NOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the CloudNOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the Cloudboorad
 
SDEC2011 NoSQL Data modelling
SDEC2011 NoSQL Data modellingSDEC2011 NoSQL Data modelling
SDEC2011 NoSQL Data modellingKorea Sdec
 
Big Data Platforms: An Overview
Big Data Platforms: An OverviewBig Data Platforms: An Overview
Big Data Platforms: An OverviewC. Scyphers
 
NoSQL Intro with cassandra
NoSQL Intro with cassandraNoSQL Intro with cassandra
NoSQL Intro with cassandraBrian Enochson
 

Ähnlich wie NoSQL overview #phptostart turin 11.07.2011 (20)

Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
An Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDBAn Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDB
 
NoSQL
NoSQLNoSQL
NoSQL
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydb
 
PayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL ClusterPayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL Cluster
 
Anti-social Databases
Anti-social DatabasesAnti-social Databases
Anti-social Databases
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedInJay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
 
My sql tutorial-oscon-2012
My sql tutorial-oscon-2012My sql tutorial-oscon-2012
My sql tutorial-oscon-2012
 
NOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the CloudNOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the Cloud
 
Mongodb my
Mongodb myMongodb my
Mongodb my
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
SDEC2011 NoSQL Data modelling
SDEC2011 NoSQL Data modellingSDEC2011 NoSQL Data modelling
SDEC2011 NoSQL Data modelling
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
How and when to use NoSQL
How and when to use NoSQLHow and when to use NoSQL
How and when to use NoSQL
 
Big Data Platforms: An Overview
Big Data Platforms: An OverviewBig Data Platforms: An Overview
Big Data Platforms: An Overview
 
NoSQL Intro with cassandra
NoSQL Intro with cassandraNoSQL Intro with cassandra
NoSQL Intro with cassandra
 
Drop acid
Drop acidDrop acid
Drop acid
 

Kürzlich hochgeladen

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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Kürzlich hochgeladen (20)

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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

NoSQL overview #phptostart turin 11.07.2011

  • 1. Torino, 11 luglio 2011 NoSQL PHP.TO.START David Funaro
  • 2. What about me ? • sw engineer • PHP developer (2002) • Symfony Framework developer (2009) • Mobile developer ( iOs / Symbian ) • Senior developer @ dnsee • PHP user group Rome Founder • Open Source contributor
  • 3. Database - logical model Other RDBMS NOSQL
  • 4. Relational DB • In the *70’s • SQL ,relational algebra & set theory • excellent for applications such as management ( accounting, reservations, management staff)
  • 5. ACID Transactions work in the right mode if the database can satisfy this four properties: • Atomic • Consistency • Isolation • Durability
  • 6. Database - logical model Other RDBMS NOSQL
  • 8. Database - logical model Document Oriented Column Key Oriented Value Graph DB NOSql
  • 10. NOSql != One Size fits all Not Only Sql
  • 11. Historical Intro The concept of “non relational database” is older than the “relational model” but has been resumed and improved technology comes back
  • 14. New Requirements half *90’s with the new internet-based systems the Consistency and the Security of data are no longer enough
  • 15. New Requirements half *90’s with the new internet-based systems the Consistency and the Security of data are no longer enough the new need is the Hight availability
  • 16. Google • distributed storage system • scale file dimension up to Petabyte Wide applicability Scalability High performance High availability
  • 17. Google BigTable column - Oriented DB • Web indexing • Google Earth • Google Finance • Orkut • Custom Search • Google Docs
  • 18. Amazon • Relational model doesn’t fit requirements • 10 of thousand of server around the world • 10 Millions customers High Reliability High scale
  • 19. Amazon Dynamo Key-Value Store Database • High Reliability • High Scale
  • 21. Web Company • Startup with explosive growth: • DBMS open source • v 1.0 - 1 node , becomes soon inadequate • next version: • Horizontal Partitioning (sharding) • implement the node routing inside the application logic
  • 22. Web Company • Re-implement inter-node query • Handle inter-node transaction • Node failure increasingly likely - less reliability - less availability • “Hot” Data restructuring and data redistribuition becomes hard
  • 23. Solution • Scalability, very simple operations, } but on many nodes • Performance, low latency web • Productivity Application • Flexibility (data structure) needs • Skill to distribute data on many nodes
  • 24. Compromise • SQL Renounce • less strict transactions
  • 25. Query Language Leave a standard query language like SQL, and embrace a different kind of query language based on the selected product • SQL like • map-reduce • SparQL • ...
  • 26. CAP Theorem(2009) • Consistency • Availability • Partition Tollerance Eric Brewer It’s impossibile to have all of them at the same time in a distributed system.You have to choose only two.
  • 27. Consistency • Strong: After the update completes any subsequent access will return the updated N1 value. • Weak: The system does not guarantee that subsequent accesses will return the updated N2 value. tk tk • Eventually: The storage system guarantees that N6 if no new updates are made to the object tk eventually (after the inconsistency window tk closes) all accesses will return the last N5 updated value. N4
  • 28. Consistency • Strong: After the update completes any subsequent access will return the updated N1 value. • Weak: The system does not guarantee that subsequent accesses will return the updated N2 value. tk tk • Eventually: The storage system guarantees that N6 if no new updates are made to the object tk eventually (after the inconsistency window tk closes) all accesses will return the last N5 updated value. N4
  • 29. Facebook Cassandra • Key-Value store • data model: BigTable • infrastructure: Amazon-Dynamo • Eventual Consistency • High Availability
  • 30. Search Best Solution Just find the right way to manage your data-set
  • 31. context purpose Technology Focus Cost of implementation
  • 32. choose bike => (climb the mountain)
  • 33. choose bike => (climb the mountain)
  • 34. choose bike => (climb the mountain)
  • 35. choose bike => (climb the mountain)
  • 36. choose bike => (climb the mountain) Know available tools
  • 38. Key Value Store One Key -> One Value it’s like an HASH db knows information about “key” type (integer, float, ...), nothing about the value very fast ‘name’ => ‘david’ key value
  • 39. Key Value Store performance high Scalability high • redis • memcached Flexibility high • dynamo Complexity none • voldemort Functionality variabile(none)
  • 40. Document Oriented • key -> document • structured document • schema-less { name: ‘david’, surname: ‘funaro’, age: ’18’, user_13 => mail: { home : ‘ing.davidino@gmail.com’, key office: ‘d.funaro@dnsee.com‘ } } document
  • 41. Document Oriented performance high Scalability variable (high) Flexibility high Complexity low Functionality variabile(low)
  • 42. Graph DB • composed by Vertices and Edges • Vertices connected by Edges • Edge has a Label and Direction • Edges and Vertices have Properties
  • 43. Graph DB Funaro surname David na User_2 me friend User_1 dnsee work friend User_3 fri en d User_3
  • 44. Graph DB performance variable Scalability variable • neo4J Flexibility high • OrientDB Complexity high • infogrid • VertexDB Functionality graph theory
  • 45. Why NOSql some case example
  • 46. A Graph RDBMS Users Followee id name salary id_1 id_2 2 4 1 ale 200 3 1 2 marco 230 3 4 3 david 340 3 2 1 5 4 sergio 349 5 3 5 andre 200 5 2
  • 47. A Graph RDBMS Users Followee id name salary id_1 id_2 2 4 handled as BTree101 1 ale 200 3 1 2 marco 230 3 4 3 david 340 3 2 1 5 4 sergio 349 5 3 5 andre 200 5 2
  • 48. A Graph RDBMS Lookup david’s id [Log(N)] N = # users Look K Followees [Log(N)] Get their names [K*Log(N)]
  • 49. Graph DB Marco Sergio Lookup David Log(N) David Lookup for Followees O(K) Andrea Ale
  • 50. Benchmark Deph RDBMS Graph 1 100ms 30ms • 1 Million Vertex 2 1000ms 500ms • 4 Million Edge 3 10000ms 3000ms • Scale Free Tolopogy 4 100000ms 50000ms • Postgres VS Neo4J 5 N/A 100000ms • Both Hash and BTree http://markorodriguez.com/2011/02/18/mysql-vs-neo4j-on-a-large-scale-graph-traversal/
  • 51. Schema RDBMS NOSql - Documentale CREATE TABLE `pma_bookmark` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `surname` varchar(255) NOT NULL default '', `mobile` varchar(255) NOT NULL default '', `url` text NOT NULL, ... `name` varchar(255) NOT NULL default '', ... Schema Less `telex` varchar(255) NOT NULL default '', `fax` varchar(255) NOT NULL default '', `office` text NOT NULL, PRIMARY KEY (`id`) );
  • 52. Schema 2 id name surname mobile url ... telex office telex ... 1 david funaro 3548 davidfunaro.com null null 3548631 null null 2 alessandro nadalin 3257 null null null 32458 5456 null 3 marco rossi 3548 null null null null 515648 null too value set to NULL user :{ user :{ user :{ name: david, name: alessandro, name: marco, surname: funaro, surname: nadalin, surname: rossi, mobile : 3454, mobile : 6262, telex: 3434 url: davidfunaro.com, office: 342343, } office: 3423423, telex: 3434 } } Each Document has only the required fields
  • 53. Schema less • flexibility to handle the data model fields • the model can grow easily
  • 54. Performance ====== SET ====== 100007 requests completed in 0.88 seconds 50 parallel clients 3 bytes payload keep alive: 1 ====== GET ====== 100000 requests completed in 1.23 seconds 50 parallel clients 3 bytes payload keep alive: 1 http://redis.io/topics/benchmarks http://research.yahoo.com/files/ycsb-v4.pdf
  • 56. OrientDB library for PHP https://github.com/congow/Orient A Set of tools to use and manage any OrientDB instance from PHP. Orient includes: •the HTTP protocol binding •the query builder •the data mapper ( Object Graph Mapper )
  • 57. Thanks • David Funaro • http://davidfunaro.com • @ingdavidino • ing.davidino@gmail.com
  • 58. credits http://www.slideshare.net/ClaudioMartella/presentation-7398682?from=ss_embed http:// www.slideshare.net/harrikauhanen/nosql-3376398 http://www.slideshare.net/ingdavidino/cmf-a- pain-in-the-f-phpday-05142011 http://it.wikipedia.org/wiki/Modello_relazionale http:// www.slideshare.net/gabriele.lana/nosql-7405964 http://blog.indigenidigitali.com/l-ecosistema- nosql/ http://www.dia.uniroma3.it/~torlone/bd2/noSQL-1.pdf http://nosql-database.org/