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/

oracle4engineer

November 25, 2020
Tweet

More Decks by oracle4engineer

Other Decks in Technology

Transcript

  1. NoSQL
    Kyotaro Nonaka
    Technology Solutions Architect
    Oracle Corporation Japan
    November 25th, 2020

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide



  5. • EC
    • OCHaCafe 3 4

    Copyright © 2020, Oracle and/or its affiliates
    5
    @non_kyon

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  9. RDB
    • /
    • /



    9
    RDBMS NoSQL

    View full-size slide

  10. SQL(RDB)
    NoSQL Not Only SQL


    10
    Document
    KVS
    key value
    key value
    key value
    NoSQL

    View full-size slide

  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…

    View full-size slide

  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…

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide


  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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  19. Copyright © 2020, Oracle and/or its affiliates
    19
    database
    collection
    query
    query

    View full-size slide

  20. Document
    Document
    Document
    Document
    Copyright © 2020, Oracle and/or its affiliates
    20
    ..insert(<{Document}>)
    ..find()
    ..findOne() //1
    ..update(,{$set: {: }})
    ..remove()

    View full-size slide

  21. • ( )
    • GUI MongoDB Compass





    Copyright © 2020, Oracle and/or its affiliates
    21

    View full-size slide

  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,…}

    View full-size slide

  23. • Partition Key

    • Partition
    Clustering Key
    Copyright © 2020, Oracle and/or its affiliates
    23

    View full-size slide

  24. Copyright © 2020, Oracle and/or its affiliates
    24
    KVS -
    CQL -
    -
    OnP/IaaS/Managed AWS (Amazon MCS)
    ( )
    GUI Table Plus
    -

    View full-size slide

  25. 1. String CQL
    2. QueryBuilder CQL
    3. PreparedStatement CQL
    Copyright © 2020, Oracle and/or its affiliates
    25

    View full-size slide

  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

    View full-size slide







  27. Copyright © 2020, Oracle and/or its affiliates
    27
    CQL RDB

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  30. Copyright © 2020, Oracle and/or its affiliates
    30
    (OCI IAM )
    request

    View full-size slide



  31. • Not Null/Nullable
    • JSON
    Document
    • API(NoSQL SDK/OCI SDK) + SQL
    • / /
    Copyright © 2020, Oracle and/or its affiliates
    31
    RDB

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

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

    • API/SQL

    • OCI
    Copyright © 2020, Oracle and/or its affiliates
    36

    View full-size slide

  37. Copyright © 2020, Oracle and/or its affiliates
    37
    Document -
    API/SQL -
    -
    OnP/IaaS/Managed -
    - MySQL
    ACID
    GUI MySQL Workbench( )
    MySQL Workbench/OCI

    View full-size slide






  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 ->”$. ” =

    View full-size slide

  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
    … … …
    … … …
    … … …

    View full-size slide

  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

    View full-size slide

  41. • SQL Developer Web
    • SODA(NoSQL API) SQL



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

    View full-size slide

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

    View full-size slide

  43. • NoSQL










    Copyright © 2020, Oracle and/or its affiliates
    43
    :


    View full-size slide

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

    View full-size slide

  45. MongoDB
    Copyright © 2020, Oracle and/or its affiliates
    45

    View full-size slide

  46. • ( )
    • GUI MongoDB Compass





    Copyright © 2020, Oracle and/or its affiliates
    46

    View full-size slide

  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

    View full-size slide

  48. Copyright © 2020, Oracle and/or its affiliates
    48
    Document /
    MongoDB
    Cassandra
    Oracle NoSQL
    HBase
    MySQL
    AJD

    View full-size slide

  49. Autonomous JSON Database
    Copyright © 2020, Oracle and/or its affiliates
    49

    View full-size slide

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



    Copyright © 2020, Oracle and/or its affiliates
    50
    SQL MongoDB

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  53. MySQL Document Store
    Copyright © 2020, Oracle and/or its affiliates
    53

    View full-size slide






  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 ->”$. ” =

    View full-size slide

  55. • NoSQL








    Copyright © 2020, Oracle and/or its affiliates
    55
    NoSQL
    Web App

    View full-size slide

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

    View full-size slide

  57. Cassandra
    Copyright © 2020, Oracle and/or its affiliates
    57

    View full-size slide







  58. Copyright © 2020, Oracle and/or its affiliates
    58
    CQL RDB

    View full-size slide

  59. • NoSQL









    Copyright © 2020, Oracle and/or its affiliates
    59
    front
    NoSQL
    Server
    backend

    View full-size slide

  60. TTL
    MongoDB
    remove
    Cassandra
    Oracle NoSQL
    HBase
    MySQL
    AJD
    (Oracle Database)
    Copyright © 2020, Oracle and/or its affiliates
    60

    View full-size slide

  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

    HTML
    Functions

    View full-size slide

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

    View full-size slide

  63. Our mission is to help people see
    data in new ways, discover insights,
    unlock endless possibilities.

    View full-size slide