Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
MySQL Server��� �MySQL Shell�����updated: 2019/08/23
�� ���/Machiko IkomaMySQL Global Business UnitOracle Japan
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Safe Harbor Statement��G�2H3 �G�#�E&�G���F0>R�'T)�>RMGC>4J@3���T�G��D>RMGC5Q369ER� FM!K-L;DHC:J?U4��G�2H3_\cVdNYf^3�"T��>R;DTY`[]ae]>RMGCHE6�3+*��T$71G����FE<PE6C�<64
WbXd&�F0=B(,<SB6R�"G/�3ccfZ8OI��FA6BH3 �G%.FOQ��<SJ>4
2
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 3
MySQL Shell��������
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
�������
4
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 5
MySQL#��
4.0����/GIS (MyISAM)��?WIRUPDATE/DELETE�$�$P)IPQ�5WE
OracleMySQL Sun
3.23MyISAMInnoDBSJQ3W7OU
5.1JP2/IRV9ASW8,U8UV'W0?1=MFW?(7ODU2<91938NWP
5.6memcached APIUNDO���Global Transaction ID�� ��������(DB)�����ALTER TABLE���������%&
5.5InnoDB�������$�#��������PERFORMANCE_SCHEMA
1.0-3.22��9ASW8,U8U (ISAM, HEAP)KR=9S>BWindows /64bit ����4WB (SJIS/UJIS)
5.09A'BJT7W8M9A'BH&U17OU.W;R/AQ//GNWXAAPU617OUINFORMATION_SCHEMA
4.1Unicode!"����CSV, ARCHIVEndbcluster
1995 2000 2005 2010 2015
5.7�49AL@R-J?(K)6T9S9 SJQ3W7OUKR=;W9�������2RWJSJQ3W7OUKR=9S>B9SWI����CJK /GIS (InnoDB):0NQ?(�� ([_]`^ZY_\ )NoSQL-J7OU (JSON)General Tablespace Performance: Benchmark
V 1995�X9*+W@U"!MySQL AB��(2005�X-P1R Innobase Oy%��)V 2008�XSun Microsystems MySQL AB%��V 2010�X-P1R Sun Microsystems%��
8.0 GA2018�4�19� – 8.0.11GA@W<@(17OCQ�4WButf8mb4Invisible Indexes:0NQ?(ROLEDescending Index, etc
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
• 5.7.12���
6
5.7.12
2015/4/8
5.7GA(5.7.9)
2016/4/11 2017/4/11
5.7.18
2017/4/12
1.0.9
MySQL Server
MySQL Shell
MySQL Shell���
1.0.3��
2016/4/11 2019/7/22
8.0.17
2017/4/18
8.0GA(8.0.11)
2019/7/22
8.0.17
2017/4/18
8.0.11
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 7
���������MySQL Shell
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
��>�����"=*2#?)
�����(5?/
�JavaScript�Python�SQL
����������
>1,+
>"=*9&-!3
�MySQL8?-!:-!> ,4';?0+#,$?
>JSON"=5?/>��.?*<?0
� ����API>0%76=/)/ �
>InnoDB&9)*�
8
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
����� �
• JavaScript, Python, SQL����
9
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
�����"���
10
1-,��
• ):02$&7"���#���•������6+&8(/ ��
&9*5(.%3��
•��"�����!��• ':/)946:/���� �
print(Date());print("¥n");
code.js
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
�&�$&�JSON�% &�����#&�����&
③MySQL!&��"��
importTable()importJson()checkForServerUpgrade()
�&� $&�������
11
BSON �% &����
5.7��8.0� ����#&�����
8.0.17
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
������API
12
(�-,1'$'��
• X*0'"//X Dev API�.&)1!
• NoSQL����CRUD���
InnoDB .$%��• #1(+& $�1$%1$���2��• MySQL�1$%1$���2��• MySQL�1$%1$���2� • .$%3����2�2��
MySQL ShellX Dev API
X*0'"/
MySQL Server
X*.!�1
X*0'"/TCP
UpdateReadCreate Delete
MySQL Shell
MySQL Router ��
����
����
���� �����
� �����
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
���,,,
•� &�'-)������•$*+$#��� "%�!���•�*�������•MySQL Shell��$�(+��������
,,,����
13
MySQL ShellSetup, Manage,
Orchestrate
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
�4%A&+����
���� *7A1
�JavaScript�Python�SQL
����� ����
@3.-
@#?,;(/"5
�MySQL:A/"</"@!.6)=A2-$.&A
@JSON#?7A1@��0A,>A2
������API@2'98?1+1!�
@InnoDB(;+,�
14
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 15
���������MySQL Shell
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
������������������ Architecture from the Application’s POV
16
���� ��
CRUD �� �� + JSON
��� �� MySQL
JSON
�����������������
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
MySQL����"������"���#�•MySQL Shell• Connector/C++• Connector/J• Connector/Node.js• Connector/NET• Connector/Python
17
��!�#��"��MySQL���� ��
MySQL��� ��"�(mysql���)
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
�+&*
• @mysql_jp���+$�”���”����"�,$TOP3����(8/21 �)
18
"�,$#,!�JSON��
MySQL�JSON#,!����
MySQL�JSON#,!������
tweepy
JSON�+',$
%�)(+$ $���
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
������JSON���
19
ID, ������, ���,���,� ������ all_tweets.json
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
MySQL�JSON�!����• MySQL Shell�� ����
• util.import_json(<JSON�����>�< ����>)
20
�%�(, ����
schema: JSON��,&-"��DB�collection: JSON��,&-"���+��(,�tableColumn: JSON��,&-"���)'�convertBsonTypes: BSON�!- ��������TrueconvertBsonOid: MongoDB ObjectID��������True
�convertBsonTypes���� �����extractOidTime: �'� ,%�����$�-*#�
�convertBsonOid�True���������
mysqlsh <�!��>:pwd@<�!�!�|IP����>
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
MySQL�JSON�����•���
21
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
MySQL!JSON6C3"���'���#�!��"2C7�D�(��
•���&+:0*-7�;248
22
;248 ��
db.<.@-/=A�>.find() ��� .@-/=A�%8,<;A7��
db.<.@-/=A�>.find().sort(<9)C?8�> [ASC|DESC]) ��� 9)C?8(�"��B��"2C7
db.<.@-/=A�>.find().limit(<���>) ���&���(��
+:0*-7 ��
db ���'� �$5C:?(��&DBdb.get_collection() DB��$.@-/=A$>17
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
MySQL�JSON� �����•���
23
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
MySQL�JSON� �����(SQL)•���
24
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
JSON Functions
25
MySQL 5.7 and 8.0
JSON_ARRAY_APPEND()
JSON_ARRAY_INSERT()
JSON_ARRAY()
JSON_CONTAINS_PATH()
JSON_CONTAINS()
JSON_DEPTH()
JSON_EXTRACT()
JSON_INSERT()
JSON_KEYS()
JSON_LENGTH()
JSON_MERGE[_PRESERVE]()
JSON_OBJECT()
JSON_QUOTE()
JSON_REMOVE()
JSON_REPLACE()
JSON_SEARCH()
JSON_SET()
JSON_TYPE()
JSON_UNQUOTE()
JSON_VALID()
JSON_PRETTY()
JSON_STORAGE_SIZE()
JSON_STORAGE_FREE()
JSON_ARRAYAGG()
JSON_OBJECTAGG()
JSON_MERGE_PATCH()
JSON_TABLE()
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
��
26
�
�
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 27
������� �����!
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 28
MySQL Shell������
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Q: mysql���� �����"A: mysqlsh=mysql+JSON��+α
mysql���� �����JSON����!���������� ������ ���
29Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
��>�����"=*2#?)
�����(5?/
�JavaScript
�Python
�SQL
����������
>1,+
>"=*9&-!3
�MySQL8?-!:-!> ,4';?0+#,$?
>JSON"=5?/
>��.?*<?0
� ����API>0%76=/)/ �
>InnoDB&9)*�
Confidential – Oracle Internal/Restricted/Highly Restricted 9
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Q: ��-$.41�MySQL Shell��� ��5
A:������%&4( '*%"0*(���-$.41�)%�������
*2#/,��-$.41�!3+4(���������
30
python:��PYTHONPATH����mysqlshrc.pyJavaScript:��MYSQLSH_JS_MODULE_PATH����shell.js_module_paths
python: importJavaScript: require
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 31
����
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
���#-)3�
32
8/28 '3$#�.1&�,"(+0 &�"
8/30 '3$#�.1&�,"(+0 &�"
8/27 Technology Cafe #59/12 *% �%+4*3!/2�%+
Fukuoka
Osaka
Tokyo
Sendai
Sapporo10/?? Innovation Day
9/3 *% �%+4*3!/2�%+Nagoya
10/?? Innovation Day
10/3 OOW��
9/9 *% �%+4*3!/2�%+
9/18 *% �%+4*3!/2�%+
�#-)3����������� �����������
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
MySQL����� �������•MySQL������
www.mysql.com/jp•MySQL ����
www.mysql.com/jp/news-and-events/events/•MySQL Twitter
@mysql_jp
33
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
����MySQL Shell User Guide https://dev.mysql.com/doc/mysql-shell/8.0/en/
X DevAPI User Guide https://dev.mysql.com/doc/x-devapi-userguide/en/
MySQL Shell 8.0 JavaScript API Reference https://dev.mysql.com/doc/dev/mysqlsh-api-javascript/8.0/
MySQL Shell 8.0 Python API Reference https://dev.mysql.com/doc/dev/mysqlsh-api-python/8.0/
JavaScript Quick-Start Guide: MySQL Shell for Document Storehttps://dev.mysql.com/doc/refman/8.0/en/mysql-shell-tutorial-javascript.html
Python Quick-Start Guide: MySQL Shell for Document Storehttps://dev.mysql.com/doc/refman/8.0/en/mysql-shell-tutorial-python.html
34
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 35
���
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 36
���
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
��#3$4�MySQL%57.4/'-(2,*+��MySQL�&07+"6',!�������
(&07+"6',!)
����MySQL��������������%57.4�)71�������� �8
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Senior MySQL Support Engineer• 1��1����1�1�"%-0��*2.1�"%� •���3Internet&��$"(��•����309:00 – 17:00• Skill:–���–�� ��'��$%#*/+,$'�)%! by Adam Dixon–MySQL– C,C++
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 39