Live On Stage

3,472 views

Published on

Talk about Database staging at #phpday2010

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,472
On SlideShare
0
From Embeds
0
Number of Embeds
2,353
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide











































































































































  • Live On Stage

    1. 1. Live on Stage Dominik Jungowski - May 14, 2010 Live on Stage - Dominik Jungowski
    2. 2. Agenda 2 Live on Stage - Dominik Jungowski
    3. 3. Agenda ‣ What is Staging? 2 Live on Stage - Dominik Jungowski
    4. 4. Agenda ‣ What is Staging? ‣ Reasons for Staging 2 Live on Stage - Dominik Jungowski
    5. 5. Agenda ‣ What is Staging? ‣ Reasons for Staging ‣ Implementation 2 Live on Stage - Dominik Jungowski
    6. 6. Agenda ‣ What is Staging? ‣ Reasons for Staging ‣ Implementation ‣ Adding a staging layer 2 Live on Stage - Dominik Jungowski
    7. 7. Agenda ‣ What is Staging? ‣ Reasons for Staging ‣ Implementation ‣ Adding a staging layer ‣ Problems and Solutions 2 Live on Stage - Dominik Jungowski
    8. 8. About me 3 Live on Stage - Dominik Jungowski
    9. 9. About me ‣ 25 years old 3 Live on Stage - Dominik Jungowski
    10. 10. About me ‣ 25 years old ‣ Employed at CHIP Xonio Online GmbH 3 Live on Stage - Dominik Jungowski
    11. 11. About me ‣ 25 years old ‣ Employed at CHIP Xonio Online GmbH ➡ www.chip.de 3 Live on Stage - Dominik Jungowski
    12. 12. About me ‣ 25 years old ‣ Employed at CHIP Xonio Online GmbH ➡ www.chip.de ➡ download.chip.eu 3 Live on Stage - Dominik Jungowski
    13. 13. About me ‣ 25 years old ‣ Employed at CHIP Xonio Online GmbH ➡ www.chip.de ➡ download.chip.eu ‣ ScrumMaster and Developer at price comparison 3 Live on Stage - Dominik Jungowski
    14. 14. About me ‣ 25 years old ‣ Employed at CHIP Xonio Online GmbH ➡ www.chip.de ➡ download.chip.eu ‣ ScrumMaster and Developer at price comparison ‣ Part - time studies in Psychology at distance university FernUni Hagen 3 Live on Stage - Dominik Jungowski
    15. 15. What is staging? Live on Stage - Dominik Jungowski
    16. 16. What is Staging? Usual Database Design: 5 Live on Stage - Dominik Jungowski
    17. 17. What is Staging? Usual Database Design: Databa 5 Live on Stage - Dominik Jungowski
    18. 18. What is Staging? Usual Database Design: Databa Website 5 Live on Stage - Dominik Jungowski
    19. 19. What is Staging? Usual Database Design: Databa Website 5 Live on Stage - Dominik Jungowski
    20. 20. What is Staging? Usual Database Design: Databa Website Admin 5 Live on Stage - Dominik Jungowski
    21. 21. What is Staging? Usual Database Design: Databa Website Admin 5 Live on Stage - Dominik Jungowski
    22. 22. What is Staging? Staging Database Design: 6 Live on Stage - Dominik Jungowski
    23. 23. What is Staging? Staging Database Design: Databa 6 Live on Stage - Dominik Jungowski
    24. 24. What is Staging? Staging Database Design: Databa Website 6 Live on Stage - Dominik Jungowski
    25. 25. What is Staging? Staging Database Design: Databa Website 6 Live on Stage - Dominik Jungowski
    26. 26. What is Staging? Staging Database Design: Databa Databa Website 6 Live on Stage - Dominik Jungowski
    27. 27. What is Staging? Staging Database Design: Databa Databa Website Admin 6 Live on Stage - Dominik Jungowski
    28. 28. What is Staging? Staging Database Design: Databa Databa Website Admin 6 Live on Stage - Dominik Jungowski
    29. 29. What is Staging? Staging Database Design: Databa Databa Website Admin 6 Live on Stage - Dominik Jungowski
    30. 30. What is Staging? Staging Database Design: Databa Sync Databa Website Admin 6 Live on Stage - Dominik Jungowski
    31. 31. Reasons for staging Live on Stage - Dominik Jungowski
    32. 32. Reasons for Staging 8 Live on Stage - Dominik Jungowski
    33. 33. Reasons for Staging ‣ Security 8 Live on Stage - Dominik Jungowski
    34. 34. Reasons for Staging ‣ Security ➡ no sensitive data on live system 8 Live on Stage - Dominik Jungowski
    35. 35. Reasons for Staging ‣ Security ➡ no sensitive data on live system ➡ only the essential data is synced 8 Live on Stage - Dominik Jungowski
    36. 36. Reasons for Staging ‣ Security ➡ no sensitive data on live system ➡ only the essential data is synced ‣ Quality 8 Live on Stage - Dominik Jungowski
    37. 37. Reasons for Staging ‣ Security ➡ no sensitive data on live system ➡ only the essential data is synced ‣ Quality ➡ no changes directly on live system 8 Live on Stage - Dominik Jungowski
    38. 38. Reasons for Staging ‣ Security ➡ no sensitive data on live system ➡ only the essential data is synced ‣ Quality ➡ no changes directly on live system ➡ more time to prevent corruption/errors on live system (user errors, broken imports, etc.) 8 Live on Stage - Dominik Jungowski
    39. 39. Reasons for Staging ‣ Performance 9 Live on Stage - Dominik Jungowski
    40. 40. Reasons for Staging ‣ Performance ➡ Normalized data on staging database 9 Live on Stage - Dominik Jungowski
    41. 41. Reasons for Staging ‣ Performance ➡ Normalized data on staging database ➡ Performance optimized / flat data on live database 9 Live on Stage - Dominik Jungowski
    42. 42. Reasons for Staging ‣ Performance ➡ Normalized data on staging database ➡ Performance optimized / flat data on live database ➡ no constraints on live system possible 9 Live on Stage - Dominik Jungowski
    43. 43. Implementat ion Live on Stage - Dominik Jungowski
    44. 44. Implementation 11 Live on Stage - Dominik Jungowski
    45. 45. Implementation ‣ Data is synced 11 Live on Stage - Dominik Jungowski
    46. 46. Implementation ‣ Data is synced ➡ some kind of status flag in staging db is needed 11 Live on Stage - Dominik Jungowski
    47. 47. Implementation ‣ Data is synced ➡ some kind of status flag in staging db is needed ‣ Status needed for 11 Live on Stage - Dominik Jungowski
    48. 48. Implementation ‣ Data is synced ➡ some kind of status flag in staging db is needed ‣ Status needed for ➡ Changed data 11 Live on Stage - Dominik Jungowski
    49. 49. Implementation ‣ Data is synced ➡ some kind of status flag in staging db is needed ‣ Status needed for ➡ Changed data ➡ Unchanged data 11 Live on Stage - Dominik Jungowski
    50. 50. Implementation ‣ Data is synced ➡ some kind of status flag in staging db is needed ‣ Status needed for ➡ Changed data ➡ Unchanged data ➡ Deleted data on staging, but not on live system 11 Live on Stage - Dominik Jungowski
    51. 51. Implementation ‣ Data is synced ➡ some kind of status flag in staging db is needed ‣ Status needed for ➡ Changed data ➡ Unchanged data ➡ Deleted data on staging, but not on live system ‣ Maybe useful 11 Live on Stage - Dominik Jungowski
    52. 52. Implementation ‣ Data is synced ➡ some kind of status flag in staging db is needed ‣ Status needed for ➡ Changed data ➡ Unchanged data ➡ Deleted data on staging, but not on live system ‣ Maybe useful ➡ Deleted on live system 11 Live on Stage - Dominik Jungowski
    53. 53. Implementation The Status - Cycle 12 Live on Stage - Dominik Jungowski
    54. 54. Implementation The Status - Cycle Import 12 Live on Stage - Dominik Jungowski
    55. 55. Implementation The Status - Cycle Import 12 Live on Stage - Dominik Jungowski
    56. 56. Implementation The Status - Cycle ne w or ch an ge dd ata Import 12 Live on Stage - Dominik Jungowski
    57. 57. Implementation The Status - Cycle Changed [1] ne w or ch an ge dd ata Import 12 Live on Stage - Dominik Jungowski
    58. 58. Implementation The Status - Cycle Changed [1] ne w or ch an ge dd ata Import 12 Live on Stage - Dominik Jungowski
    59. 59. Implementation The Status - Cycle Changed [1] ne w or ch an ge dd ata Sync Import 12 Live on Stage - Dominik Jungowski
    60. 60. Implementation The Status - Cycle Changed [1] ne w or ch an ge dd ata Sync Import No change [0] 12 Live on Stage - Dominik Jungowski
    61. 61. Implementation The Status - Cycle Changed [1] ne w or ch an ge dd ata Sync Import No change [0] 12 Live on Stage - Dominik Jungowski
    62. 62. Implementation The Status - Cycle Changed [1] ne w or ch an ge dd ata Sync Import rem ov ed da ta No change [0] 12 Live on Stage - Dominik Jungowski
    63. 63. Implementation The Status - Cycle Changed [1] ne w or ch an ge dd ata Sync Import rem ov ed da ta No Changed change Deleted [0] [3] 12 Live on Stage - Dominik Jungowski
    64. 64. Implementation The Status - Cycle Changed [1] ne w or ch an ge dd ata Sync Import rem ov ed da ta No Changed change Deleted [0] [3] 12 Live on Stage - Dominik Jungowski
    65. 65. Implementation The Status - Cycle Changed [1] ne w or ch an ge dd ata Sync Import rem ov ed da ta No Changed change Deleted [0] [3] 12 Live on Stage - Dominik Jungowski
    66. 66. Implementation The Status - Cycle Changed [1] ne w or ch an ge dd ata Sync Sync Import rem ov ed da ta No Changed change Deleted [0] [3] 12 Live on Stage - Dominik Jungowski
    67. 67. Implementation The Status - Cycle Changed Deleted [1] [2] ne w or ch an ge dd ata Sync Sync Import rem ov ed da ta No Changed change Deleted [0] [3] 12 Live on Stage - Dominik Jungowski
    68. 68. Implementation The Status - Cycle Changed Deleted [1] [2] ne w or ch an ge dd ata Sync Sync Import rem ov ed da ta No Changed change Deleted [0] [3] 12 Live on Stage - Dominik Jungowski
    69. 69. Implementation Why 0, 1, 2, 3? Live on Stage - Dominik Jungowski
    70. 70. Implementation Why 0, 1, 2, 3? Let‘s take a look at the binary numbers! Live on Stage - Dominik Jungowski
    71. 71. Implementation 14 Live on Stage - Dominik Jungowski
    72. 72. Implementation No change [0] 14 Live on Stage - Dominik Jungowski
    73. 73. Implementation No change [0] = 14 Live on Stage - Dominik Jungowski
    74. 74. Implementation No change [0] = 0000 14 Live on Stage - Dominik Jungowski
    75. 75. Implementation No change [0] = 0000 Changed [1] 14 Live on Stage - Dominik Jungowski
    76. 76. Implementation No change [0] = 0000 Changed [1] = 14 Live on Stage - Dominik Jungowski
    77. 77. Implementation No change [0] = 0000 Changed [1] = 0001 14 Live on Stage - Dominik Jungowski
    78. 78. Implementation No change [0] = 0000 Changed [1] = 0001 Deleted [2] 14 Live on Stage - Dominik Jungowski
    79. 79. Implementation No change [0] = 0000 Changed [1] = 0001 Deleted [2] = 14 Live on Stage - Dominik Jungowski
    80. 80. Implementation No change [0] = 0000 Changed [1] = 0001 Deleted [2] = 0010 14 Live on Stage - Dominik Jungowski
    81. 81. Implementation No change [0] = 0000 Changed [1] = 0001 Deleted [2] = 0010 Changed Deleted [3] 14 Live on Stage - Dominik Jungowski
    82. 82. Implementation No change [0] = 0000 Changed [1] = 0001 Deleted [2] = 0010 Changed Deleted [3] = 14 Live on Stage - Dominik Jungowski
    83. 83. Implementation No change [0] = 0000 Changed [1] = 0001 Deleted [2] = 0010 Changed Deleted [3] = 0011 14 Live on Stage - Dominik Jungowski
    84. 84. Implementation No change [0] = 0000 Changed [1] = 0001 Deleted [2] = 0010 Changed Deleted [3] = 0011 = 0001 | 0010 14 Live on Stage - Dominik Jungowski
    85. 85. Implementation Using the binary flags in PHP class phpDay_Sync { /** * Status for changed data * Binary: 0001 */ const STATUS_CHANGED = 1; /** * Status for removed data * Binary: 0010 */ const STATUS_DELETED = 2; ... } 15 Live on Stage - Dominik Jungowski
    86. 86. Implementation Using the binary flags in PHP 16 Live on Stage - Dominik Jungowski
    87. 87. Implementation Using the binary flags in PHP // Speaker status has changed 16 Live on Stage - Dominik Jungowski
    88. 88. Implementation Using the binary flags in PHP // Speaker status has changed $speaker[‘status‘] = phpDay_Sync::STATUS_CHANGED; 16 Live on Stage - Dominik Jungowski
    89. 89. Implementation Using the binary flags in PHP // Speaker status has changed $speaker[‘status‘] = phpDay_Sync::STATUS_CHANGED; // Speaker has been synced to live system 16 Live on Stage - Dominik Jungowski
    90. 90. Implementation Using the binary flags in PHP // Speaker status has changed $speaker[‘status‘] = phpDay_Sync::STATUS_CHANGED; // Speaker has been synced to live system $speaker[‘status‘] = 16 Live on Stage - Dominik Jungowski
    91. 91. Implementation Using the binary flags in PHP // Speaker status has changed $speaker[‘status‘] = phpDay_Sync::STATUS_CHANGED; // Speaker has been synced to live system $speaker[‘status‘] = (phpDay_Sync::STATUS_CHANGED & phpDay_Sync::STATUS_DELETED); 16 Live on Stage - Dominik Jungowski
    92. 92. Implementation Using the binary flags in PHP // Speaker status has changed $speaker[‘status‘] = phpDay_Sync::STATUS_CHANGED; // Speaker has been synced to live system $speaker[‘status‘] = (phpDay_Sync::STATUS_CHANGED & phpDay_Sync::STATUS_DELETED); //... or easier :-) 16 Live on Stage - Dominik Jungowski
    93. 93. Implementation Using the binary flags in PHP // Speaker status has changed $speaker[‘status‘] = phpDay_Sync::STATUS_CHANGED; // Speaker has been synced to live system $speaker[‘status‘] = (phpDay_Sync::STATUS_CHANGED & phpDay_Sync::STATUS_DELETED); //... or easier :-) $speaker[‘status‘] = 0; 16 Live on Stage - Dominik Jungowski
    94. 94. Implementation Using the binary flags in PHP 17 Live on Stage - Dominik Jungowski
    95. 95. Implementation Using the binary flags in PHP // Speaker didn‘t show up in import file 17 Live on Stage - Dominik Jungowski
    96. 96. Implementation Using the binary flags in PHP // Speaker didn‘t show up in import file // 0001 | 0010 = 0011 17 Live on Stage - Dominik Jungowski
    97. 97. Implementation Using the binary flags in PHP // Speaker didn‘t show up in import file // 0001 | 0010 = 0011 $speaker[‘status‘] = 17 Live on Stage - Dominik Jungowski
    98. 98. Implementation Using the binary flags in PHP // Speaker didn‘t show up in import file // 0001 | 0010 = 0011 $speaker[‘status‘] = (phpDay_Sync::STATUS_CHANGED | phpDay_Sync::STATUS_DELETED); 17 Live on Stage - Dominik Jungowski
    99. 99. Implementation Using the binary flags in PHP // Speaker didn‘t show up in import file // 0001 | 0010 = 0011 $speaker[‘status‘] = (phpDay_Sync::STATUS_CHANGED | phpDay_Sync::STATUS_DELETED); // Speaker has been deleted on live system 17 Live on Stage - Dominik Jungowski
    100. 100. Implementation Using the binary flags in PHP // Speaker didn‘t show up in import file // 0001 | 0010 = 0011 $speaker[‘status‘] = (phpDay_Sync::STATUS_CHANGED | phpDay_Sync::STATUS_DELETED); // Speaker has been deleted on live system $speaker[‘status‘] = phpDay_Sync::STATUS_DELETED; 17 Live on Stage - Dominik Jungowski
    101. 101. Binary AND & 0 1 2 3 0 0 0 0 1 0 0 1 2 0 0 2 3 0 1 2 18 Live on Stage - Dominik Jungowski
    102. 102. Binary AND & 0 1 2 3 0000 0000 0000 0 & 0001 & 0010 & 0011 = 0000 = 0000 = 0000 0001 0001 0001 1 & 0000 & 0010 & 0011 = 0000 = 0000 = 0001 0010 0010 0010 2 & 0000 & 0001 & 0011 = 0000 = 0000 = 0010 0011 0011 0010 3 & 0000 & 0001 & 0011 = 0000 = 0001 = 0010 19 Live on Stage - Dominik Jungowski
    103. 103. Binary OR | 0 1 2 3 0 1 2 3 1 1 3 3 2 2 3 3 3 3 3 3 20 Live on Stage - Dominik Jungowski
    104. 104. Binary OR | 0 1 2 3 0000 0000 0000 0 | 0001 | 0010 | 0011 = 0001 = 0010 = 0011 0001 0001 0001 1 | 0000 | 0010 | 0011 = 0001 = 0011 = 0011 0010 0001 0010 2 | 0000 | 0010 | 0011 = 0010 = 0011 = 0011 0011 0011 0011 3 | 0000 | 0001 | 0010 = 0010 = 0011 = 0011 21 Live on Stage - Dominik Jungowski
    105. 105. Deleting on live system Status 3 Status 2 Live on Stage - Dominik Jungowski
    106. 106. Implementation & 0 1 2 3 0 0 0 0 1 0 0 1 2 0 0 2 3 0 1 2 23 Live on Stage - Dominik Jungowski
    107. 107. Implementation ... in PHP 24 Live on Stage - Dominik Jungowski
    108. 108. Implementation ... in PHP // We‘ve synced the deleted speaker, status 3 => status 2 24 Live on Stage - Dominik Jungowski
    109. 109. Implementation ... in PHP // We‘ve synced the deleted speaker, status 3 => status 2 // 0011 & 0010 = 0010 24 Live on Stage - Dominik Jungowski
    110. 110. Implementation ... in PHP // We‘ve synced the deleted speaker, status 3 => status 2 // 0011 & 0010 = 0010 $speaker[‘status‘] = 24 Live on Stage - Dominik Jungowski
    111. 111. Implementation ... in PHP // We‘ve synced the deleted speaker, status 3 => status 2 // 0011 & 0010 = 0010 $speaker[‘status‘] = ($speaker[‘status‘] & phpDay_Sync::STATUS_DELETED); 24 Live on Stage - Dominik Jungowski
    112. 112. Implementation ... in PHP // We‘ve synced the deleted speaker, status 3 => status 2 // 0011 & 0010 = 0010 $speaker[‘status‘] = ($speaker[‘status‘] & phpDay_Sync::STATUS_DELETED); // or if you know you will never use more than those 4 status flags: 24 Live on Stage - Dominik Jungowski
    113. 113. Implementation ... in PHP // We‘ve synced the deleted speaker, status 3 => status 2 // 0011 & 0010 = 0010 $speaker[‘status‘] = ($speaker[‘status‘] & phpDay_Sync::STATUS_DELETED); // or if you know you will never use more than those 4 status flags: $speaker[‘status‘] = phpDay_Sync::STATUS_CHANGEDELETED; 24 Live on Stage - Dominik Jungowski
    114. 114. Implementation ... in MySQL 25 Live on Stage - Dominik Jungowski
    115. 115. Implementation ... in MySQL // We‘ve synced the deleted speaker, status 3 => status 2 // 0011 & 0010 = 0010 $sql = ‘UPDATE speaker SET status = status & ‘ . phpDay_Sync::STATUS_DELETED; 25 Live on Stage - Dominik Jungowski
    116. 116. Implementation ... in MySQL // We‘ve synced the deleted speaker, status 3 => status 2 // 0011 & 0010 = 0010 $sql = ‘UPDATE speaker SET status = status & ‘ . phpDay_Sync::STATUS_DELETED; ‣ But: Rather slow in MySQL 25 Live on Stage - Dominik Jungowski
    117. 117. Implementation ... in MySQL // We‘ve synced the deleted speaker, status 3 => status 2 // 0011 & 0010 = 0010 $sql = ‘UPDATE speaker SET status = status & ‘ . phpDay_Sync::STATUS_DELETED; ‣ But: Rather slow in MySQL // We‘ve synced the deleted speaker, status 3 => status 2 // 0011 & 0010 = 0010 $status = $speaker->getStatus(); $sql = ‘UPDATE speaker SET status = ‘ . ($status & phpDay_Sync::STATUS_DELETED); 25 Live on Stage - Dominik Jungowski
    118. 118. Adding a staging layer Things to consider Live on Stage - Dominik Jungowski
    119. 119. Adding a staging layer 27 Live on Stage - Dominik Jungowski
    120. 120. Adding a staging layer ‣ Distribution of cronjobs: 1 server ➝ 2 servers 27 Live on Stage - Dominik Jungowski
    121. 121. Adding a staging layer ‣ Distribution of cronjobs: 1 server ➝ 2 servers ➡ Data you need on live system 27 Live on Stage - Dominik Jungowski
    122. 122. Adding a staging layer ‣ Distribution of cronjobs: 1 server ➝ 2 servers ➡ Data you need on live system ➡ Data you need on staging system 27 Live on Stage - Dominik Jungowski
    123. 123. Adding a staging layer ‣ Distribution of cronjobs: 1 server ➝ 2 servers ➡ Data you need on live system ➡ Data you need on staging system ➡ Data you need on both systems 27 Live on Stage - Dominik Jungowski
    124. 124. Adding a staging layer ‣ Distribution of cronjobs: 1 server ➝ 2 servers ➡ Data you need on live system ➡ Data you need on staging system ➡ Data you need on both systems ‣ Write down all the cronjobs 27 Live on Stage - Dominik Jungowski
    125. 125. Adding a staging layer ‣ Distribution of cronjobs: 1 server ➝ 2 servers ➡ Data you need on live system ➡ Data you need on staging system ➡ Data you need on both systems ‣ Write down all the cronjobs ‣ Decide where you need them 27 Live on Stage - Dominik Jungowski
    126. 126. Adding a staging layer ‣ Switching live system 28 Live on Stage - Dominik Jungowski
    127. 127. Adding a staging layer ‣ Switching live system Database server 28 Live on Stage - Dominik Jungowski
    128. 128. Adding a staging layer ‣ Switching live system Old database Database server 28 Live on Stage - Dominik Jungowski
    129. 129. Adding a staging layer ‣ Switching live system Old database Database server New (synced) database 28 Live on Stage - Dominik Jungowski
    130. 130. Adding a staging layer ‣ Switching live system Old database Database Website server New (synced) database 28 Live on Stage - Dominik Jungowski
    131. 131. Adding a staging layer ‣ Switching live system Old database Database Website server New (synced) database 28 Live on Stage - Dominik Jungowski
    132. 132. Adding a staging layer ‣ Switching live system Old database Database Website server New (synced) database 28 Live on Stage - Dominik Jungowski
    133. 133. Adding a staging layer ‣ Switching live system Old database Database Website server New (synced) database 28 Live on Stage - Dominik Jungowski
    134. 134. Problems & Solutions 29 Live on Stage - Dominik Jungowski
    135. 135. Problems & Solutions ‣ Problem: Data integrity 30 Live on Stage - Dominik Jungowski
    136. 136. Problems & Solutions ‣ Problem: Data integrity Status flag 30 Live on Stage - Dominik Jungowski
    137. 137. Problems & Solutions ‣ Problem: Data integrity Read for Sync Status flag 30 Live on Stage - Dominik Jungowski
    138. 138. Problems & Solutions ‣ Problem: Data integrity Read for Sync Status flag 30 Live on Stage - Dominik Jungowski
    139. 139. Problems & Solutions ‣ Problem: Data integrity Read for Sync St at us :1 Status flag 30 Live on Stage - Dominik Jungowski
    140. 140. Problems & Solutions ‣ Problem: Data integrity Read for User Sync St at us :1 Status flag 30 Live on Stage - Dominik Jungowski
    141. 141. Problems & Solutions ‣ Problem: Data integrity Read for User Sync St at us :1 Status flag 30 Live on Stage - Dominik Jungowski
    142. 142. Problems & Solutions ‣ Problem: Data integrity Read for User Sync Status: 1 St at us :1 Status flag 30 Live on Stage - Dominik Jungowski
    143. 143. Problems & Solutions ‣ Problem: Data integrity Read for Sync User Sync finished Status: 1 St at us :1 Status flag 30 Live on Stage - Dominik Jungowski
    144. 144. Problems & Solutions ‣ Problem: Data integrity Read for Sync User Sync finished Status: 1 St at us :1 Status flag 30 Live on Stage - Dominik Jungowski
    145. 145. Problems & Solutions ‣ Problem: Data integrity Read for Sync User Sync finished 0 Status: 1 St s: at u at us St :1 Status flag 30 Live on Stage - Dominik Jungowski
    146. 146. Problems & Solutions 31 Live on Stage - Dominik Jungowski
    147. 147. Problems & Solutions ‣ Solution: Table locking 31 Live on Stage - Dominik Jungowski
    148. 148. Problems & Solutions ‣ Solution: Table locking mysql> LOCK TABLES speaker WRITE; 31 Live on Stage - Dominik Jungowski
    149. 149. Problems & Solutions ‣ Solution: Table locking mysql> LOCK TABLES speaker WRITE; ‣ Problem: Whole table is locked for reading and writing 31 Live on Stage - Dominik Jungowski
    150. 150. Problems & Solutions ‣ Solution: Table locking mysql> LOCK TABLES speaker WRITE; ‣ Problem: Whole table is locked for reading and writing mysql> SELECT * FROM speaker WHERE status = 1 FOR UPDATE; 31 Live on Stage - Dominik Jungowski
    151. 151. Problems & Solutions ‣ Solution: Table locking mysql> LOCK TABLES speaker WRITE; ‣ Problem: Whole table is locked for reading and writing mysql> SELECT * FROM speaker WHERE status = 1 FOR UPDATE; ‣ Only locks the selected rows 31 Live on Stage - Dominik Jungowski
    152. 152. Problems & Solutions ‣ Solution: Table locking mysql> LOCK TABLES speaker WRITE; ‣ Problem: Whole table is locked for reading and writing mysql> SELECT * FROM speaker WHERE status = 1 FOR UPDATE; ‣ Only locks the selected rows ‣ Reading other data from table is still possible 31 Live on Stage - Dominik Jungowski
    153. 153. Contact me ‣ Weblog: www.phpdevblog.net ‣ Twitter: www.twitter.com/djungowski ‣ Xing: http://www.xing.com/profile/ Dominik_Jungowski 32 Live on Stage - Dominik Jungowski
    154. 154. Questions? 33 Live on Stage - Dominik Jungowski
    155. 155. Thank you! 34 Live on Stage - Dominik Jungowski

    ×