SlideShare a Scribd company logo
1 of 73
Download to read offline
To SQL
                              OR


                        No (T) SQL?
 PHPNW 2012 Jeroen van Dijk




Sunday, October 7, 12
JEROEN VAN DIJK



         ∂ Nerd chief @ ENRISE
         ∂ PHPBenelux board member
         ∂ Zend Certified Engineer
         ∂ Web technology freak
         ∂ Open source addict

                        JEROEN@ENRISE.COM   @NEOREY




Sunday, October 7, 12
THE ENRISE RESTAURANT




                  ∂ We want to prepare the best dishes
                  ∂ With the best ingredients
                  ∂ To create a magical client experience!


                  ∂ You engineers are our top chefs!


Sunday, October 7, 12
Sunday, October 7, 12
WHAT IS


        ACID?
Sunday, October 7, 12
Sunday, October 7, 12
EVER HEARD OF

                        CAP
                         THEOREM?

Sunday, October 7, 12
KNOW


                 ABC?
                  ∂ Courtesy of Tim Anglade


Sunday, October 7, 12
Always

                  ∂ Courtesy of Tim Anglade


Sunday, October 7, 12
Always
                              Be
                  ∂ Courtesy of Tim Anglade


Sunday, October 7, 12
Always
                              Be
                              Caching
                  ∂ Courtesy of Tim Anglade


Sunday, October 7, 12
Always
                              Be
                              Caching
                  ∂ Courtesy of Tim Anglade


Sunday, October 7, 12
JOIN THE HYPE?




           WANT!==HAVE

Sunday, October 7, 12
HAVE TO USE NOSQL?




                        SCALABILITY
                                       &
                        PERFORMANCE
Sunday, October 7, 12
HAVE TO USE NOSQL?




                        SCALABILITY
                                       &
                        PERFORMANCE
Sunday, October 7, 12
RECAP RDBMS GREATNESS


                  ∂     Standard Query Language
                  ∂     ACID: Atomicity, Consistency, Isolation, Durability
                  ∂     Supported by everyone and everything
                  ∂     Tuning options
                  ∂     Battle tested!
                  ∂     Open source?!


                        NOT ENOUGH?



Sunday, October 7, 12
MAKING LOADS OF MONEY?




Sunday, October 7, 12
BUY A BIGGER BOX




                                     18

Sunday, October 7, 12
NOT SO GREAT RDBMS FEATURES


                  ∂ Vertical scalability




Sunday, October 7, 12
NOT SO GREAT RDBMS FEATURES


                  ∂ Vertical scalability



                  ∂ Horizontal scalability




Sunday, October 7, 12
NOT SO GREAT RDBMS FEATURES


                  ∂ Vertical scalability



                  ∂ Horizontal scalability



                  ∂ Schema changes!




Sunday, October 7, 12
SINCE 2004




        DATA++++++

Sunday, October 7, 12
WHO NEEDS


     ACID!?
Sunday, October 7, 12
CAP THEOREM

                                      AVAILABILITY
                                           A




                                 C                   P
                        CONSISTENCY                  PARTITION TOLERANCE




Sunday, October 7, 12
CAP THEOREM

                                       AVAILABILITY
                                            A
                                  CA                  AP


                                          PICK
                                          TWO
                                 C                    P
                        CONSISTENCY                   PARTITION TOLERANCE
                                            CP




Sunday, October 7, 12
CAP THEOREM

                                                   AVAILABILITY
             MySQL (InnoDB, not MyISAM)                             A                    Dynamo      Voldemort


             PostgreSQL       SQL Server                                                 Cassandra      CouchDB

                                           CA                                       AP
             Oracle RAC       Neo4J                                                      SimpleDB    Riak



                                                             PICK
                                                             TWO
                                           C                                         P
                        CONSISTENCY                                                  PARTITION TOLERANCE
                                                                    CP

                                                       Hypertable        Hbase


                                            BigTable          MongoDB       Terrastore


                                           Couchbase            Memcache         Redis




