Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

SQL or NoSQL - TrueNorthPHP

1,873 views

Published on

This is slides for my talk at TrueNorthPHP 2013.
Title of the talk is: "SQL or NoSQL that's the question"

Published in: Real Estate, Technology
  • Be the first to comment

SQL or NoSQL - TrueNorthPHP

  1. 1. OR S Q L NoSQL That’s T H E Ques.on
  2. 2. @majidfn MajiD Fatemian Ubisoft Montreal
  3. 3. BIG DATA
  4. 4. NoSQL
  5. 5. 1 2 3 No SQL Cluster Schemaless
  6. 6. Fitness Evolved
  7. 7. Fitness Evolved
  8. 8. STATS Users Concurrent Daily Activities 2.2M 10K 160K(Max) 40K (Avg)
  9. 9. 2012 2011 2013
  10. 10. 2012 2011 2013
  11. 11. Architecture 2011
  12. 12. + SQL / JOIN ACID Transaction Partitioning Replication Tools OPs Data Modeling
  13. 13. 2012 2011 2013
  14. 14. DATA Global Specific Profile Info. Deta i ls Aggregated stats Activities Community Events L ea de rbo a rds
  15. 15. + SQL / JOIN ACID Transaction Partitioning Replication Tools OPs Data Modeling Volume No Details Variant Schema Partitioning Scale out Sharding -
  16. 16. + SQL / JOIN ACID Transaction xbox v.1 xbox v.2 { { Partitioning player_id: 1234, player_id: 1234, game_id:Replication 1002, game_id: 4001, platform: wiiu, platform: xbox360, Tools * calories: 75, * calories: 40, OPs * duration: 120 * duration: 75, } difficulty_level: medium, Data Modeling jumping_ropes: 178, score: 450, endurance:3, category: 4 } Volume No Details Variant Schema Partitioning Scale out Sharding -
  17. 17. + SQL / JOIN ACID Transaction Partitioning Replication Tools OPs Data Modeling Volume No Details Variant Schema Partitioning Scale out Sharding -
  18. 18. Data Access Layer + SQL / JOIN ACID B A ta ta Transaction Da Da Partitioning Replication Tools OPs Data Modeling D ata C Volume No Details Variant Schema Partitioning Scale out Sharding -
  19. 19. + SQL / JOIN ACID Transaction Partitioning Replication Tools OPs Data Modeling Volume No Details Variant Schema Partitioning Scale out Sharding -
  20. 20. No SQL ...
  21. 21. mongoDB 1 2 3 OPs Support Community
  22. 22. + Schema-Less Aggregated Data Object Mapping Large Scale Data Sharding Map/Reduce Eventual Consistency Memory Storage Journaling
  23. 23. + Schema-Less Aggregated Data Object Mapping Large Scale Data Sharding Map/Reduce Eventual Consistency Memory Storage Journaling { * * } xbox v.1 player_id: 1234, game_id: 1002, platform: wiiu, calories: 75, duration: 120 { * * } WiiU player_id: 1234, game_id: 4001, platform: xbox360, calories: 40, duration: 75, difficulty_level: medium, jumping_ropes: 178, score: 450, endurance:3, category: 4
  24. 24. + Schema-Less Aggregated Data Object Mapping Large Scale Data Sharding Map/Reduce Eventual Consistency Memory Storage Journaling { player: { name: example, gender: M, country:CA } game_id: 4001, date: “2013-11-08”, calories: 40, duration: 75, }
  25. 25. + Schema-Less Aggregated Data Object Mapping Large Scale Data Sharding Map/Reduce Eventual Consistency Memory Storage Journaling ata D A ata D B ata D C
  26. 26. + Schema-Less Aggregated Data Object Mapping Large Scale Data Sharding Map/Reduce Eventual Consistency Memory Storage Journaling
  27. 27. + Schema-Less Aggregated Data Object Mapping Large Scale Data Sharding Map/Reduce Eventual Consistency Memory Storage Journaling - Denormalized data Disk Space Expertise Complex Querying Resource Usage DB-Level Locking
  28. 28. BENCH MARK
  29. 29. 0.02 0.015 0.01 0.005 0 Random Profile Search (1M) MySQL MongoDB Full History Retrieval (6M) Insert (6M) Aggregation Map/Reduce (6M)
  30. 30. Relational Data Model Schema Less Ease of Use Performance Sharding
  31. 31. GO! Hybrid
  32. 32. Config Server ste a r M v Sla e Shard 1 Replicaset Shard 2 Replicaset
  33. 33. Concerns ! Inconsistency 2 Consistency vs. Latency 3 Data Duplication 4 Complexity
  34. 34. Challenges ! 2 3 Availability Time Expertese
  35. 35. Data Access Layer OR
  36. 36. Plans Backup Failure
  37. 37. DATA Migration
  38. 38. 4 Profile Versioning !! 2 s One Shot Migration hr 1 ! ve Li
  39. 39. e rit W d R ea
  40. 40. TEST!
  41. 41. 1 2 3 Unit Functional Integration
  42. 42. Final Results
  43. 43. Scalability &...
  44. 44. Details User B.I.
  45. 45. Response Time ” 0.02 ” 0.0002
  46. 46. Architecture 2013 REST
  47. 47. > 1 year uptime
  48. 48. 1 Based on Requirements 2 Benchmark! 3 Choose Wisely!
  49. 49. Thank YOU! @majidfn https://joind.in/9977
  50. 50. References NoSQL MongoDB MySQL Distilled The definitive guide High Performance
  51. 51. we need YOU! http://montreal.ubisoft.com/en/video-games-jobs-my-career
  52. 52. Got Q? @majidfn

×