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

The theory of data modeling to become the friend of DynamoDB

The theory of data modeling to become the friend of DynamoDB

JAWS-UG Osaka re:Cap and Serverless (JAWS Daysでボツった話の方をざっくり)

Masashi Terui

March 17, 2018
Tweet

More Decks by Masashi Terui

Other Decks in Technology

Transcript

  1. THE THEORY OF DATA MODELING TO
    BECOME THE FRIEND OF DYNAMODB
    MASASHI TERUI @ JAWS DAYS 2018 JAWS-UG OSAKA RE:CAP&SERVERLESS

    View full-size slide

  2. WHY IS THE BUSINESS
    APPLICATION DIFFICULT
    TO BECOME SERVERLESS?
    • Stateful, Persistent
    • Difficult to parallelize, concurrent and asynchronous

    View full-size slide

  3. WHY IS THE BUSINESS
    APPLICATION DIFFICULT
    TO BECOME SERVERLESS?
    • Stateful, Persistent
    • Difficult to parallelize, concurrent and asynchronous
    NO!!

    View full-size slide

  4. DATA MODELING

    View full-size slide

  5. NOSQL MATCHES BETTER THAN RDB
    • Does RDB’s connection model not match serverless?
    • Yes, but it is not a main issue
    • The data model is a main issue
    • Does your application data match NoSQL(DynamoDB)?
    • In order to judge it, you need to know general database theory
    • The people who knows RDB also knows NoSQL

    View full-size slide

  6. DATA PLACEMENT Distributed by Partition Key

    and Indexed(B+tree) by Sort Key, LSI
    GSI is a projection of sorted(indexed) data

    View full-size slide

  7. B+TREE INDEX B-treeͳͷ͔B+treeͳͷ͔͸ެද͞Ε͍ͯͳ͍͚Ͳ
    Range Keyͱ͔ݺͿ͘Β͍͔ͩΒ…Ͷʁ

    View full-size slide

  8. TARGETING QUERY B+treeͷߏ଄Λ஌͍ͬͯΕ͹
    ૊Έ߹ΘͤΩʔͷΠϯσοΫε͕ແͯ͘΋
    ͜͏΍Ε͹ྑ͍͜ͱ͕෼͔Δ

    View full-size slide

  9. ACID VS BASE?
    • It is not antinomy
    • Simply relationships can be consistent
    with denormalization
    • Discard the strong consistency 

    for the search queries
    • It is similar to the RDB replicas
    • It is difficult to replace the RDB master

    View full-size slide

  10. “DATA MODEL IS THE MAIN ISSUE”
    THANKS!!
    “NEED TO KNOW GENERAL DATABASE THEORY”
    “LET'S EXPAND SERVERLESS WORLD”

    View full-size slide