Sunday, October 7, 12
RELATIONAL DATABASES

                             USERS                    COMMUNITIES
                        ID   FIRST      LAST             ID          NAME
                        1    Jeroen    van	
  Dijk        1     PHPNorthWest
                        2     Paul    Borgermans          2         PHPBenelux
                        3     Thijs     Feryn
                        4     Mike     van	
  Dam                     MEMBERS
                        5    Jeremy     Coates       ID       COM_ID USER_ID PRIMARY      NICK
                        6    Jenny      Wong         1          2       1       T
                                                                                1         neorey
                                                     2          2                2   1    paulb
                                                     3          2                3   1     thijs
                                                     4          1                4   0   dragonbe
                                                     5          2                4   1   dragonbe
                                                     6          1                5   1    coates
                                                     7          1                6   1   miss_jwo




Sunday, October 7, 12
4   NOSQL
                            TYPES


Sunday, October 7, 12
4 NOSQL MODELS


                                   KEY-VALUE




                                   COLUMN




                                   GRAPH




                                   DOCUMENT




Sunday, October 7, 12
4 NOSQL TYPES


                                  KEY-VALUE




                                  COLUMN




                                  GRAPH




                                  DOCUMENT




Sunday, October 7, 12
4 NOSQL TYPES


                                  KEY-VALUE




                                  COLUMN




                                  GRAPH




                                  DOCUMENT




Sunday, October 7, 12
4 NOSQL TYPES


                                  KEY-VALUE




                                  COLUMN




                                  GRAPH




                                  DOCUMENT




Sunday, October 7, 12
4 NOSQL TYPES


                        KEY-VALUE




                        COLUMN




                        GRAPH




                        DOCUMENT




                  ∂ 122 known NoSQL databases


Sunday, October 7, 12
4 NOSQL TYPES


                        KEY-VALUE




                        COLUMN




                        GRAPH




                        DOCUMENT




                  ∂ Focus from Redis, Riak, Neo4J, MongoDB


Sunday, October 7, 12
KEY - VALUE


                        KEY-VALUE   ∂   Schema-less design
                                    ∂   Just strings of data
                                    ∂   Hard to query
                        COLUMN
                                    ∂   Mostly in memory

                        GRAPH




                        DOCUMENT




Sunday, October 7, 12
KEY - VALUE


                        KEY-VALUE




                                        USER_1                USER_2
                        COLUMN
                                    “Jeroen van Dijk”   {
                                                            id: 3,
                                                            first: “Thijs”,
                        GRAPH
                                                            last: “Feryn”
                                                        }




                        DOCUMENT




Sunday, October 7, 12
REDIS


      KEY-VALUE
                        ∂   Blazing fast key-value implementation
                        ∂   Master - slave replication
                        ∂   Lots of methods to query data
      COLUMN
                        ∂   Notable options
                            ∂ Data types : Strings, hashes, lists, sets
      GRAPH                 ∂ Data expiration
                            ∂ Pub/Sub for messaging
      DOCUMENT




                  ∂ Reconsider when using Memcached


Sunday, October 7, 12
COLUMN


                        KEY-VALUE   ∂   BigTable or Dynamo style
                                    ∂   Consistent hashing
                                    ∂   Vector clocks
                        COLUMN
                                    ∂   Hinted hand off

                        GRAPH




                        DOCUMENT




Sunday, October 7, 12
COLUMN


                        KEY-VALUE   DATABASE
                                      USERS (COLUMN)
                                         USER_5
                        COLUMN                      FIRST        LAST       GROUP

                                                    Jeremy      Coates      PHPNW


                        GRAPH            USER_6
                                                    NAME         NICK

                                                  Jenny	
  Wong @miss_jwo
                        DOCUMENT




Sunday, October 7, 12
COLUMN


                        KEY-VALUE




                        COLUMN




                        GRAPH




                        DOCUMENT




                  ∂ Data stored in a ring


Sunday, October 7, 12
COLUMN

                                              D

      KEY-VALUE




      COLUMN


                                C                     A


      GRAPH




      DOCUMENT

                                              B



                  ∂ Consistent hashing with 4 nodes


Sunday, October 7, 12
COLUMN


      KEY-VALUE




      COLUMN




      GRAPH




      DOCUMENT




                  ∂ Partitioning as done by Riak


Sunday, October 7, 12
COLUMN


      KEY-VALUE




      COLUMN




      GRAPH




      DOCUMENT




                  ∂ First node joins the cluster, claims all partitions


Sunday, October 7, 12
COLUMN


      KEY-VALUE         N=3                          A

                                                           B


                                                               C
      COLUMN




      GRAPH




      DOCUMENT




                  ∂ Reading / writing is done to 3 nodes


