SlideShare une entreprise Scribd logo
1  sur  58
Télécharger pour lire hors ligne
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/

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 

Dernier (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

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/