SlideShare a Scribd company logo
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/

More Related Content

What's hot (20)

PDF
Project Voldemort
Gregory Pence
 
PPTX
Cassandra nyc 2011 ilya maykov - ooyala - scaling video analytics with apac...
ivmaykov
 
PDF
Introduction to Cassandra Architecture
nickmbailey
 
PPT
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
LinkedIn
 
PPT
NoSQL_Night
Clarence J M Tauro
 
PDF
Cassandra: Open Source Bigtable + Dynamo
jbellis
 
PDF
Developing polyglot persistence applications (SpringOne China 2012)
Chris Richardson
 
PPTX
Couchbase presentation
sharonyb
 
PDF
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
Ivan Zoratti
 
PPTX
memcached Distributed Cache
Aniruddha Chakrabarti
 
PPTX
NoSQL
dbulic
 
PDF
Database TCO
spil-engineering
 
PPTX
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Acunu
 
PPT
Spil Games @ FOSDEM: Galera Replicator IRL
spil-engineering
 
PPTX
Hadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and Beyond
Erik Krogen
 
KEY
Bay area Cassandra Meetup 2011
mubarakss
 
PDF
MySQL Cluster Scaling to a Billion Queries
Bernd Ocklin
 
PDF
High-Performance Storage Services with HailDB and Java
sunnygleason
 
PDF
Evaluating NoSQL Performance: Time for Benchmarking
Sergey Bushik
 
PDF
第17回Cassandra勉強会: MyCassandra
Shun Nakamura
 
Project Voldemort
Gregory Pence
 
Cassandra nyc 2011 ilya maykov - ooyala - scaling video analytics with apac...
ivmaykov
 
Introduction to Cassandra Architecture
nickmbailey
 
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
LinkedIn
 
NoSQL_Night
Clarence J M Tauro
 
Cassandra: Open Source Bigtable + Dynamo
jbellis
 
Developing polyglot persistence applications (SpringOne China 2012)
Chris Richardson
 
Couchbase presentation
sharonyb
 
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
Ivan Zoratti
 
memcached Distributed Cache
Aniruddha Chakrabarti
 
NoSQL
dbulic
 
Database TCO
spil-engineering
 
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Acunu
 
Spil Games @ FOSDEM: Galera Replicator IRL
spil-engineering
 
Hadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and Beyond
Erik Krogen
 
Bay area Cassandra Meetup 2011
mubarakss
 
MySQL Cluster Scaling to a Billion Queries
Bernd Ocklin
 
High-Performance Storage Services with HailDB and Java
sunnygleason
 
Evaluating NoSQL Performance: Time for Benchmarking
Sergey Bushik
 
第17回Cassandra勉強会: MyCassandra
Shun Nakamura
 

Viewers also liked (7)

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

Similar to NoSQL overview #phptostart turin 11.07.2011 (20)

PPTX
Big Data (NJ SQL Server User Group)
Don Demcsak
 
PPTX
Data Modeling for NoSQL
Tony Tam
 
PDF
NoSQL
Yousof Alsatom
 
PDF
Is NoSQL The Future of Data Storage?
Saltmarch Media
 
PPTX
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
Qian Lin
 
PDF
Seminar.2010.NoSql
roialdaag
 
PPTX
Intro to Big Data and NoSQL
Don Demcsak
 
PPTX
Master.pptx
KarthikR780430
 
PPTX
A Practical Look at the NOSQL and Big Data Hullabaloo
Andrew Brust
 
PPTX
NoSQL(NOT ONLY SQL)
Rahul P
 
PPTX
The Rise of NoSQL and Polyglot Persistence
Abdelmonaim Remani
 
PPTX
Choosing your NoSQL storage
Imteyaz Khan
 
PPTX
No sql introduction_v1.1.1
Fan Ang
 
PPT
Wmware NoSQL
Murat Çakal
 
PPTX
Big Data Platforms: An Overview
C. Scyphers
 
PDF
NoSQL Overview
adesso AG
 
PPTX
NoSQL and The Big Data Hullabaloo
Andrew Brust
 
PPTX
Module 2.2 Introduction to NoSQL Databases.pptx
NiramayKolalle
 
PDF
Mongodb my
Alexey Gaziev
 
PDF
MongoDB
SPBRUBY
 
Big Data (NJ SQL Server User Group)
Don Demcsak
 
Data Modeling for NoSQL
Tony Tam
 
Is NoSQL The Future of Data Storage?
Saltmarch Media
 
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
Qian Lin
 
Seminar.2010.NoSql
roialdaag
 
Intro to Big Data and NoSQL
Don Demcsak
 
Master.pptx
KarthikR780430
 
A Practical Look at the NOSQL and Big Data Hullabaloo
Andrew Brust
 
NoSQL(NOT ONLY SQL)
Rahul P
 
The Rise of NoSQL and Polyglot Persistence
Abdelmonaim Remani
 
Choosing your NoSQL storage
Imteyaz Khan
 
No sql introduction_v1.1.1
Fan Ang
 
Wmware NoSQL
Murat Çakal
 
Big Data Platforms: An Overview
C. Scyphers
 
NoSQL Overview
adesso AG
 
NoSQL and The Big Data Hullabaloo
Andrew Brust
 
Module 2.2 Introduction to NoSQL Databases.pptx
NiramayKolalle
 
Mongodb my
Alexey Gaziev
 
MongoDB
SPBRUBY
 
Ad

Recently uploaded (20)

PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

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 : ‘[email protected]’, key office: ‘[email protected]‘ } } 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 • [email protected]
  • 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/