To SQL or No(t)SQL - PHPNW12

3,085 views

Published on

Published in: Technology
1 Comment
6 Likes
Statistics
Notes
  • Hello
    dear,! Nice to meet you, A friend is A gift from God my name is success i went through your profile on this site and became interested in you please i will be very happy if you can contact me with my email address at (successlove418@ymail.com) so that i will tell you about myself and my pictures for you to know whom i am, Have a wonderful day!
    Best Regard
    success.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
3,085
On SlideShare
0
From Embeds
0
Number of Embeds
205
Actions
Shares
0
Downloads
84
Comments
1
Likes
6
Embeds 0
No embeds

No notes for slide

To SQL or No(t)SQL - PHPNW12

  1. To SQL OR No (T) SQL? PHPNW 2012 Jeroen van DijkSunday, 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 @NEOREYSunday, 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
  4. Sunday, October 7, 12
  5. WHAT IS ACID?Sunday, October 7, 12
  6. Sunday, October 7, 12
  7. EVER HEARD OF CAP THEOREM?Sunday, October 7, 12
  8. KNOW ABC? ∂ Courtesy of Tim AngladeSunday, October 7, 12
  9. Always ∂ Courtesy of Tim AngladeSunday, October 7, 12
  10. Always Be ∂ Courtesy of Tim AngladeSunday, October 7, 12
  11. Always Be Caching ∂ Courtesy of Tim AngladeSunday, October 7, 12
  12. Always Be Caching ∂ Courtesy of Tim AngladeSunday, October 7, 12
  13. JOIN THE HYPE? WANT!==HAVESunday, October 7, 12
  14. HAVE TO USE NOSQL? SCALABILITY & PERFORMANCESunday, October 7, 12
  15. HAVE TO USE NOSQL? SCALABILITY & PERFORMANCESunday, 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 18Sunday, October 7, 12
  19. NOT SO GREAT RDBMS FEATURES ∂ Vertical scalabilitySunday, October 7, 12
  20. NOT SO GREAT RDBMS FEATURES ∂ Vertical scalability ∂ Horizontal scalabilitySunday, 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 TOLERANCESunday, October 7, 12
  25. CAP THEOREM AVAILABILITY A CA AP PICK TWO C P CONSISTENCY PARTITION TOLERANCE CPSunday, 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 RedisSunday, 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_jwoSunday, October 7, 12
  28. 4 NOSQL TYPESSunday, October 7, 12
  29. 4 NOSQL MODELS KEY-VALUE COLUMN GRAPH DOCUMENTSunday, October 7, 12
  30. 4 NOSQL TYPES KEY-VALUE COLUMN GRAPH DOCUMENTSunday, October 7, 12
  31. 4 NOSQL TYPES KEY-VALUE COLUMN GRAPH DOCUMENTSunday, October 7, 12
  32. 4 NOSQL TYPES KEY-VALUE COLUMN GRAPH DOCUMENTSunday, October 7, 12
  33. 4 NOSQL TYPES KEY-VALUE COLUMN GRAPH DOCUMENT ∂ 122 known NoSQL databasesSunday, October 7, 12
  34. 4 NOSQL TYPES KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Focus from Redis, Riak, Neo4J, MongoDBSunday, October 7, 12
  35. KEY - VALUE KEY-VALUE ∂ Schema-less design ∂ Just strings of data ∂ Hard to query COLUMN ∂ Mostly in memory GRAPH DOCUMENTSunday, October 7, 12
  36. KEY - VALUE KEY-VALUE USER_1 USER_2 COLUMN “Jeroen van Dijk” { id: 3, first: “Thijs”, GRAPH last: “Feryn” } DOCUMENTSunday, 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 MemcachedSunday, October 7, 12
  38. COLUMN KEY-VALUE ∂ BigTable or Dynamo style ∂ Consistent hashing ∂ Vector clocks COLUMN ∂ Hinted hand off GRAPH DOCUMENTSunday, 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 DOCUMENTSunday, October 7, 12
  40. COLUMN KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Data stored in a ringSunday, October 7, 12
  41. COLUMN D KEY-VALUE COLUMN C A GRAPH DOCUMENT B ∂ Consistent hashing with 4 nodesSunday, October 7, 12
  42. COLUMN KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Partitioning as done by RiakSunday, October 7, 12
  43. COLUMN KEY-VALUE COLUMN GRAPH DOCUMENT ∂ First node joins the cluster, claims all partitionsSunday, October 7, 12
  44. COLUMN KEY-VALUE N=3 A B C COLUMN GRAPH DOCUMENT ∂ Reading / writing is done to 3 nodesSunday, 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 responsesSunday, 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 actionSunday, 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 offSunday, 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 DOCUMENTSunday, October 7, 12
  49. GRAPH KEY-VALUE ∂ Relations more important than entities ∂ From RDBMS perspective: SELF JOINS COLUMN GRAPH DOCUMENTSunday, October 7, 12
  50. GRAPH KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Facebook styleSunday, October 7, 12
  51. GRAPH KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Betweenness centralitySunday, October 7, 12
  52. GRAPH KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Degree centralitySunday, October 7, 12
  53. GRAPH KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Closeness centralitySunday, October 7, 12
  54. GRAPH KEY-VALUE COLUMN GRAPH DOCUMENT ∂ Twitter styleSunday, October 7, 12
  55. GRAPH KEY-VALUE 2 COLUMN 1 9 3 2 1 2 1 GRAPH 2 3 3 DOCUMENT ∂ TomTom styleSunday, October 7, 12
  56. GRAPH KEY-VALUE 2 COLUMN 1 9 3 2 1 2 1 GRAPH 2 3 3 DOCUMENT ∂ TomTom styleSunday, October 7, 12
  57. GRAPH KEY-VALUE 2 COLUMN 1 9 3 2 1 2 1 GRAPH 2 3 3 DOCUMENT ∂ TomTom styleSunday, October 7, 12
  58. NEO4J KEY-VALUE ∂ ACID compliant ∂ Enterprise product for HA ($$$) ∂ Custom query language COLUMN ∂ Notable options § Self contained web admin GRAPH DOCUMENTSunday, 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 DOCUMENTSunday, 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 DOCUMENTSunday, 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 DOCUMENTSunday, 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 DOCUMENTSunday, 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 MySQLSunday, October 7, 12
  66. NOSQL IS HERE TO STAY THE REPLACEMENTSSunday, October 7, 12
  67. NOSQL IS HERE TO STAY THE REPLACEMENTSSunday, October 7, 12
  68. ONE USEFUL INGREDIENTSunday, October 7, 12
  69. MORE GREAT TASTESSunday, October 7, 12
  70. ∂ KLIK VOOR FOOTER 70Sunday, October 7, 12
  71. Polyglot persistence? ∂ KLIK VOOR FOOTER 71Sunday, October 7, 12
  72. ∂ THANK YOU! FEEDBACK? JOIND.IN/6976Sunday, October 7, 12
  73. ∂ MORE DETAILS? SCAN THIS CODE.Sunday, October 7, 12

×