Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

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/

oracle4engineer

November 25, 2020
Tweet

More Decks by oracle4engineer

Other Decks in Technology

Transcript

  1. • • • EC • OCHaCafe 3 4 • Copyright

    © 2020, Oracle and/or its affiliates 5 @non_kyon
  2. SQL(RDB) NoSQL Not Only SQL • • 10 Document KVS

    key value key value key value NoSQL
  3. 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…
  4. 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…
  5. • • / • 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
  6. 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
  7. Copyright © 2020, Oracle and/or its affiliates 18 Document(JSON )

    - MongoDB - OnP/IaaS/Managed Atlas Sharding TTL GUI Compass( ) Robo 3T mongo-express
  8. 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>)
  9. • ( ) • GUI MongoDB Compass • • •

    • • Copyright © 2020, Oracle and/or its affiliates 21
  10. • 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,…}
  11. Copyright © 2020, Oracle and/or its affiliates 24 KVS -

    CQL - - OnP/IaaS/Managed AWS (Amazon MCS) ( ) GUI Table Plus -
  12. 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
  13. • • • • • • Copyright © 2020, Oracle

    and/or its affiliates 27 CQL RDB
  14. • 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
  15. Copyright © 2020, Oracle and/or its affiliates 29 KVS/Document -

    API/SQL - JSON Managed - ACID order by, group by (table 5 ) GUI OCI OCI
  16. • • • Not Null/Nullable • JSON Document • API(NoSQL

    SDK/OCI SDK) + SQL • / / Copyright © 2020, Oracle and/or its affiliates 31 RDB
  17. • 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 …
  18. • 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
  19. 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
  20. • MySQL (V5.7~) • Document(JSON) • MySQL RDBMS CA •

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

    API/SQL - - OnP/IaaS/Managed - - MySQL ACID GUI MySQL Workbench( ) MySQL Workbench/OCI
  22. • • • • • • 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 ->”$. ” =
  23. • Oracle Database Document 1 • JSON • RDBMS CA

    • JSON • • • • SODA NoSQL API /SQL Copyright © 2020, Oracle and/or its affiliates 39 id col1 col2 json … … … … … … … … …
  24. 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
  25. • SQL Developer Web • SODA(NoSQL API) SQL • •

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

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

    Cassandra Oracle NoSQL HBase MySQL JSON_TABLE() AJD JSON_*AGG()
  28. • ( ) • GUI MongoDB Compass • • •

    • • Copyright © 2020, Oracle and/or its affiliates 46
  29. 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
  30. Copyright © 2020, Oracle and/or its affiliates 48 Document /

    MongoDB Cassandra Oracle NoSQL HBase MySQL AJD
  31. • SQL Developer Web • SODA(NoSQL API) SQL • •

    • Copyright © 2020, Oracle and/or its affiliates 50 SQL MongoDB
  32. 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
  33. 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
  34. • • • • • • 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 ->”$. ” =
  35. • NoSQL • • • • • • • •

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

    Cassandra Oracle NoSQL Aggregate Expressions HBase Region MySQL AJD Auto Scaling
  37. • • • • • • Copyright © 2020, Oracle

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

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

    Database) Copyright © 2020, Oracle and/or its affiliates 60
  40. 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
  41. Our mission is to help people see data in new

    ways, discover insights, unlock endless possibilities.