Upgrade to Pro — share decks privately, control downloads, hide ads and more …

images_with_mysql_merit_demerit_and_troubleshooting

mamy1326_2
October 25, 2017

 images_with_mysql_merit_demerit_and_troubleshooting

PHPカンファレンス 2017で話す予定だった「MySQLで画像を扱うメリット・デメリットと特殊パターン」を改題し、「MySQLで画像 を扱うメリット・デメリットと障害・解決事例」として、第119回 PHP勉強会@東京で登壇した際のスライドです。

mamy1326_2

October 25, 2017
Tweet

Other Decks in Programming

Transcript

  1. .Z42-Ͱը૾Λѻ͏
    ϝϦοτɾσϝϦοτͱ
    ো֐ɾղܾࣄྫ
    ·Έ΍ͳ͓͖ !NBNZ
    0DU!QIQDPO
    0DUୈճ1)1ษڧձˏ౦ژ

    View full-size slide

  2. Ξ΢τϓοτͷ
    ͖͔͚ͬ

    View full-size slide

  3. ͖͔͚ͬ
    ⾣UFSBUBJMͰ౴͑ͨ
    IUUQTUFSBUBJMDPNRVFTUJPOT

    View full-size slide

  4. ͖͔͚ͬ
    ⾣ϕετΞϯαʔʹͳͬͨ

    View full-size slide

  5. ͖͔͚ͬ
    ⾣5XJUUFSʹ౤ߘͨ͠

    View full-size slide

  6. ͖͔͚ͬ
    ⾣ΊͬͪΌ੝Γ্͕ͬͨ

    View full-size slide

  7. ͖͔͚ͬ
    ⾣·ͱΊͨ
    IUUQTUPHFUUFSDPNMJ

    View full-size slide

  8. ͏͔ͬΓը૾Λ
    3%#ʹಥͬࠐΜͩ
    ͹͔Γʹ

    View full-size slide

  9. ࣮ࡍʹ
    ۤ࿑ͨ͠࿩Λ
    ަ͑ͯ

    View full-size slide

  10. 3%# .Z42-

    Ͱը૾Λѻ͏

    View full-size slide

  11. ϝϦοτ
    "
    ˍ
    σϝϦοτ
    $

    View full-size slide

  12. Կ͕μϝͳͷ͔

    View full-size slide

  13. Կ͕ϕετͳͷ͔
    Λߟ͑

    View full-size slide

  14. ద੾ʹը૾Λ
    ѻ͏جຊΛ
    ͓࿩͠͠·͢

    View full-size slide

  15. ͓࿩͢Δ͜ͱ
    ▶︎ ࣗݾ঺հ
    ▶︎ τϥϒϧࣄྫͱղܾํ๏
    ▶︎ ϝϦοτɾσϝϦοτ
    ▶︎ ࣮ࡍͷॻ͖ࠐΈ଎౓ɾσʔλྔ
    ▶︎ Կ͕ϕετͳͷ͔
    ▶︎ ͓ΘΓʹ

    View full-size slide

  16. ͓࿩͢Δ͜ͱ
    ▶︎ ࣗݾ঺հ
    ▶︎ τϥϒϧࣄྫͱղܾํ๏
    ▶︎ ϝϦοτɾσϝϦοτ
    ▶︎ ࣮ࡍͷॻ͖ࠐΈ଎౓ɾσʔλྔ
    ▶︎ Կ͕ϕετͳͷ͔
    ▶︎ ͓ΘΓʹ

    View full-size slide

  17. ࣗݾ঺հ
    ▶︎ ΦϥΫΕͳ͍
    ▶︎ ϙεάΕͳ͍
    ϫλγνϣοτμέ
    ϚΠΤεΩϡʔΤΔ

    View full-size slide

  18. ࣗݾ঺հ
    ▶︎ ΦϥΫΕͳ͍
    ▶︎ ϙεάΕͳ͍
    ϫλγνϣοτμέ
    ϚΠΤεΩϡʔΤΔ

    View full-size slide

  19. ࣗݾ঺հ
    Name ɿ·Έ΍ͳ͓͖
    ॴଐɹ ɿInnovator Japan Inc.
    Twitterɿ@mamy1326
    - ීஈ͸PHPॻ͍ͯ·͢
    - 2017೥1݄ʹॳΊͯmy.cnfΛ৮Δ
    - ࠓ೥1೥ MySQLΛझຯʹͯ͠ΈΔ

    View full-size slide

  20. ͱ͜ΖͰ
    Έͳ͞Μ

    View full-size slide

  21. ը૾Λ3%#ʹ
    ΩϟοΩϟ΢ϑϑ
    Ҋ݅

    View full-size slide

  22. ܦݧͨ͜͠ͱ
    ͋Γ·͔͢ʁ
    ڍख✋

    View full-size slide

  23. ๻͸͋Γ·͢ʂ

    View full-size slide

  24. ͨͱ͑͹ʜ
    ͱ͋Δෆಈ࢈γεςϜ
    ෺݅ը૾Λશ෦
    ΧϥϜʹೖΕΔ

    View full-size slide

  25. Ͱ΋
    ඞཁͳ࣌͸
    ͋Δ͔΋͠Εͳ͍

    View full-size slide

  26. Զ͕ࢮΜͩΒʜ
    ͋ͷൿଂͷը૾
    ϑΥϧμΛʜ

    View full-size slide

  27. ࡟আͯ͠ʜ
    ͓͔ʜͶ͹ʜ
    ŰƄŦŕ@ ʯ㲃
    @

    View full-size slide

  28. Ͱ΋҆৺
    ͓ๅը૾
    %#ͷதͳΒͶ

    View full-size slide

  29. ͑ʁ
    ͦΕͰ͍͍ͷʁ

    View full-size slide

  30. ͓લͷ
    αʔϏεͳΒͳ

    View full-size slide

  31. ͓࿩͢Δ͜ͱ
    ▶︎ ࣗݾ঺հ
    ▶︎ τϥϒϧࣄྫͱղܾํ๏
    ▶︎ ϝϦοτɾσϝϦοτ
    ▶︎ ࣮ࡍͷॻ͖ࠐΈ଎౓ɾσʔλྔ
    ▶︎ Կ͕ϕετͳͷ͔
    ▶︎ ͓ΘΓʹ

    View full-size slide

  32. %#͔Β
    ը૾Λ4&-&$5
    ʢ֎؍ɺ಺૷ɺؒऔɺपลʣ

    View full-size slide

  33. ಥવͷ
    ͓٬͞·͔Βͷ
    ͓໰͍߹Θͤ

    View full-size slide

  34. ͋Δ೔ͷ͓໰͍߹Θͤ
    ☎ɿ෺݅σʔλొ࿥ͨ͠Βɺ
    ɹɹը໘͕ਅͬനʹͳΔΜͰ͚͢Ͳ
    ɿը໘Ωϟϓνϟૹͬͯ௖͍ͯ΋
    ɹɹΑΖ͍͠Ͱ͔͢ʁ

    View full-size slide

  35. ͋Δ೔ͷ͓໰͍߹Θͤ
    ը໘
    ਅͬന

    View full-size slide

  36. ͋Δ೔ͷ͓໰͍߹Θͤ
    ը໘
    ਅͬന
    λΠϜΞ΢τ

    View full-size slide

  37. ࣮ࡍʹى͖ͨτϥϒϧ
    ⾣େ͖ͳαΠζͷը૾ΛΞοϓϩʔυ
    ɹˠεϚϗɺσδΧϝ͔Βͦͷ··
    ⾣ෳ਺ຕΛҰ౓ʹΞοϓϩʔυ
    ɹˠ෺݅ͷը૾਺͕ଟ͍
    ⾣ϦΫΤετ͕ଟൃ
    ɹˠൟ๩ظʹूதɺෳ਺ళฮͰൃੜ

    View full-size slide

  38. ͸ͯ

    ςʔϒϧߏ੒ݟΔ͔ʜ

    View full-size slide

  39. mysql> show create table bukken\G
    *************************** 1. row ***************************
    Table: bukken
    Create Table: CREATE TABLE `bukken` (
    `id` int(10) NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `gaikan_01` mediumblob NOT NULL,
    `gaikan_02` mediumblob,
    `gaikan_03` mediumblob,
    `gaikan_04` mediumblob,
    `gaikan_05` mediumblob,
    `gaikan_06` mediumblob,
    `gaikan_07` mediumblob,
    `gaikan_08` mediumblob,
    `gaikan_09` mediumblob,
    `gaikan_10` mediumblob,
    `madori_01` mediumblob NOT NULL,
    `naiso_01` mediumblob NOT NULL,
    `naiso_02` mediumblob,
    `naiso_03` mediumblob,
    `naiso_04` mediumblob,
    `naiso_05` mediumblob,
    `naiso_06` mediumblob,
    `naiso_07` mediumblob,
    `naiso_08` mediumblob,
    `naiso_09` mediumblob,
    `naiso_10` mediumblob,
    `syuhen_01` mediumblob NOT NULL,
    `syuhen_02` mediumblob,
    `syuhen_03` mediumblob,
    `syuhen_04` mediumblob,
    `syuhen_05` mediumblob,
    `syuhen_06` mediumblob,
    `syuhen_07` mediumblob,
    `syuhen_08` mediumblob,
    `syuhen_09` mediumblob,
    `syuhen_10` mediumblob,
    `panorama` mediumblob,
    `gaikan_s_01` mediumblob NOT NULL,
    `gaikan_s_02` mediumblob,
    `gaikan_s_03` mediumblob,
    `gaikan_s_04` mediumblob,
    `gaikan_s_05` mediumblob,
    `gaikan_s_06` mediumblob,
    `gaikan_s_07` mediumblob,
    `gaikan_s_08` mediumblob,
    `gaikan_s_09` mediumblob,
    `gaikan_s_10` mediumblob,
    `madori_s_01` mediumblob NOT NULL,
    `naiso_s_01` mediumblob NOT NULL,
    `naiso_s_02` mediumblob,
    `naiso_s_03` mediumblob,
    `naiso_s_04` mediumblob,
    `naiso_s_05` mediumblob,
    `naiso_s_06` mediumblob,
    `naiso_s_07` mediumblob,
    `naiso_s_08` mediumblob,
    `naiso_s_09` mediumblob,
    `naiso_s_10` mediumblob,
    `syuhen_s_01` mediumblob NOT NULL,
    `syuhen_s_02` mediumblob,
    `syuhen_s_03` mediumblob,
    `syuhen_s_04` mediumblob,
    `syuhen_s_05` mediumblob,
    `syuhen_s_06` mediumblob,
    `syuhen_s_07` mediumblob,
    `syuhen_s_08` mediumblob,
    `syuhen_s_09` mediumblob,
    `syuhen_s_10` mediumblob,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4
    1 row in set (0.00 sec)
    ͑ʁ

    View full-size slide

  40. ςʔϒϧߏ੒

    mysql> show create table bukken\G
    ****************** 1. row ******************
    Table: bukken
    Create Table: CREATE TABLE `bukken` (
    `id` int(10) NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    ⾣ʮͪΌΜͱʯ֬ೝͯ͠ΈΔ

    View full-size slide

  41. ςʔϒϧߏ੒

    `gaikan_01` mediumblob NOT NULL,
    `gaikan_02` mediumblob,
    `gaikan_03` mediumblob,
    `gaikan_04` mediumblob,
    `gaikan_05` mediumblob,
    `gaikan_06` mediumblob,
    `gaikan_07` mediumblob,
    `gaikan_08` mediumblob,
    `gaikan_09` mediumblob,
    `gaikan_10` mediumblob,

    View full-size slide

  42. ςʔϒϧߏ੒

    `madori_01` mediumblob NOT NULL,
    `naiso_01` mediumblob NOT NULL,
    `naiso_02` mediumblob,
    `naiso_03` mediumblob,
    `naiso_04` mediumblob,
    `naiso_05` mediumblob,
    `naiso_06` mediumblob,
    `naiso_07` mediumblob,
    `naiso_08` mediumblob,
    `naiso_09` mediumblob,
    `naiso_10` mediumblob,

    View full-size slide

  43. ςʔϒϧߏ੒

    `syuhen_01` mediumblob NOT NULL,
    `syuhen_02` mediumblob,
    `syuhen_03` mediumblob,
    `syuhen_04` mediumblob,
    `syuhen_05` mediumblob,
    `syuhen_06` mediumblob,
    `syuhen_07` mediumblob,
    `syuhen_08` mediumblob,
    `syuhen_09` mediumblob,
    `syuhen_10` mediumblob,
    `panorama` mediumblob,

    View full-size slide

  44. ςʔϒϧߏ੒

    `gaikan_s_01` mediumblob NOT NULL,
    `gaikan_s_02` mediumblob,
    `gaikan_s_03` mediumblob,
    `gaikan_s_04` mediumblob,
    `gaikan_s_05` mediumblob,
    `gaikan_s_06` mediumblob,
    `gaikan_s_07` mediumblob,
    `gaikan_s_08` mediumblob,
    `gaikan_s_09` mediumblob,
    `gaikan_s_10` mediumblob,

    View full-size slide

  45. ςʔϒϧߏ੒

    `madori_s_01` mediumblob NOT NULL,
    `naiso_s_01` mediumblob NOT NULL,
    `naiso_s_02` mediumblob,
    `naiso_s_03` mediumblob,
    `naiso_s_04` mediumblob,
    `naiso_s_05` mediumblob,
    `naiso_s_06` mediumblob,
    `naiso_s_07` mediumblob,
    `naiso_s_08` mediumblob,
    `naiso_s_09` mediumblob,
    `naiso_s_10` mediumblob,

    View full-size slide

  46. ςʔϒϧߏ੒

    `syuhen_s_01` mediumblob NOT NULL,
    `syuhen_s_02` mediumblob,
    `syuhen_s_03` mediumblob,
    `syuhen_s_04` mediumblob,
    `syuhen_s_05` mediumblob,
    `syuhen_s_06` mediumblob,
    `syuhen_s_07` mediumblob,
    `syuhen_s_08` mediumblob,
    `syuhen_s_09` mediumblob,
    `syuhen_s_10` mediumblob,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=7687528 DEFAULT
    CHARSET=utf8mb4
    1 row in set (0.00 sec)

    View full-size slide

  47. ςʔϒϧߏ੒

    `syuhen_s_01` mediumblob NOT NULL,
    `syuhen_s_02` mediumblob,
    `syuhen_s_03` mediumblob,
    `syuhen_s_04` mediumblob,
    `syuhen_s_05` mediumblob,
    `syuhen_s_06` mediumblob,
    `syuhen_s_07` mediumblob,
    `syuhen_s_08` mediumblob,
    `syuhen_s_09` mediumblob,
    `syuhen_s_10` mediumblob,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=7687528 DEFAULT
    CHARSET=utf8mb4
    1 row in set (0.00 sec)
    όΠφϦσʔλ
    อଘ༻ΧϥϜ

    View full-size slide

  48. ͳΜͱ͜Ε
    શ෦3%#ʹ
    ͋ΔΜͰ͢Αʢ਒͑੠

    View full-size slide

  49. ࣮ࡍͷͱ͜Ζ
    ͲΜͳ։ൃ͔ͩͬͨ

    View full-size slide

  50. ӡ༻Λ૝ఆ͍ͯ͠ͳ͍
    ⾣։ൃ͍ͯͨ͠؀ڥ
    8FC %#
    ΫϥΠΞϯτ

    View full-size slide

  51. ӡ༻Λ૝ఆ͍ͯ͠ͳ͍
    ͏Μɺେৎ෉ʂ
    ⾣։ൃ͍ͯͨ͠؀ڥ
    8FC %#
    ΫϥΠΞϯτ

    View full-size slide

  52. ӡ༻Λ૝ఆ͍ͯ͠ͳ͍
    ⾣࣮ࡍͷ؀ڥ
    8FC %#

    View full-size slide

  53. ӡ༻Λ૝ఆ͍ͯ͠ͳ͍
    ⾣࣮ࡍͷ؀ڥ

    ωοτϫʔΫ
    8FC %#

    View full-size slide

  54. ӡ༻Λ૝ఆ͍ͯ͠ͳ͍
    ⾣࣮ࡍͷ؀ڥ
    ϓϩηε
    8FC %#

    View full-size slide

  55. ӡ༻Λ૝ఆ͍ͯ͠ͳ͍
    ⾣࣮ࡍͷ؀ڥ

    λΠϜΞ΢τ
    8FC %#

    View full-size slide

  56. ӡ༻Λ૝ఆ͍ͯ͠ͳ͍
    ɾେ͖ͳը૾͸Ξοϓ͠ͳ͍ͩΖ͏
    ɾ͍ͬ΃ΜʹΞοϓ͠ͳ͍ͩΖ͏
    ɾେ੎ͰΞοϓ͠ͳ͍ͩΖ͏
    ɾ༰ྔ͸͙͢ʹᷓΕͳ͍ͩΖ͏
    ɾ৑௕ԽʁΑ͘Θ͔Μͳ͍
    ɾࠔͬͨΒεέʔϧΞοϓ͢Ε͹ʁ

    View full-size slide

  57. ӡ༻Λ૝ఆ͍ͯ͠ͳ͍
    ɾେ͖ͳը૾͸Ξοϓ͠ͳ͍ͩΖ͏
    ɾ͍ͬ΃ΜʹΞοϓ͠ͳ͍ͩΖ͏
    ɾେ੎ͰΞοϓ͠ͳ͍ͩΖ͏
    ɾ༰ྔ͸͙͢ʹᷓΕͳ͍ͩΖ͏
    ɾ৑௕ԽʁΑ͘Θ͔Μͳ͍
    ɾࠔͬͨΒεέʔϧΞοϓ͢Ε͹ʁ

    View full-size slide

  58. Ͱ͸
    Ͳ͏΍ͬͯ
    ղܾ͢Δ͔

    View full-size slide

  59. ղܾࡦ
    ⾣ॲཧͰ͖ΔσʔλྔΛ੍ݶ
    ɹˠׂͱ͙͢ରԠͰ͖Δ͕࢑ఆత
    ⾣Ϣʔβʔ਺Λ੍ݶ
    ɹˠαʔϏεͰ͋ΔҎ্೉͍͠
    ⾣؂ࢹ͢Δ
    ɹˠେ੾͕ͩࠜຊղܾͰ͸ͳ͍
    ⾣%#ॲཧΛվળ͢Δ
    ɹˠ໌Β͔ͳωοΫΛࠜຊղܾ

    View full-size slide

  60. ղܾࡦ
    ⾣ॲཧͰ͖ΔσʔλྔΛ੍ݶ
    ɹˠׂͱ͙͢ରԠͰ͖Δ͕࢑ఆత
    ⾣Ϣʔβʔ਺Λ੍ݶ
    ɹˠαʔϏεͰ͋ΔҎ্೉͍͠
    ⾣؂ࢹ͢Δ
    ɹˠେ੾͕ͩࠜຊղܾͰ͸ͳ͍
    ⾣%#ॲཧΛվળ͢Δ
    ɹˠ໌Β͔ͳωοΫΛࠜຊղܾ
    ࢑ఆରԠͰ
    ࠜຊղܾͰ͖ͳ͍

    View full-size slide

  61. ղܾࡦ
    ⾣ॲཧͰ͖ΔσʔλྔΛ੍ݶ
    ɹˠׂͱ͙͢ରԠͰ͖Δ͕࢑ఆత
    ⾣Ϣʔβʔ਺Λ੍ݶ
    ɹˠαʔϏεͰ͋ΔҎ্೉͍͠
    ⾣؂ࢹ͢Δ
    ɹˠେ੾͕ͩࠜຊղܾͰ͸ͳ͍
    ⾣%#ॲཧΛվળ͢Δ
    ɹˠ໌Β͔ͳωοΫΛࠜຊղܾ
    ࠜຊղܾ
    ͍ͯ͘͠

    View full-size slide

  62. ࠜຊղܾ·Ͱͷ
    ಓͷΓ

    View full-size slide

  63. ࠜຊղܾ·ͰͷಓͷΓ
    ⾣ͭͷϑΣʔζ
    ɾը૾Λ3%#͔Β੾Γ཭͢
    ɾ3%#΁ͷόΠφϦొ࿥ഇࢭ
    ɾ׬શҠߦ·Ͱͷ࢓૊ΈߟҊ

    View full-size slide

  64. ϑΣʔζᶃ
    ⾣ը૾Λ3%#͔Β੾Γ཭͢
    ɾը૾ϑΝΠϧ໊Λอଘ͢Δςʔϒϧ༻ҙ
    ɾ%PDVNFOU3PPUʹը૾อଘ͢ΔॲཧΛ௥Ճ
    ɾϑΝΠϧ໊Λ3%#ʹอଘ
    ৽نొ࿥ɾมߋը૾Λ
    %PDVNFOU3PPUʹ഑ஔ

    View full-size slide

  65. ϑΣʔζᶄ
    ⾣3%#΁ͷόΠφϦొ࿥ॲཧΛഇࢭ
    ɾը૾อଘϧʔϧΛܾΊΔʢϑΝΠϧ໊ͳͲʣ
    ɾॲཧ੾Γସ͑ͷͨΊϝϯςφϯε
    ɾ3%#ʹొ࿥͍ͯͨ͠ॲཧΛ׬શʹഇࢭ
    3%#Ͱͷ
    ը૾૿ՃΛఀࢭ

    View full-size slide

  66. ϑΣʔζᶄ
    ⾣3%#΁ͷόΠφϦొ࿥ॲཧΛഇࢭ
    ɾը૾อଘϧʔϧΛܾΊΔʢϑΝΠϧ໊ͳͲʣ
    ɾॲཧ੾Γସ͑ͷͨΊϝϯςφϯε
    ɾ3%#ʹొ࿥͍ͯͨ͠ॲཧΛ׬શʹഇࢭ
    3%#Ͱͷ
    ը૾૿ՃΛఀࢭ
    ߋ৽ॲཧͷ
    λΠϜΞ΢τΛ
    ৯͍ࢭΊΔ

    View full-size slide

  67. ϑΣʔζᶅ
    ⾣׬શҠߦ·Ͱͷ࢓૊ΈߟҊ
    ɾ3%#ը૾ΛόονͰ%PDVNFOU3PPU΁
    ɾ%PDVNFOU3PPUʹແ͚Ε͹3%#͔ΒಡΉ
    ɾ׬શʹҠߦ͕ऴΘΔ࣌ؒΛܭࢉ
    ܭըతʹը૾Λ
    %PDVNFOU3PPUʹҠߦ

    View full-size slide

  68. ϑΣʔζᶅ
    ⾣׬શҠߦ·Ͱͷ࢓૊ΈߟҊ
    ɾ3%#ը૾ΛόονͰ%PDVNFOU3PPU΁
    ɾ%PDVNFOU3PPUʹແ͚Ε͹3%#͔ΒಡΉ
    ɾ׬શʹҠߦ͕ऴΘΔ࣌ؒΛܭࢉ
    ܭըతʹը૾Λ
    %PDVNFOU3PPUʹҠߦ
    ҠߦظؒΛ
    εέδϡʔϦϯά

    View full-size slide

  69. ղܾ·ͰͷৼΓฦΓ
    ⾣අ༻ͱظ͕ؒ๲େʹ͔͔Δ
    ⾣αʔϏε͕ఀࢭ͢Δ
    ⾣ӡ༻ޙͰࣦഊ͕ڐ͞Εͳ͍
    ⾣৴༻͕ࣦ௢͢Δ

    View full-size slide

  70. ͜Ε͕
    ϕετ͔Ͳ͏͔
    ະͩʹ౴͕͑ग़·ͤΜ͕

    View full-size slide

  71. ͜Ε͚ͩؤுͬͯ΋
    ద੾ʹ
    ৼΓฦΒͳ͚Ε͹

    View full-size slide

  72. ͳΜʹ΋ͳΒͳ͍

    View full-size slide

  73. ͱ͍͏Θ͚Ͱ

    View full-size slide

  74. ͠ΜͲ͍
    ӡ༻ʹ
    ͳΒͳ͍ͨΊʜ

    View full-size slide

  75. ࠓ೔͔ΒΘ͔Δ
    ϝϦοτɾσϝϦοτ

    View full-size slide

  76. ͓࿩͢Δ͜ͱ
    ▶︎ ࣗݾ঺հ
    ▶︎ τϥϒϧࣄྫͱղܾํ๏
    ▶︎ ϝϦοτɾσϝϦοτ
    ▶︎ ࣮ࡍͷॻ͖ࠐΈ଎౓ɾσʔλྔ
    ▶︎ Կ͕ϕετͳͷ͔
    ▶︎ ͓ΘΓʹ

    View full-size slide

  77. ϝϦοτ
    ▶︎ τϥϯβΫγϣϯͷԸܙ
    ▶︎ ҉߸ԽͱηΩϡϦςΟ
    ▶︎ όοΫΞοϓͷू໿ੑ
    ▶︎ ؂ࠪʢཤྺʣͷ౷߹తͳ࣮૷

    View full-size slide

  78. τϥϯβΫγϣϯͷԸܙ
    ⾣ϑΝϯτϜϑΝΠϧͷճආ
    ɹˠSPMMCBDLͰҰൃͰͳ͔ͬͨ͜ͱʹ
    ϑΝΠϧͱ%#͕
    ಉ͡τϥϯβΫγϣϯͰ੍ޚ

    View full-size slide

  79. ҉߸ԽͱηΩϡϦςΟ
    ⾣ඇৗʹηϯγςΟϒͳը૾
    ɹˠΧϧςʹఴ෇͢Δը૾ͳͲ
    ҉߸ԽɾηΩϡΞʹ
    औΓѻ͏

    View full-size slide

  80. όοΫΞοϓͷू໿ੑ
    ⾣%#όοΫΞοϓͱಉ࣌ʹ
    ɹˠը૾΋όοΫΞοϓ͞ΕΔ
    %#ϦετΞ΍ผγεςϜͱͯ͠ͷ
    ؀ڥߏஙָ͕

    View full-size slide

  81. ؂ࠪ ཤྺ
    ͷ౷߹తͳ࣮૷
    ⾣ը૾ͷߋ৽ཤྺΛऔΓ͍ͨ
    ɹˠόʔδϣϯ؅ཧ΋͍ͨ͠
    ύϑΥʔϚϯεΛ٘ਜ਼ʹͯ͠΋
    ࣮૷͍ͨ͠ͳΒ0,

    View full-size slide

  82. σϝϦοτ
    ▶︎ ύϑΥʔϚϯε௿Լ
    ▶︎ DBͷετϨʔδѹഭ
    ▶︎ ωοτϫʔΫΛѹഭ
    ▶︎ ো֐఺ͷ૿Ճ
    ▶︎ ͓·͚ɿը૾ΛDB͔Β෼ׂ࣌ͷฐ֐

    View full-size slide

  83. ύϑΥʔϚϯε௿Լ
    ⾣ը૾σʔλΛϨίʔυʹؚΉ
    ɹˠಡΈॻ͖͢Δσʔλྔ૿Ճ
    σΟεΫ*0͕
    ஗͘ͳΔ

    View full-size slide

  84. %#ͷετϨʔδѹഭ
    ⾣૝ఆΛ௒͑ͨσʔλ૿Ճ
    ɹˠཁ݅௥Ճ΍ӡ༻ઃܭ΋Ε
    কདྷతʹ
    ετϨʔδΛѹഭ

    View full-size slide

  85. ωοτϫʔΫΛѹഭ
    ⾣ը૾Λ%#͔Βऔಘ
    ɹˠωοτϫʔΫѹഭ 8FC%#ؒ

    8FC%#ؒͷϨΠςϯγ͕ߴ͘
    Ϩεϙϯε͕௿Լ

    View full-size slide

  86. ো֐఺ͷ૿Ճ
    ⾣ը૾ߋ৽ॲཧ͕ෳࡶ
    ɹˠ༨ܭͳϓϩάϥϜɺ42-Λ௨͢
    ো֐఺͕૿͑Δ

    View full-size slide

  87. ⾣੩తϑΝΠϧΛઐ༻αʔόʔ΁
    ɹˠશϨίʔυҠߦɺϑΝΠϧ໊௥Ճ
    ؆୯ʹ෼ׂɺҠಈͰ͖ͣ
    σʔλྔ࣍ୈͰ͕͔͔࣌ؒΔ
    ʲ͓·͚ʳը૾Λ%#͔Β෼ׂ࣌ͷฐ֐

    View full-size slide

  88. ͓࿩͢Δ͜ͱ
    ▶︎ ࣗݾ঺հ
    ▶︎ τϥϒϧࣄྫͱղܾํ๏
    ▶︎ ϝϦοτɾσϝϦοτ
    ▶︎ ࣮ࡍͷॻ͖ࠐΈ଎౓ɾσʔλྔ
    ▶︎ Կ͕ϕετͳͷ͔
    ▶︎ ͓ΘΓʹ

    View full-size slide

  89. ॻ͖ࠐΈ଎౓ͷ
    ൺֱ

    View full-size slide

  90. ը૾Λ3%#
    WT
    ϑΝΠϧ໊͚ͩ3%#

    View full-size slide

  91. ը૾Λ3%#ͷ৚݅
    ⾣ը૾
    $ ls -lh gaikan*
    -rw-r--r-- 1 vagrant vagrant 612K 9݄ 18 17:53 gaikan_01.png
    -rw-r--r-- 1 vagrant vagrant 27K 9݄ 18 17:51 gaikan_s_01.jpg
    ⾣*/4&35৚݅
    ɾϝΠϯը૾ɹɹɿ,#ຕ
    ɾαϜωΠϧը૾ɿ,#ຕ
    ɾϨίʔυ*/4&35

    View full-size slide

  92. ը૾Λ3%#ͷ݁Ռ
    $ php db_img.php
    ## insert image
    ..1..2..3..4..5..6..7..8..9..10
    total :9.1205940247ඵ
    avarage:0.9120594025ඵ
    ⾣݁Ռ
    ɾϨίʔυॻ͖ࠐΈɿTFD
    ɾϨίʔυॻ͖ࠐΈɿTFD

    View full-size slide

  93. ϑΝΠϧ໊͚ͩ3%#

    View full-size slide

  94. ϑΝΠϧ໊͚ͩ3%#ͷ৚݅
    ⾣ը૾
    $ pwd
    /var/www/html/img
    $ ls -lh
    ߹ܭ 640K
    -rw-r--r-- 1 apache apache 612K 10݄ 1 06:34 gaikan_01.png
    -rw-r--r-- 1 apache apache 27K 10݄ 1 06:34 gaikan_s_01.jpg
    ⾣*/4&35৚݅
    ɾը૾͸ϑΝΠϧ໊ͷΈ
    ɾϨίʔυ*/4&35

    View full-size slide

  95. ϑΝΠϧ໊͚ͩ3%#ͷ݁Ռ
    $ php db_img_name.php
    ## insert image
    ..1..2..3..4..5..6..7..8..9..10
    total :0.0100040436ඵ
    avarage:0.0010004044ඵ
    ⾣݁Ռ
    ɾϨίʔυॻ͖ࠐΈɿTFD
    ɾϨίʔυॻ͖ࠐΈɿTFD

    View full-size slide

  96. ॻ͖ࠐΈ଎౓ͷ
    ൺֱͷ݁Ռ͔Β
    ༰ྔΛݟͯΈΔ

    View full-size slide

  97. ࣮ࡍͷ༰ྔ
    ⾣ը૾Λ3%#
    # pwd
    /var/lib/mysql/mamy_test
    [root@localhost mamy_test]# ll bukken_*.ibd
    -rw-r----- 1 mysql mysql 213909504 10݄ 1 06:17 bukken_img.ibd
    -rw-r----- 1 mysql mysql 98304 10݄ 1 06:58 bukken_name.ibd

    View full-size slide

  98. ࣮ࡍͷ༰ྔ
    ⾣ը૾Λ3%#
    # pwd
    /var/lib/mysql/mamy_test
    [root@localhost mamy_test]# ll bukken_*.ibd
    -rw-r----- 1 mysql mysql 213909504 10݄ 1 06:17 bukken_img.ibd
    -rw-r----- 1 mysql mysql 98304 10݄ 1 06:58 bukken_name.ibd
    ࠩ͸ྺવ

    View full-size slide

  99. ͓࿩͢Δ͜ͱ
    ▶︎ ࣗݾ঺հ
    ▶︎ τϥϒϧࣄྫͱղܾํ๏
    ▶︎ ϝϦοτɾσϝϦοτ
    ▶︎ ࣮ࡍͷॻ͖ࠐΈ଎౓ɾσʔλྔ
    ▶︎ Կ͕ϕετͳͷ͔
    ▶︎ ͓ΘΓʹ

    View full-size slide

  100. Կ͕ϕετͳͷ͔
    ⾣ಛघͳཁ݅ͷ৔߹ʹ࢖͏
    ɹɹˠָ͔ͩΒ҆қʹಥͬࠐ·ͳ͍
    ⾣ύϑΥʔϚϯεɾίετ
    ɹͱͷτϨʔυΦϑ
    ɹɹˠ։ൃ޻਺ɺӡ༻ίετΛਂ͘ߟྀ
    ⾣ઃܭɾ࣮૷Λ͔ͬ͠Γܭը
    ɹɹˠޙͰࠔΔ͜ͱ͕͘͢͝ଟ͍
    ⾣3%#ͷຊདྷͷ੹຿Λߟྀ
    ɹɹˠϦϨʔγϣφϧσʔλϕʔεͬͯͳΜ͚ͩͬʁ

    View full-size slide

  101. ͓࿩͢Δ͜ͱ
    ▶︎ ࣗݾ঺հ
    ▶︎ τϥϒϧࣄྫͱղܾํ๏
    ▶︎ ϝϦοτɾσϝϦοτ
    ▶︎ ࣮ࡍͷॻ͖ࠐΈ଎౓ɾσʔλྔ
    ▶︎ Կ͕ϕετͳͷ͔
    ▶︎ ͓ΘΓʹ

    View full-size slide

  102. γεςϜɾαʔϏε͸

    View full-size slide

  103. ཁ݅ͱϦιʔεͷ
    τϨʔυΦϑ

    View full-size slide

  104. ͋ͪΒΛཱͯΕ͹
    ͪ͜Βཱ͕ͨ͵͕

    View full-size slide

  105. ϝϦοτɾσϝϦοτ
    ಛघύλʔϯΛ
    Α͘ߟ͑ͯ

    View full-size slide

  106. க໋తʹ
    ࠔΒͳ͍Α͏ʹ

    View full-size slide

  107. ӡ༻Λߟ͑ͨ
    ઃܭΛ͠·͠ΐ͏ʂ

    View full-size slide

  108. σʔλͷण໋͸
    ΞϓϦΑΓ௕͍ͧ

    View full-size slide

  109. ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ

    View full-size slide