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

Oracle Cloud Hangout Cafe - 明解! NoSQLの勘所

Oracle Cloud Hangout Cafe - 明解! NoSQLの勘所

Oracle Cloud Hangout Cafe(おちゃかふぇ)のセッションスライドです。
#ochacafe

(セッションの録画)
https://youtu.be/otNGEAQvTmI

(イベントページ)
https://ochacafe.connpass.com/event/193638/

3115a782126be714b5f94d24073c957d?s=128

oracle4engineer

November 25, 2020
Tweet

Transcript

  1. NoSQL Kyotaro Nonaka Technology Solutions Architect Oracle Corporation Japan November

    25th, 2020
  2. Copyright © 2020, Oracle and/or its affiliates 2

  3. NoSQL Copyright © 2020, Oracle and/or its affiliates 3

  4. 4 Copyright © 2020, Oracle and/or its affiliates 1. 2.

    NoSQL 3. / 4. NoSQL
  5. • • • EC • OCHaCafe 3 4 • Copyright

    © 2020, Oracle and/or its affiliates 5 @non_kyon
  6. Copyright © 2020, Oracle and/or its affiliates 6 NoSQL RDBMS

  7. RDB NoSQL RDB Copyright © 2020, Oracle and/or its affiliates

    7
  8. RDB ⇒RDB NoSQL ⇒ NoSQL RDB NoSQL Copyright © 2020,

    Oracle and/or its affiliates 8
  9. RDB • / • / • • • 9 RDBMS

    NoSQL
  10. SQL(RDB) NoSQL Not Only SQL • • 10 Document KVS

    key value key value key value NoSQL
  11. NoSQL CAP CAP • 3 2 • • • Copyright

    © 2020, Oracle and/or its affiliates 11 C A P Availability( ) Consistency( ) (Partition Tolerance) CA Oracle, MySQL, Postgres etc… AP DynamoDB, Cassandra etc… CP MongoDB, HBase etc…
  12. CA • (C) (A) • 2 (P) CP • (C)

    (P) • AP • (A) (P) • Copyright © 2020, Oracle and/or its affiliates 12 C A P Availability( ) Consistency( ) (Partition Tolerance) CA Oracle, MySQL, Postgres etc… AP DynamoDB, Cassandra etc… CP MongoDB, HBase etc…
  13. NoSQL Copyright © 2020, Oracle and/or its affiliates 13

  14. Copyright © 2020, Oracle and/or its affiliates 14

  15. Copyright © 2020, Oracle and/or its affiliates 15 ※Redis Coherence

  16. • • / • SPOF CP ( CA ) •

    JSON-like • • • MongoDB Value • OSS OnP/IaaS • • Copyright © 2020, Oracle and/or its affiliates 16 database Collection Document Document Document RDB RDB
  17. shard Copyright © 2020, Oracle and/or its affiliates 17 Load

    Balancer App mongos App mongos mongod mongod mongod mongod mongod mongod mongod mongod mongod shard1 shard3 shard2 1 2 3
  18. Copyright © 2020, Oracle and/or its affiliates 18 Document(JSON )

    - MongoDB - OnP/IaaS/Managed Atlas Sharding TTL GUI Compass( ) Robo 3T mongo-express
  19. Copyright © 2020, Oracle and/or its affiliates 19 database collection

    query query
  20. Document Document Document Document Copyright © 2020, Oracle and/or its

    affiliates 20 <database>.<collection>.insert(<{Document}>) <database>.<collection>.find(<query>) <database>.<collection>.findOne(<query>) //1 <database>.<collection>.update(<query>,{$set: {<key>: <value>}}) <database>.<collection>.remove(<query>)
  21. • ( ) • GUI MongoDB Compass • • •

    • • Copyright © 2020, Oracle and/or its affiliates 21
  22. • Facebook OSS NoSQL • KVS • CAP AP •

    Table Key Value Row • • • • SQL-like CQL • • • Copyright © 2020, Oracle and/or its affiliates 22 Keyspace Table Row Column1 Partition Key1 Value Column2 arr[v,…] Column3 map{k:v,…} Row Column1 Partition Key2 Value Column2 arr[v,…] Column3 map{k:v,…} Row Column1 Partition Key3 Value Column2 arr[v,…] Column3 map{k:v,…}
  23. • Partition Key • • Partition Clustering Key Copyright ©

    2020, Oracle and/or its affiliates 23
  24. Copyright © 2020, Oracle and/or its affiliates 24 KVS -

    CQL - - OnP/IaaS/Managed AWS (Amazon MCS) ( ) GUI Table Plus -
  25. 1. String CQL 2. QueryBuilder CQL 3. PreparedStatement CQL Copyright

    © 2020, Oracle and/or its affiliates 25
  26. CQL • / (=, >, <, >=, <=) • IN

    • LIKE • ORDER BY • GROUP BY • LIMIT CQL • != • NOT • OR • IS NULL/ IS NOT NULL NULL • JOIN • OFFSET Copyright © 2020, Oracle and/or its affiliates 26 SQL
  27. • • • • • • Copyright © 2020, Oracle

    and/or its affiliates 27 CQL RDB
  28. • Oracle NoSQL • KVS Document(JSON) • CAP AP C

    • KVS • • (KVS)/ (JSON) • API/SQL • / • Oracle Copyright © 2020, Oracle and/or its affiliates 28 Integer (key) String (data) String (data) Json (data) num1 string1 string1 json1 num2 string2 string2 json2 num3 string3 string3 json3 num4 string4 string4 json4 DATA CAPACITY PROVISIONED STORAGE READ WRITE NoSQL Table
  29. Copyright © 2020, Oracle and/or its affiliates 29 KVS/Document -

    API/SQL - JSON Managed - ACID order by, group by (table 5 ) GUI OCI OCI
  30. Copyright © 2020, Oracle and/or its affiliates 30 (OCI IAM

    ) request
  31. • • • Not Null/Nullable • JSON Document • API(NoSQL

    SDK/OCI SDK) + SQL • / / Copyright © 2020, Oracle and/or its affiliates 31 RDB
  32. • Hadoop OSS • • MongoDB CP CA • Table

    Row Row key Column Qualifier Column Qualifier Column Family • • • • API • Copyright © 2020, Oracle and/or its affiliates 32 Namespace Table Row Key Column Family Column Family Qualifier Qualifier Qualifier Qualifier Row1 value1 value2 value3 value4 Row2 value5 value6 value7 value8 …
  33. • Region: HBase Region • • Region Server: Region HDFS

    + • • Row Key, Column Family, Column Qualifier key Value Copyright © 2020, Oracle and/or its affiliates 33 Row Key CF1 CF2 CQ1 CQ2 CQ3 CQ4 Row1 value1 value2 value4 Row2 value5 value7 value8 Row Key CF CQ Value Row1 CF1 CQ1 value1 Row1 CF1 CQ2 value2 Row1 CF2 CQ4 value4 Row2 CF1 CQ1 value5 Row2 CF2 CQ3 value7 Row2 CF2 CQ4 value8 HDFS Region Server Region Region Server Region HBase Client
  34. Copyright © 2020, Oracle and/or its affiliates 34 - API

    Apache Phoenix SQL OnP/IaaS - Region Server OCC: (Row Key > CF > CQ > Timestamp) GUI HUE: Hadoop HUE: Hadoop
  35. Copyright © 2020, Oracle and/or its affiliates 35

  36. • MySQL (V5.7~) • Document(JSON) • MySQL RDBMS CA •

    JSON • • API/SQL • • OCI Copyright © 2020, Oracle and/or its affiliates 36
  37. Copyright © 2020, Oracle and/or its affiliates 37 Document -

    API/SQL - - OnP/IaaS/Managed - - MySQL ACID GUI MySQL Workbench( ) MySQL Workbench/OCI
  38. • • • • • • X DevAPI: X API

    DocumentStore API • X DevAPI CRUD • Collection ⇒add(), find(), modify(), remove() • Table ⇒insert(), select(), update(), delete() Copyright © 2020, Oracle and/or its affiliates 38 SQL X DevAPI WHERE ->”$. ” =
  39. • Oracle Database Document 1 • JSON • RDBMS CA

    • JSON • • • • SODA NoSQL API /SQL Copyright © 2020, Oracle and/or its affiliates 39 id col1 col2 json … … … … … … … … …
  40. Copyright © 2020, Oracle and/or its affiliates 40 Document API/SQL

    - Managed Auto Scaling ACID JSON Search Index GUI SQL Developer Web Free Tier (ATP/ADW JSON ) OCI
  41. • SQL Developer Web • SODA(NoSQL API) SQL • •

    • Copyright © 2020, Oracle and/or its affiliates 41 SQL MongoDB
  42. Copyright © 2020, Oracle and/or its affiliates 42

  43. • NoSQL • • • • • • • •

    • • Copyright © 2020, Oracle and/or its affiliates 43 : 表 書
  44. Copyright © 2020, Oracle and/or its affiliates 44 MongoDB Aggregation

    Cassandra Oracle NoSQL HBase MySQL JSON_TABLE() AJD JSON_*AGG()
  45. MongoDB Copyright © 2020, Oracle and/or its affiliates 45

  46. • ( ) • GUI MongoDB Compass • • •

    • • Copyright © 2020, Oracle and/or its affiliates 46
  47. JSON • • • • • • • • Copyright

    © 2020, Oracle and/or its affiliates 47 ID SNS_ID 0001 A 00001 0002 B 00002 { “entities”: { “hashtags”: [], “user_mentions”: [ “screen_name”: …, ] } } : SNS ID JSON 00001 json 00002 json
  48. Copyright © 2020, Oracle and/or its affiliates 48 Document /

    MongoDB Cassandra Oracle NoSQL HBase MySQL AJD
  49. Autonomous JSON Database Copyright © 2020, Oracle and/or its affiliates

    49
  50. • SQL Developer Web • SODA(NoSQL API) SQL • •

    • Copyright © 2020, Oracle and/or its affiliates 50 SQL MongoDB
  51. NoSQL • • • • • • • Copyright ©

    2020, Oracle and/or its affiliates 51 ID SNS_ID 0001 A 00001 0002 B 00002 { “entities”: { “hashtags”: [], “user_mentions”: [ “screen_name”: …, ] } } : SNS ID JSON 00001 json 00002 json
  52. Copyright © 2020, Oracle and/or its affiliates 52 MongoDB MongoDB

    Document Cassandra CQL KVS Oracle NoSQL API + SQL KVS/Document HBase API + (SQL) HDFS MySQL SQL MySQL Document AJD SQL (SODA) Oracle Database Document
  53. MySQL Document Store Copyright © 2020, Oracle and/or its affiliates

    53
  54. • • • • • • X DevAPI: X API

    DocumentStore API • X DevAPI CRUD • Collection ⇒add(), find(), modify(), remove() • Table ⇒insert(), select(), update(), delete() Copyright © 2020, Oracle and/or its affiliates 54 SQL X DevAPI WHERE ->”$. ” =
  55. • NoSQL • • • • • • • •

    Copyright © 2020, Oracle and/or its affiliates 55 NoSQL Web App
  56. Copyright © 2020, Oracle and/or its affiliates 56 MongoDB Sharding

    Cassandra Oracle NoSQL Aggregate Expressions HBase Region MySQL AJD Auto Scaling
  57. Cassandra Copyright © 2020, Oracle and/or its affiliates 57

  58. • • • • • • Copyright © 2020, Oracle

    and/or its affiliates 58 CQL RDB
  59. • NoSQL • • • • • • • •

    • Copyright © 2020, Oracle and/or its affiliates 59 front NoSQL Server backend
  60. TTL MongoDB remove Cassandra Oracle NoSQL HBase MySQL AJD (Oracle

    Database) Copyright © 2020, Oracle and/or its affiliates 60
  61. 1. Oracle NoSQL Database(CS) 2. / • API Gateway Functions

    Object Storage HTML • Oracle NoSQL SessionID(TTL ) • • Copyright © 2020, Oracle and/or its affiliates 61 API Gateway user_id password ochacafe ochacafe1234 … user_id session_id ochacafe <session-id> … HTML Functions
  62. 62 Copyright © 2020, Oracle and/or its affiliates

  63. None
  64. Our mission is to help people see data in new

    ways, discover insights, unlock endless possibilities.