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

MySQL 5.7のJSON型について | MySQL Casual Talks in Fukuoka vol.6 #mysql_casual_fukuoka /mysql-casual-talks-fukuoka-vol6

MySQL 5.7のJSON型について | MySQL Casual Talks in Fukuoka vol.6 #mysql_casual_fukuoka /mysql-casual-talks-fukuoka-vol6

0a98ad166f9cdf8d27d92c37438c6e9d?s=128

Manabu Matsuzaki

December 13, 2016
Tweet

Transcript

  1. MySQL 5.7 ͷJSONܕ ʹ͍ͭͯ MySQL Casual Talks in Fukuoka vol.6

    2016/11/09 @matsumana
  2. ࣗݾ঺հ • ໊લɿ দ࡚ ֶ • ॴଐɿ LINE Fukuokaגࣜձࣾ
 ιϑτ΢ΣΞΤϯδχΞʢ։ൃɾӡ༻ʣ

    • Twitterɿ @matsumana
  3. ΞδΣϯμ • JSONܕͷಛ௃ • Java͔Β࢖ͬͯΈͨ

  4. 5.7͕ϦϦʔε͞Εͯ Ұ೥͕ա͗·ͨ͠Ͷ

  5. MySQLͷྺ࢙ • MySQL 5.7 ʢ2015/10ϦϦʔεʣ • MySQL 5.6 ʢ2013/02ϦϦʔεʣ •

    MySQL 5.5 ʢ2010/12ϦϦʔεʣ • MySQL 5.1 ʢ2008/11ϦϦʔεʣ • MySQL 5.0 ʢ2005/10ϦϦʔεʣ • MySQL 4.1 ʢ2004/10ϦϦʔεʣ • MySQL 4.0 ʢ2003/03ϦϦʔεʣ • MySQL 3.23 ʢ2001/01ϦϦʔεʣ • MySQL 3.23Ҏલ
  6. 5.7࢖ͬͯ·͔͢ʁ

  7. 5.7Ͱ͸170Λ௒͑Δ ػೳ௥Ճ΍มߋ͕ ؚ·Ε͍ͯ·͢

  8. શ෦೺Ѳ͢Δͷ͸ ΊͬͪΌେมͰ͕͢

  9. ͓͢͢Ίͷຊ͕ ͋Γ·͢

  10. ॻ੶ൃߦͷ͓஌ΒͤɿৄղMySQL 5.7 ʙਐԽͨ͠MySQLΛΑ͘஌ΔͨΊͷςΫχΧϧΨΠυʙ

  11. ͜ΕΛಡΜͩΒ 5.7Λ࢖͍ͨ͘ͳΔ͸ͣ :)

  12. ࠓճ͸JSONܕʹ͍ͭͯ ௐ΂ͯདྷ·ͨ͠

  13. MySQLͷJSONܕͷಛ௃ • ετϨʔδΤϯδϯ্͸BLOBͱͯ֨͠ೲ͞Ε͍ͯΔ • JSON pathͰjsonͷ߲໨ΛࢀরͰ͖Δ • ->ԋࢉࢠ͕͋ΔͷͰɺSQL͕ͪΐͬͱݟ΍͍͢ • generated

    columnػೳͱ߹Θͤͯ࢖͏ͱɺjson಺ͷ߲໨ʹ ΠϯσοΫεషΕͨΓɺ੍໿Λ෇͚ͨΓग़དྷΔ
  14. Java͔Β࢖ͬͯΈͨ • αϯϓϧΞϓϦͷιʔε
 https://github.com/matsumana/mysql-json-sandbox
 • ؀ڥ • OSɿ CentOS 7.2

    (1511) • MySQLɿ 5.7.16 Community Edition • JDBC Driverɿ Connector/J 5.1.40 • Java8 (1.8.0_111) • Frameworkɿ Spring Boot 1.4.1 • ORMɿ MyBatis 3.4.0
  15. αϯϓϧΞϓϦΛ σϞ͠ͳ͕Β આ໌͍͖ͯ͠·͢

  16. ஫ҙ఺ • JSONܕΛ࢖͑͹σʔλΛॊೈʹѻ͑ͯ
 ศརͦ͏Ͱ͸͋Γ·͕͢ɺԿͰ΋͔ΜͰ΋1ͭͷΧϥϜʹೖΕ ͯ͠·͏ઃܭ͸ɺʮEAVΞϯνύλʔϯʯͱݺ͹Ε͍ͯ·͢
 ˞ࢀߟ
 PostgreSQLͷΞϯνύλʔϯ : ԿͰ΋͔ΜͰ΋jsonʹೖΕΔ

  17. ϦϯΫू • MySQL :: MySQL 5.7 Reference Manual :: 12.6

    The JSON Data Type • ॻ੶ൃߦͷ͓஌ΒͤɿৄղMySQL 5.7 ʙਐԽͨ͠MySQLΛΑ͘஌Δ ͨΊͷςΫχΧϧΨΠυʙ • MySQL 5.7.8͔ΒInnoDBͷgenerated column͸࣮ମΛऔΒͣʹΠϯ σοΫεΛ࡞ΕΔΑ͏ʹͳͬͨ • PostgreSQLͷΞϯνύλʔϯ : ԿͰ΋͔ΜͰ΋jsonʹೖΕΔ • SQLΞϯνύλʔϯ • αϯϓϧΞϓϦͷιʔε