Sunday, October 7, 12
COLUMN


      KEY-VALUE         N=3                          A

                                                         B

                        W=2                                  C
      COLUMN
                        R=2
      GRAPH




      DOCUMENT




                  ∂ Reading / writing succeeds with 2 valid responses


Sunday, October 7, 12
COLUMN


      KEY-VALUE         N=3                         A
                                                              [ Ov1,v2 ]
                                                          B

                        W=2                                   C       [ Ov1 ]
      COLUMN
                        R=2
                                                                  D
                                                                       [ Ov1,v2 ]
      GRAPH




      DOCUMENT




                  ∂ Node C down, while new write action


Sunday, October 7, 12
COLUMN


      KEY-VALUE         N=3                            A
                                                               [ Ov1,v2 ]
                                                           B

                        W=2                                    C       [ Ov1,v2 ]
      COLUMN
                        R=2
                                                                   D
                                                                        [ Ov1,v2 ]
      GRAPH




      DOCUMENT




                  ∂ Node D hands the new version off


Sunday, October 7, 12
RIAK


                        KEY-VALUE   ∂   Dynamo implementation
                                    ∂   MapReduce query style
                                    ∂   Multiple storage backends
                        COLUMN
                                    ∂   Notable options
                                        § Link walking (like Graph solutions)
                        GRAPH
                                        § Solr-like search interface
                                        § Secondary indexes
                        DOCUMENT




Sunday, October 7, 12
GRAPH


                        KEY-VALUE   ∂ Relations more important than entities
                                    ∂ From RDBMS perspective: SELF JOINS

                        COLUMN




                        GRAPH




                        DOCUMENT




Sunday, October 7, 12
GRAPH


                        KEY-VALUE




                        COLUMN




                        GRAPH




                        DOCUMENT




                  ∂ Facebook style


Sunday, October 7, 12
GRAPH


      KEY-VALUE




      COLUMN




      GRAPH




      DOCUMENT




                  ∂ Betweenness centrality


Sunday, October 7, 12
GRAPH


      KEY-VALUE




      COLUMN




      GRAPH




      DOCUMENT




                  ∂ Degree centrality


Sunday, October 7, 12
GRAPH


      KEY-VALUE




      COLUMN




      GRAPH




      DOCUMENT




                  ∂ Closeness centrality


Sunday, October 7, 12
GRAPH


      KEY-VALUE




      COLUMN




      GRAPH




      DOCUMENT




                  ∂ Twitter style


Sunday, October 7, 12
GRAPH


      KEY-VALUE



                                       2
      COLUMN                       1

                                           9       3           2
                                       1       2       1
      GRAPH                                                2
                                       3
                                           3

      DOCUMENT




                  ∂ TomTom style


Sunday, October 7, 12
GRAPH


      KEY-VALUE



                                       2
      COLUMN                       1

                                           9       3           2
                                       1       2       1
      GRAPH                                                2
                                       3
                                           3

      DOCUMENT




                  ∂ TomTom style


Sunday, October 7, 12
GRAPH


      KEY-VALUE



                                       2
      COLUMN                       1

                                           9       3           2
                                       1       2       1
      GRAPH                                                2
                                       3
                                           3

      DOCUMENT




                  ∂ TomTom style


Sunday, October 7, 12
NEO4J


      KEY-VALUE         ∂   ACID compliant
                        ∂   Enterprise product for HA ($$$)
                        ∂   Custom query language
      COLUMN
                        ∂   Notable options
                             § Self contained web admin
      GRAPH




      DOCUMENT




Sunday, October 7, 12
DOCUMENT


                        KEY-VALUE   ∂ Largest resemblance with RDBMS
                                    ∂ Familiar query language
                                      § $select->where(‘id’, $this->getId());
                        COLUMN
                                    ∂ Software architect more important

                        GRAPH




                        DOCUMENT




Sunday, October 7, 12
MONGODB


                                             USER_2                      USER_4
                        KEY-VALUE
                                    {                        {
                                        first: “Paul”,           first: “Michelangelo”,
                                        last: “Borgermans”       last: “van Dam”,
                                    }                            communities: [
                        COLUMN
                                                                    “PHPNW”: {
                                                                       id: 1,
                                                                       name: “PHPNW”
                                                                    },
                        GRAPH                                       “PHPBNL”: {
                                                                       id: 2,
                                                                       name: “PHPBenelux”
                                                                    }
                                                                 ]
                        DOCUMENT                             }




