pocket data
play

Pocket Data The Case for TPC-MOBILE Oliver Kennedy, Jerry Ajay, - PowerPoint PPT Presentation

Pocket Data The Case for TPC-MOBILE Oliver Kennedy, Jerry Ajay, Geoff Challen, Lukasz Ziarek http://odin.cse.buffalo.edu/research/astral 1 The ODIn Lab @ Big Data! 2 The ODIn Lab @ Big Data! 2 The ODIn Lab @ Big Data! GB, TB or PB of


  1. Pocket Data The Case for TPC-MOBILE Oliver Kennedy, Jerry Ajay, Geoff Challen, Lukasz Ziarek http://odin.cse.buffalo.edu/research/astral 1 The ODIn Lab @

  2. Big Data! 2 The ODIn Lab @

  3. Big Data! 2 The ODIn Lab @

  4. Big Data! • GB, TB or PB of data! • Hundreds of thousands of updates per second • Thousands of nodes computing together! • “Virtually” infinite resources! 3 The ODIn Lab @

  5. Big Data! 4 The ODIn Lab @

  6. Big Data! TPC-H SSB TPC-C TPC-E TPC-DI YCSB TPC-DS 4 The ODIn Lab @

  7. Big Data! TPC-H SSB TPC-C TPC-E TPC-DI YCSB TPC-DS What about other types of databases? 4 The ODIn Lab @

  8. The average smartphone processes almost 180 thousand queries per day That’s about 2 queries per second 5 The ODIn Lab @

  9. 2 Queries per Second 6 The ODIn Lab @

  10. 2 Queries per Second • Is this Big Data? No! 6 The ODIn Lab @

  11. 2 Queries per Second • Is this Big Data? No! • Is this Important? 6 The ODIn Lab @

  12. 2 Queries per Second • Is this Big Data? No! • Is this Important? • Multi-Tenancy : The phone is more than just a DB. 6 The ODIn Lab @

  13. 2 Queries per Second • Is this Big Data? No! • Is this Important? • Multi-Tenancy : The phone is more than just a DB. • Power : 1-2 days of battery life under ideal circumstances. 6 The ODIn Lab @

  14. 2 Queries per Second • Is this Big Data? No! • Is this Important? • Multi-Tenancy : The phone is more than just a DB. • Power : 1-2 days of battery life under ideal circumstances. • It’s Everywhere : Odds are that your phone is running some queries right now! 6 The ODIn Lab @

  15. 2 Queries per Second • Is this Big Data? No! YES! • Is this Important? • Multi-Tenancy : The phone is more than just a DB. • Power : 1-2 days of battery life under ideal circumstances. • It’s Everywhere : Odds are that your phone is running some queries right now! 6 The ODIn Lab @

  16. We need to better understand pocket-scale data 7 The ODIn Lab @

  17. SQLite • Embedded : SQLite is a library Client Application • Un-shared : SQLite DBs are specific to one client “app”. • Lightweight : Entire SQLite DB is backed to one file. SQLite Library • Universal : SQLite client Android OS library is available by default in nearly all major OSes. • “Easy” : Duck Typing, Relaxed SQL Syntax, One Big Lock (file) 8 The ODIn Lab @

  18. How do developers and users use Pocket Scale Data? 9 The ODIn Lab @

  19. PhoneLab A Smartphone Platform Testbed ~200 UB students, faculty, and staff using instrumented LG Nexus 5 smartphones in exchange for discounted service. 10 The ODIn Lab @

  20. PhoneLab A Smartphone Platform Testbed • Preliminary Trial : 11 phones for ~1 month (254 phone/days) • Instrumented SQLite logs all statements (~45 mil statements) • ~33.5 million SELECT statements • ~9.4 million INSERT statements • ~1 million UPDATE statements • ~1.2 million DELETE statements • 179 distinct ‘apps’ issuing statements https://phone-lab.org/experiment/request 11 The ODIn Lab @

  21. • SELECT Complexity • ORM Effects • Function Usage • Read/Write Ratios • Query Periodicity 12 The ODIn Lab @

  22. • SELECT Complexity • ORM Effects • Function Usage • Read/Write Ratios • Query Periodicity 12 The ODIn Lab @

  23. SELECT Complexity 1x10 8 1x10 8 Number of SELECT Queries 1x10 7 1x10 7 1x10 6 1x10 6 100000 100000 10000 10000 1000 1000 100 100 10 10 1 0.1 1 1 2 3 4 5 6 7 8 1 2 3 4 Number of Tables Accessed Maximum Nesting Depth 13 The ODIn Lab @

  24. SELECT Complexity 30 million simple “SPA” queries 1x10 8 1x10 8 Number of SELECT Queries 1x10 7 1x10 7 1x10 6 1x10 6 100000 100000 10000 10000 1000 1000 100 100 10 10 1 0.1 1 1 2 3 4 5 6 7 8 1 2 3 4 Number of Tables Accessed Maximum Nesting Depth 13 The ODIn Lab @

  25. SELECT Complexity 30 million simple “SPA” queries 1x10 8 1x10 8 Number of SELECT Queries 1x10 7 1x10 7 1x10 6 1x10 6 100000 100000 10000 10000 1000 1000 100 100 10 10 1 0.1 1 1 2 3 4 5 6 7 8 1 2 3 4 Number of Tables Accessed Maximum Nesting Depth Infrequent, but extremely complex queries 13 The ODIn Lab @

  26. SELECT Complexity (by app) 1.0 0.9 0.8 0.7 0.6 CDF 0.5 0.4 0.3 0.2 0.1 0.0 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% % of SELECT Queries That Are Key-Value Queries 14 The ODIn Lab @

  27. SELECT Complexity (by app) 1.0 0.9 24 / 179 apps using SQLite 0.8 only as a K/V Store 0.7 0.6 CDF 0.5 0.4 0.3 0.2 0.1 0.0 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% % of SELECT Queries That Are Key-Value Queries 14 The ODIn Lab @

  28. SELECT Complexity INSERT OR REPLACE INTO properties(property_key,property_value) VALUES (?,?); SELECT property_value FROM properties WHERE property_key=?; (These are actual real queries from the trace) 15 The ODIn Lab @

  29. SELECT Complexity 1 . 0 0 . 9 0 . 8 0 . 7 0 . 6 CDF 0 . 5 0 . 4 0 . 3 0 . 2 0 . 1 0 . 0 10 0 10 1 10 2 10 3 10 4 Returned Row Count 16 The ODIn Lab @

  30. SELECT Complexity 1 . 0 0 . 9 0 . 8 0 . 7 0 . 6 CDF 0 . 5 0 . 4 0 . 3 0 . 2 0 . 1 0 . 0 10 0 10 1 10 2 10 3 10 4 80% of SELECTs Returned Row Count return one row 16 The ODIn Lab @

  31. SELECT Complexity 1 . 0 0 . 9 0 . 8 0 . 7 0 . 6 CDF 0 . 5 0 . 4 0 . 3 0 . 2 0 . 1 0 . 0 10 0 10 1 10 2 10 3 10 4 80% of SELECTs Small % of SELECTs Returned Row Count return one row return 100s of rows 16 The ODIn Lab @

  32. SELECT Complexity (by app) 1 . 0 0 . 9 0 . 8 0 . 7 0 . 6 CDF 0 . 5 0 . 4 0 . 3 0 . 2 0 . 1 0 . 0 10 0 10 1 10 2 10 3 10 4 Returned Row Count 17 The ODIn Lab @

  33. SELECT Complexity (by app) 1 . 0 0 . 9 0 . 8 0 . 7 0 . 6 CDF 0 . 5 Google+, 0 . 4 GMail, 0 . 3 Facebook, 0 . 2 0 . 1 Contacts 0 . 0 10 0 10 1 10 2 10 3 10 4 Returned Row Count 17 The ODIn Lab @

  34. • SELECT Complexity • ORM Effects • Function Usage • Read/Write Ratios • Query Periodicity 18 The ODIn Lab @

  35. Object-Relational Mapper 19 The ODIn Lab @ Image courtesy of http://openclipart.org

  36. pers = Persons.get(10) name = pers.firstName() Object-Relational Mapper 19 The ODIn Lab @ Image courtesy of http://openclipart.org

  37. pers = Persons.get(10) name = pers.firstName() Object-Relational Mapper SELECT first_name FROM Persons WHERE id = 10; 19 The ODIn Lab @ Image courtesy of http://openclipart.org

  38. pers = Persons.get(10) name = pers.firstName() Object-Relational Mapper SELECT first_name FROM Persons WHERE id = 10; SQL DB used for persisting objects 19 The ODIn Lab @ Image courtesy of http://openclipart.org

  39. pers = Persons.get(10) org = pers.employer() name = org.name() Object-Relational Mapper 20 The ODIn Lab @ Image courtesy of http://openclipart.org

  40. pers = Persons.get(10) org = pers.employer() name = org.name() Object-Relational SELECT employer_id Mapper FROM Persons WHERE id = 10; SELECT name FROM Organizations WHERE id = ?; 20 The ODIn Lab @ Image courtesy of http://openclipart.org

  41. pers = Persons.get(10) org = pers.employer() name = org.name() Object-Relational SELECT employer_id Mapper FROM Persons WHERE id = 10; SELECT name FROM Organizations WHERE id = ?; ORMs are not always efficient 20 The ODIn Lab @ Image courtesy of http://openclipart.org

  42. pers = Persons.get(10) pers.setSalary( pers.salary() * 1.1 ) Object-Relational Mapper 21 The ODIn Lab @ Image courtesy of http://openclipart.org

  43. pers = Persons.get(10) pers.setSalary( pers.salary() * 1.1 ) Object-Relational SELECT salary Mapper FROM Persons WHERE id = 10; UPDATE Persons SET salary = ? WHERE id = 10; 21 The ODIn Lab @ Image courtesy of http://openclipart.org

  44. pers = Persons.get(10) pers.setSalary( pers.salary() * 1.1 ) Object-Relational SELECT salary Mapper FROM Persons WHERE id = 10; UPDATE Persons SET salary = ? WHERE id = 10; We saw NO update value computations in SQL 21 The ODIn Lab @ Image courtesy of http://openclipart.org

  45. pers = Persons.get(10) pers.setSalary( pers.salary() * 1.1 ) Object-Relational SELECT salary Mapper FROM Persons WHERE id = 10; INSERT OR REPLACE INTO Persons(id, salary) VALUES (?, 10); 22 The ODIn Lab @ Image courtesy of http://openclipart.org

  46. pers = Persons.get(10) pers.setSalary( pers.salary() * 1.1 ) Object-Relational SELECT salary Mapper FROM Persons WHERE id = 10; INSERT OR REPLACE INTO Persons(id, salary) VALUES (?, 10); Insert or Replace used very frequently 22 The ODIn Lab @ Image courtesy of http://openclipart.org

  47. • SELECT Complexity • ORM Effects • Function Usage • Read/Write Ratios • Query Periodicity 23 The ODIn Lab @

  48. Aggregates Function Call Sites GROUP_CONCAT 583,474 SUM 321,387 MAX 314,970 COUNT 173,031 MIN 19,566 AVG 15 24 The ODIn Lab @

  49. Aggregates Function Call Sites GROUP_CONCAT 583,474 SUM 321,387 MAX 314,970 COUNT 173,031 MIN 19,566 AVG 15 Aggregates most common function type 24 The ODIn Lab @

  50. Aggregates Function Call Sites GROUP_CONCAT 583,474 SUM 321,387 MAX 314,970 COUNT 173,031 MIN 19,566 AVG 15 Concatenate all strings in a column: Non-algebraic 25 The ODIn Lab @

  51. Other Functions 26 The ODIn Lab @

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend