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
PRO

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 Slide

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

    View Slide

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

    View Slide

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

    View Slide



  5. • EC
    • OCHaCafe 3 4

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  9. RDB
    • /
    • /



    9
    RDBMS NoSQL

    View Slide

  10. SQL(RDB)
    NoSQL Not Only SQL


    10
    Document
    KVS
    key value
    key value
    key value
    NoSQL

    View 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 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 Slide

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

    View Slide

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

    View Slide

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

    View 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 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 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 Slide

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

    View Slide

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

    View Slide

  21. • ( )
    • GUI MongoDB Compass





    Copyright © 2020, Oracle and/or its affiliates
    21

    View 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 Slide

  23. • Partition Key

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

    View Slide

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

    View Slide

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

    View 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 Slide







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

    View 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 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 Slide

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

    View Slide



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

    View 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 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 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 Slide

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

    View Slide

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

    • API/SQL

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

    View 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 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 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 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 Slide

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



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

    View Slide

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

    View Slide

  43. • NoSQL










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


    View Slide

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

    View Slide

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

    View Slide

  46. • ( )
    • GUI MongoDB Compass





    Copyright © 2020, Oracle and/or its affiliates
    46

    View 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 Slide

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

    View Slide

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

    View Slide

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



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

    View 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 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 Slide

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

    View 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 Slide

  55. • NoSQL








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

    View Slide

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

    View Slide

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

    View Slide







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

    View Slide

  59. • NoSQL









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

    View Slide

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

    View 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 Slide

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

    View Slide

  63. View Slide

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

    View Slide