Sunday, October 7, 12
MONGODB


      KEY-VALUE         ∂   MySQL of its generation?!
                        ∂   Replicas structure
                        ∂   MapReduce
      COLUMN
                        ∂   Notable options
                            § Geo indexes
      GRAPH




      DOCUMENT
                        SMALLEST LEARNING CURVE!




Sunday, October 7, 12
USE CASES

                                    ∂ Rapid changing data which fits in memory
                        KEY-VALUE
                                    ∂ Analytics, logging, real-time data collection

                        COLUMN




                        GRAPH




                        DOCUMENT




Sunday, October 7, 12
USE CASES

                                    ∂ Rapid changing data which fits in memory
                        KEY-VALUE
                                    ∂ Analytics, logging, real-time data collection
                                    ∂ Very good availability & fault tolerance
                        COLUMN
                                    ∂ Applications where seconds of downtime hurt

                        GRAPH




                        DOCUMENT




Sunday, October 7, 12
USE CASES

                                    ∂ Rapid changing data which fits in memory
                        KEY-VALUE
                                    ∂ Analytics, logging, real-time data collection
                                    ∂ Very good availability & fault tolerance
                        COLUMN
                                    ∂ Applications where seconds of downtime hurt
                                    ∂ For rich interconnected data
                        GRAPH
                                    ∂ Social relational data, geo & maps data

                        DOCUMENT




Sunday, October 7, 12
USE CASES

                                    ∂ Rapid changing data which fits in memory
                        KEY-VALUE
                                    ∂ Analytics, logging, real-time data collection
                                    ∂ Very good availability & fault tolerance
                        COLUMN
                                    ∂ Applications where seconds of downtime hurt
                                    ∂ For rich interconnected data
                        GRAPH
                                    ∂ Social relational data, geo & maps data
                                    ∂ MySQL like usage with indexes
                        DOCUMENT
                                    ∂ Any type of data you’d fit in MySQL




Sunday, October 7, 12
NOSQL IS HERE TO STAY




                             THE
                        REPLACEMENTS

Sunday, October 7, 12
NOSQL IS HERE TO STAY




                             THE
                        REPLACEMENTS

Sunday, October 7, 12
ONE USEFUL INGREDIENT




Sunday, October 7, 12
MORE GREAT TASTES




Sunday, October 7, 12
∂ KLIK VOOR FOOTER

                                       70

Sunday, October 7, 12
Polyglot persistence?


                  ∂ KLIK VOOR FOOTER

                                                    71

Sunday, October 7, 12
∂ THANK YOU! FEEDBACK? JOIND.IN/6976


Sunday, October 7, 12
∂ MORE DETAILS? SCAN THIS CODE.
Sunday, October 7, 12

More Related Content

Similar to To SQL or No(t)SQL - PHPNW12

OpenStack-Design-Summit-HA-Pairs-Are-Not-The-Only-Answer copy.pdf
OpenStack-Design-Summit-HA-Pairs-Are-Not-The-Only-Answer copy.pdfOpenStack-Design-Summit-HA-Pairs-Are-Not-The-Only-Answer copy.pdf
OpenStack-Design-Summit-HA-Pairs-Are-Not-The-Only-Answer copy.pdfOpenStack Foundation
 
OpenStack Summit :: Redundancy Doesn't Always Mean "HA" or "Cluster"
OpenStack Summit :: Redundancy Doesn't Always Mean "HA" or "Cluster"OpenStack Summit :: Redundancy Doesn't Always Mean "HA" or "Cluster"
OpenStack Summit :: Redundancy Doesn't Always Mean "HA" or "Cluster"Randy Bias
 
TorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyTorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyBruno Oliveira
 
Using CartoDB to analyze OpenStreetMap data
Using CartoDB to analyze OpenStreetMap dataUsing CartoDB to analyze OpenStreetMap data
Using CartoDB to analyze OpenStreetMap dataandrewxhill
 
To SQL or No(t)SQL - PFCongres 2012
To SQL or No(t)SQL - PFCongres 2012To SQL or No(t)SQL - PFCongres 2012
To SQL or No(t)SQL - PFCongres 2012Jeroen van Dijk
 
Html5 new sword for interactive app
Html5 new sword for interactive appHtml5 new sword for interactive app
Html5 new sword for interactive appYohan Totting
 

Similar to To SQL or No(t)SQL - PHPNW12 (6)

OpenStack-Design-Summit-HA-Pairs-Are-Not-The-Only-Answer copy.pdf
OpenStack-Design-Summit-HA-Pairs-Are-Not-The-Only-Answer copy.pdfOpenStack-Design-Summit-HA-Pairs-Are-Not-The-Only-Answer copy.pdf
OpenStack-Design-Summit-HA-Pairs-Are-Not-The-Only-Answer copy.pdf
 
OpenStack Summit :: Redundancy Doesn't Always Mean "HA" or "Cluster"
OpenStack Summit :: Redundancy Doesn't Always Mean "HA" or "Cluster"OpenStack Summit :: Redundancy Doesn't Always Mean "HA" or "Cluster"
OpenStack Summit :: Redundancy Doesn't Always Mean "HA" or "Cluster"
 
TorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyTorqueBox - When Java meets Ruby
TorqueBox - When Java meets Ruby
 
Using CartoDB to analyze OpenStreetMap data
Using CartoDB to analyze OpenStreetMap dataUsing CartoDB to analyze OpenStreetMap data
Using CartoDB to analyze OpenStreetMap data
 
To SQL or No(t)SQL - PFCongres 2012
To SQL or No(t)SQL - PFCongres 2012To SQL or No(t)SQL - PFCongres 2012
To SQL or No(t)SQL - PFCongres 2012
 
Html5 new sword for interactive app
Html5 new sword for interactive appHtml5 new sword for interactive app
Html5 new sword for interactive app
 

More from Jeroen van Dijk

WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hackingJeroen van Dijk
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressJeroen van Dijk
 
WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hackingJeroen van Dijk
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressJeroen van Dijk
 
Beacons in Appcelerator Titanium
Beacons in Appcelerator TitaniumBeacons in Appcelerator Titanium
Beacons in Appcelerator TitaniumJeroen van Dijk
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumJeroen van Dijk
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumJeroen van Dijk
 
An app on the shoulders of giants
An app on the shoulders of giantsAn app on the shoulders of giants
An app on the shoulders of giantsJeroen van Dijk
 
Zend Server: Not just a PHP stack
Zend Server: Not just a PHP stackZend Server: Not just a PHP stack
Zend Server: Not just a PHP stackJeroen van Dijk
 
Refactoring using Codeception
Refactoring using CodeceptionRefactoring using Codeception
Refactoring using CodeceptionJeroen van Dijk
 
Liking Relevance - PHP North East 2014
Liking Relevance - PHP North East 2014Liking Relevance - PHP North East 2014
Liking Relevance - PHP North East 2014Jeroen van Dijk
 
Socializing a world of travel
Socializing a world of travelSocializing a world of travel
Socializing a world of travelJeroen van Dijk
 
Varnish, the high performance valhalla?
Varnish, the high performance valhalla?Varnish, the high performance valhalla?
Varnish, the high performance valhalla?Jeroen van Dijk
 
Varnish, the high performance valhalla?
Varnish, the high performance valhalla?Varnish, the high performance valhalla?
Varnish, the high performance valhalla?Jeroen van Dijk
 
Edge Side Includes in Zend Framework without Varnish
Edge Side Includes in Zend Framework without VarnishEdge Side Includes in Zend Framework without Varnish
Edge Side Includes in Zend Framework without VarnishJeroen van Dijk
 

More from Jeroen van Dijk (15)

WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hacking
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hacking
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
Beacons in Appcelerator Titanium
Beacons in Appcelerator TitaniumBeacons in Appcelerator Titanium
Beacons in Appcelerator Titanium
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in Titanium
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in Titanium
 
An app on the shoulders of giants
An app on the shoulders of giantsAn app on the shoulders of giants
An app on the shoulders of giants
 
Zend Server: Not just a PHP stack
Zend Server: Not just a PHP stackZend Server: Not just a PHP stack
Zend Server: Not just a PHP stack
 
Refactoring using Codeception
Refactoring using CodeceptionRefactoring using Codeception
Refactoring using Codeception
 
Liking Relevance - PHP North East 2014
Liking Relevance - PHP North East 2014Liking Relevance - PHP North East 2014
Liking Relevance - PHP North East 2014
 
Socializing a world of travel
Socializing a world of travelSocializing a world of travel
Socializing a world of travel
 
Varnish, the high performance valhalla?
Varnish, the high performance valhalla?Varnish, the high performance valhalla?
Varnish, the high performance valhalla?
 
Varnish, the high performance valhalla?
Varnish, the high performance valhalla?Varnish, the high performance valhalla?
Varnish, the high performance valhalla?
 
Edge Side Includes in Zend Framework without Varnish
Edge Side Includes in Zend Framework without VarnishEdge Side Includes in Zend Framework without Varnish
Edge Side Includes in Zend Framework without Varnish
 

Recently uploaded

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
+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...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

To SQL or No(t)SQL - PHPNW12

  • 1. To SQL OR No (T) SQL? PHPNW 2012 Jeroen van Dijk Sunday, October 7, 12
  • 2. JEROEN VAN DIJK ∂ Nerd chief @ ENRISE ∂ PHPBenelux board member ∂ Zend Certified Engineer ∂ Web technology freak ∂ Open source addict JEROEN@ENRISE.COM @NEOREY Sunday, October 7, 12
  • 3. THE ENRISE RESTAURANT ∂ We want to prepare the best dishes ∂ With the best ingredients ∂ To create a magical client experience! ∂ You engineers are our top chefs! Sunday, October 7, 12
  • 5. WHAT IS ACID? Sunday, October 7, 12
  • 7. EVER HEARD OF CAP THEOREM? Sunday, October 7, 12
  • 8. KNOW ABC? ∂ Courtesy of Tim Anglade Sunday, October 7, 12
  • 9. Always ∂ Courtesy of Tim Anglade Sunday, October 7, 12
  • 10. Always Be ∂ Courtesy of Tim Anglade Sunday, October 7, 12
  • 11. Always Be Caching ∂ Courtesy of Tim Anglade Sunday, October 7, 12
  • 12. Always Be Caching ∂ Courtesy of Tim Anglade Sunday, October 7, 12
  • 13. JOIN THE HYPE? WANT!==HAVE Sunday, October 7, 12
  • 14. HAVE TO USE NOSQL? SCALABILITY & PERFORMANCE Sunday, October 7, 12
  • 15. HAVE TO USE NOSQL? SCALABILITY & PERFORMANCE Sunday, October 7, 12
  • 16. RECAP RDBMS GREATNESS ∂ Standard Query Language ∂ ACID: Atomicity, Consistency, Isolation, Durability ∂ Supported by everyone and everything ∂ Tuning options ∂ Battle tested! ∂ Open source?! NOT ENOUGH? Sunday, October 7, 12
  • 17. MAKING LOADS OF MONEY? Sunday, October 7, 12
  • 18. BUY A BIGGER BOX 18 Sunday, October 7, 12
  • 19. NOT SO GREAT RDBMS FEATURES ∂ Vertical scalability Sunday, October 7, 12
  • 20. NOT SO GREAT RDBMS FEATURES ∂ Vertical scalability ∂ Horizontal scalability Sunday, October 7, 12
  • 21. NOT SO GREAT RDBMS FEATURES ∂ Vertical scalability ∂ Horizontal scalability ∂ Schema changes! Sunday, October 7, 12
  • 22. SINCE 2004 DATA++++++ Sunday, October 7, 12
  • 23. WHO NEEDS ACID!? Sunday, October 7, 12
  • 24. CAP THEOREM AVAILABILITY A C P CONSISTENCY PARTITION TOLERANCE Sunday, October 7, 12
  • 25. CAP THEOREM AVAILABILITY A CA AP PICK TWO C P CONSISTENCY PARTITION TOLERANCE CP Sunday, October 7, 12
  • 26. CAP THEOREM AVAILABILITY MySQL (InnoDB, not MyISAM) A Dynamo Voldemort PostgreSQL SQL Server Cassandra CouchDB CA AP Oracle RAC Neo4J SimpleDB Riak PICK TWO C P CONSISTENCY PARTITION TOLERANCE CP Hypertable Hbase BigTable MongoDB Terrastore Couchbase Memcache Redis Sunday, October 7, 12
  • 27. RELATIONAL DATABASES USERS COMMUNITIES ID FIRST LAST ID NAME 1 Jeroen van  Dijk 1 PHPNorthWest 2 Paul Borgermans 2 PHPBenelux 3 Thijs Feryn 4 Mike van  Dam MEMBERS 5 Jeremy Coates ID COM_ID USER_ID PRIMARY NICK 6 Jenny Wong 1 2 1 T 1 neorey 2 2 2 1 paulb 3 2 3 1 thijs 4 1 4 0 dragonbe 5 2 4 1 dragonbe 6 1 5 1 coates 7 1 6 1 miss_jwo Sunday, October 7, 12
  • 28. 4 NOSQL TYPES Sunday, October 7, 12
  • 29. 4 NOSQL MODELS KEY-VALUE COLUMN GRAPH DOCUMENT Sunday, October 7, 12
  • 30. 4 NOSQL TYPES KEY-VALUE COLUMN GRAPH DOCUMENT Sunday, October 7, 12
  • 31. 4 NOSQL TYPES KEY-VALUE COLUMN GRAPH DOCUMENT Sunday, October 7, 12
  • 32. 4 NOSQL TYPES KEY-VALUE COLUMN GRAPH DOCUMENT Sunday, October 7, 12
  • 33. 4 NOSQL TYPES KEY-VALUE COLUMN GRAPH DOCUMENT ∂ 122 known NoSQL databases Sunday, October 7, 12
  • 34. 4 NOSQL TYPES KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Focus from Redis, Riak, Neo4J, MongoDB Sunday, October 7, 12
  • 35. KEY - VALUE KEY-VALUE ∂ Schema-less design ∂ Just strings of data ∂ Hard to query COLUMN ∂ Mostly in memory GRAPH DOCUMENT Sunday, October 7, 12
  • 36. KEY - VALUE KEY-VALUE USER_1 USER_2 COLUMN “Jeroen van Dijk” { id: 3, first: “Thijs”, GRAPH last: “Feryn” } DOCUMENT Sunday, October 7, 12
  • 37. REDIS KEY-VALUE ∂ Blazing fast key-value implementation ∂ Master - slave replication ∂ Lots of methods to query data COLUMN ∂ Notable options ∂ Data types : Strings, hashes, lists, sets GRAPH ∂ Data expiration ∂ Pub/Sub for messaging DOCUMENT ∂ Reconsider when using Memcached Sunday, October 7, 12
  • 38. COLUMN KEY-VALUE ∂ BigTable or Dynamo style ∂ Consistent hashing ∂ Vector clocks COLUMN ∂ Hinted hand off GRAPH DOCUMENT Sunday, October 7, 12
  • 39. COLUMN KEY-VALUE DATABASE USERS (COLUMN) USER_5 COLUMN FIRST LAST GROUP Jeremy Coates PHPNW GRAPH USER_6 NAME NICK Jenny  Wong @miss_jwo DOCUMENT Sunday, October 7, 12
  • 40. COLUMN KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Data stored in a ring Sunday, October 7, 12
  • 41. COLUMN D KEY-VALUE COLUMN C A GRAPH DOCUMENT B ∂ Consistent hashing with 4 nodes Sunday, October 7, 12
  • 42. COLUMN KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Partitioning as done by Riak Sunday, October 7, 12
  • 43. COLUMN KEY-VALUE COLUMN GRAPH DOCUMENT ∂ First node joins the cluster, claims all partitions Sunday, October 7, 12
  • 44. COLUMN KEY-VALUE N=3 A B C COLUMN GRAPH DOCUMENT ∂ Reading / writing is done to 3 nodes Sunday, October 7, 12
  • 45. COLUMN KEY-VALUE N=3 A B W=2 C COLUMN R=2 GRAPH DOCUMENT ∂ Reading / writing succeeds with 2 valid responses Sunday, October 7, 12
  • 46. COLUMN KEY-VALUE N=3 A [ Ov1,v2 ] B W=2 C [ Ov1 ] COLUMN R=2 D [ Ov1,v2 ] GRAPH DOCUMENT ∂ Node C down, while new write action Sunday, October 7, 12
  • 47. COLUMN KEY-VALUE N=3 A [ Ov1,v2 ] B W=2 C [ Ov1,v2 ] COLUMN R=2 D [ Ov1,v2 ] GRAPH DOCUMENT ∂ Node D hands the new version off Sunday, October 7, 12
  • 48. RIAK KEY-VALUE ∂ Dynamo implementation ∂ MapReduce query style ∂ Multiple storage backends COLUMN ∂ Notable options § Link walking (like Graph solutions) GRAPH § Solr-like search interface § Secondary indexes DOCUMENT Sunday, October 7, 12
  • 49. GRAPH KEY-VALUE ∂ Relations more important than entities ∂ From RDBMS perspective: SELF JOINS COLUMN GRAPH DOCUMENT Sunday, October 7, 12
  • 50. GRAPH KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Facebook style Sunday, October 7, 12
  • 51. GRAPH KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Betweenness centrality Sunday, October 7, 12
  • 52. GRAPH KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Degree centrality Sunday, October 7, 12
  • 53. GRAPH KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Closeness centrality Sunday, October 7, 12
  • 54. GRAPH KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Twitter style Sunday, October 7, 12
  • 55. GRAPH KEY-VALUE 2 COLUMN 1 9 3 2 1 2 1 GRAPH 2 3 3 DOCUMENT ∂ TomTom style Sunday, October 7, 12
  • 56. GRAPH KEY-VALUE 2 COLUMN 1 9 3 2 1 2 1 GRAPH 2 3 3 DOCUMENT ∂ TomTom style Sunday, October 7, 12
  • 57. GRAPH KEY-VALUE 2 COLUMN 1 9 3 2 1 2 1 GRAPH 2 3 3 DOCUMENT ∂ TomTom style Sunday, October 7, 12
  • 58. NEO4J KEY-VALUE ∂ ACID compliant ∂ Enterprise product for HA ($$$) ∂ Custom query language COLUMN ∂ Notable options § Self contained web admin GRAPH DOCUMENT Sunday, October 7, 12
  • 59. DOCUMENT KEY-VALUE ∂ Largest resemblance with RDBMS ∂ Familiar query language § $select->where(‘id’, $this->getId()); COLUMN ∂ Software architect more important GRAPH DOCUMENT Sunday, October 7, 12
  • 60. MONGODB USER_2 USER_4 KEY-VALUE { { first: “Paul”, first: “Michelangelo”, last: “Borgermans” last: “van Dam”, } communities: [ COLUMN “PHPNW”: { id: 1, name: “PHPNW” }, GRAPH “PHPBNL”: { id: 2, name: “PHPBenelux” } ] DOCUMENT } Sunday, October 7, 12
  • 61. MONGODB KEY-VALUE ∂ MySQL of its generation?! ∂ Replicas structure ∂ MapReduce COLUMN ∂ Notable options § Geo indexes GRAPH DOCUMENT SMALLEST LEARNING CURVE! Sunday, October 7, 12
  • 62. USE CASES ∂ Rapid changing data which fits in memory KEY-VALUE ∂ Analytics, logging, real-time data collection COLUMN GRAPH DOCUMENT Sunday, October 7, 12
  • 63. USE CASES ∂ Rapid changing data which fits in memory KEY-VALUE ∂ Analytics, logging, real-time data collection ∂ Very good availability & fault tolerance COLUMN ∂ Applications where seconds of downtime hurt GRAPH DOCUMENT Sunday, October 7, 12
  • 64. USE CASES ∂ Rapid changing data which fits in memory KEY-VALUE ∂ Analytics, logging, real-time data collection ∂ Very good availability & fault tolerance COLUMN ∂ Applications where seconds of downtime hurt ∂ For rich interconnected data GRAPH ∂ Social relational data, geo & maps data DOCUMENT Sunday, October 7, 12
  • 65. USE CASES ∂ Rapid changing data which fits in memory KEY-VALUE ∂ Analytics, logging, real-time data collection ∂ Very good availability & fault tolerance COLUMN ∂ Applications where seconds of downtime hurt ∂ For rich interconnected data GRAPH ∂ Social relational data, geo & maps data ∂ MySQL like usage with indexes DOCUMENT ∂ Any type of data you’d fit in MySQL Sunday, October 7, 12
  • 66. NOSQL IS HERE TO STAY THE REPLACEMENTS Sunday, October 7, 12
  • 67. NOSQL IS HERE TO STAY THE REPLACEMENTS Sunday, October 7, 12
  • 69. MORE GREAT TASTES Sunday, October 7, 12
  • 70. ∂ KLIK VOOR FOOTER 70 Sunday, October 7, 12
  • 71. Polyglot persistence? ∂ KLIK VOOR FOOTER 71 Sunday, October 7, 12
  • 72. ∂ THANK YOU! FEEDBACK? JOIND.IN/6976 Sunday, October 7, 12
  • 73. ∂ MORE DETAILS? SCAN THIS CODE. Sunday, October 7, 12