狠狠撸

狠狠撸Share a Scribd company logo
Introduction to MongoDB
2019. 10
Naver
???
Background
Database paradigms
Document
SQL Databases NoSQL Databases
Relational
Analytical
Key-Value Column Family
1
1
1
1
1
1
Graph
Database paradigms
Document
SQL Databases NoSQL Databases
Relational
Analytical
Key-Value Column Family
1
1
1
1
1
1
Graph
Database
Relational
Database
==
???? ????
Mysql ?
Oracle ?
??? ?? : https://www.w3resource.com/mongodb/nosql.php
??? ??????? ??
???? ??? ??? ??
Scale up Scale out
??? ??????? ??
Scale up (?? ??)
● ? ?? ????, ???, ??? ??
● Scale up?? ??? ??
● ? ?? ??? ????? ??? ?? ???
Scale out (?? ??)
● ??? ??? ?? ?? ????? ??
● ??? ?? ?? ?
Scale up
Scale out
??? RDB? Scale out? ???
????? ??!
??? RDB? Scale out? ???
????? ??!
But
??? ??????? ?????
????? ?? ?? ??
??? RDB? Scale out? ???
????? ??!
But
??? ??????? ?????
????? ?? ?? ??
And
????? ???? ?? ??? ??
?????? ???? ?? ??
??? RDB? Scale out? ???
????? ??!
But
??? ??????? ?????
????? ?? ?? ??
And
????? ???? ?? ??? ??
?????? ???? ?? ??
And
?? ??? ?? ???? ??? ??
NoSQL? ??
What is NoSQL?
Not Only SQL
Non-Relational
Next-generation Databases
Distributed Architecture
Open Source
Database paradigms
Document
SQL Databases NoSQL Databases
Relational
Analytical
Key-Value Column Family
1
1
1
1
1
1
Graph
Database paradigms
Document
SQL Databases NoSQL Databases
Relational
Analytical
Key-Value Column Family
1
1
1
1
1
1
Graph
Introduction to MongoDB
What is MongoDB?
Hu(mongo)us DB
● Document Database
● Key Features
○ Horizontal Scalability
○ High Performance
○ High Availability
○ Rich Query Language
What is MongoDB?
Hu(mongo)us DB
● Document Database
● Key Features
○ Horizontal Scalability
○ High Performance
○ High Availability
○ Rich Query Language
Document Database
??? (JSON, XML, BSON ?)? ???? ????? ??? ??????
● ??
○ ?-? ??? ??
○ ?? ???, ?? ???? ??? ??(??, ???, ??)?? ??(??, ??)
??? ?
{
"name":"mino",
"age":26,
"status":"A",
"groups":[
"news",
"sports"
]
}
JSON
<name>mino</name>
<age>26</age>
<status>A</status>
<groups>news</groups>
<groups>sports</groups>
XML
Mongodb ?? ??
JSON-style ??? BSON?? ??
{ hello":"world" }
x16x00x00x00x02hellox00
x06x00x00x00worldx00x00
MongoDB RDBMS
??????(Database) ??????(Database)
???(Collection) ???(Table)
??(Document) ???(Record or Row)
??(Field) ??(Column)
???(Index) ???(Index)
???(Embedding) & ??(Reference) ??(Join)
MongoDB vs RDBMS
Schema-less
Schema : ??? ??? ??? ???? ?? ??? ??? ?
● RDBMS? ???? ??
● ??? ?
○ ???
○ ??
○ ?? ?
○ ?? ?
○ ?? ??
Schema-less
Schema-less : ??? ??? ??? ???? ?? ??? ???? ??? ?
● ? ?? ???(?exibility)
{
"author":"mino",
"text":"..."
}
{
"author":"kimmino",
"text":"...",
"tags":[ "mongodb" ]
}
Schema-less
Schema-less : ??? ??? ??? ???? ?? ??? ???? ??? ?
● ? ?? ??(responsibility)
○ ???? ?? ??? ?? ?? ???? ???????? ??? ??? ??
?? ?? ??
?????? ??
?? ??? ????
?? ?? ?? ???
????
??? ??? ????
MongoDB
What is MongoDB?
Hu(mongo)us DB
● Document Database
● Key Features
○ Horizontal Scalability
○ High Performance
○ High Availability
○ Rich Query Language
● ???? ?? ??? ???? ???? ???? ??
● ??? ???? ?? ???? ?? ??
Sharding
Shard A
256GB
Shard B
256GB
Shard C
256GB
Shard D
256GB
Collection 1
1 TB
1 TB1 TB
1 TB
Collection 1
Sharded Cluster Components
● Con?g Server
○ ???? ????? ??
● Router (mongos)
○ ????? ?????
● Shard Server
○ ???? ??
Sharding in MongoDB
Shard 1
(replica set)
Shard 2
(replica set)
Con?g Servers
(replica set)
Router
(mongos)
Router
(mongos)
??? ? ???? ?? ???? ?????
?? ??? ???? ????? ? ? ??? ??? ??
● ??? ??
● ???? ????? ????? ??
● ?? 64MB
Chunk
Shard 1
(replica set)
Shard 2
(replica set)
Con?g Server
Router
(mongos)
chunk-1 shard-1
chunk-2 shard-2
chunk-3 shard-1
chunk-4 shard-1
Chunks
chunk-1
chunk-3
chunk-4
Collection A
chunk-2
Collection A
?? ?? ?? ???? ??? ??? ??? ???? ?? ??? ???? ????
????
● ?? ? ?? ??? ?? ??? ??? ??
● ?? ?? ??? ?? ??? ?? ??
● ?? ? ??? ?? ???? ???? ???? ?? ???? ??
Ranged Sharding
?? ? ?? ???? ???? ??? ???? ?? ??
● ?? ??? MD5? ??
● ?? ??? Ranged Sharding? ??
● ?? ? ?? ?????? ???? ?? ??
Hashed Sharding
What is MongoDB?
Hu(mongo)us DB
● Document Database
● Key Features
○ Horizontal Scalability
○ High Performance
○ High Availability
○ Rich Query Language
Index
MongoDB? ?? ??? ?? ??? ??? ??
● _id ?eld? ???? ???? ??
● ?? Index
○ Single Field : ??? ??? ?? ???
○ Compound Index : 1? ?? ??? ?? ???
○ Multikey Index : ?? ??? ?? ???
○ Geospatial Index : ?? ?? ???, 2d, 2dsphere ??? ??
○ Text Index : ??? ??? ?? ???
○ Hashed Index : ?? ?? ??? ???
Index
What is MongoDB?
Hu(mongo)us DB
● Document Database
● Key Features
○ Horizontal Scalability
○ High Performance
○ High Availability
○ Rich Query Language
Replication
????(High Availability)? ?? ??(Data Redundancy)? ??? ?? ??
● Primary
○ ??? ?? ??
Replication
● Secondary
○ ??? ???? ????? ???? ?????? ??? ??? ? ??
○ ?????? ?? ?? ??? ?? ??? ?? ???? ?? ? ???
????? ??? ?
○ ??? ?? ??? Read Preference? ?? ???? ??? ?? ??
Replication
● Arbiter
○ ?? ???? ?? ?? ?? ????? ???? ???? ??
○ HA? ???? ?? ???? ?? ?? 3? ??? ??? ???? ???
???? ?? ??? ??
????? ?? ??
Primary
Secondary Secondary
ReplicationReplication
????? ?? ??
Primary
Secondary Secondary
ReplicationReplication
Heartbeat
Heartbeat Heartbeat
????? ?? ??
Primary
Secondary Secondary
ReplicationReplication
Heartbeat
Heartbeat Heartbeat
????? ?? ??
Primary
Secondary Secondary
Heartbeat
????? ?? ??
Primary
Secondary Secondary
Heartbeat
Election for New Primary
????? ?? ??
Primary
Primary Secondary
Heartbeat
Replication
Summary
Key Features
● Horizontal Scalability
○ ??? ?? ??
● High Performance
○ ???? ????? ??? ??? ??? ??
● High Availability
○ ???? ?? ?? ??
● Rich Query Language
○ CRUD ?? ??? Data Aggregation? Text search, Geospatial ??? ??
Designing for
Document Database
??? ?? ??
?????? ???? ??
● ?? ?? ??
● ??? ?? ??
??? ?? ??
● ??? ??
● ?? ??
● ??? ??
??? ?? ??
?????? ???? ??
● ?? ?? ??
● ??? ?? ??
??? ?? ??
● ??? ??
● ?? ??
● ??? ??
??? ?? (Relational Model)
??? ?????? ??
● ???(Normalization)
○ ??? ?? ??
○ ?? ??(anomalies) ??
??? ?? (Relational Model)
???(one-to-many) ??
● ??? - ??, ??? - ??,
??? - ???
● ??, ??, ???? ??
???? ??? ??? ?????
???? ??
??? ?? (Relational Model)
???(many-to-many) ??
● ??? ??? ??? ??
???? ???? ??
● ??? ???? ?? ??? ???
?? ? ??,
??? ??? ??? ?? ????
?? ? ??
??? ?? (Relational Model)
???(many-to-many) ??
● ??? ??? ??? ?? ???? ??
● ??? : ??? ?? = 1 : n
??? ?? : ??? = 1: n
??? ???
?? ?? (Document Model)
"user_id": 251,
"first_name": "Bill",
"last_name": "Gates",
"summary": "Co-chair of the Bill & Melinda Gates... Active blogger.",
"region_id": "us:91",
"industry_id": 131,
"photo_url": "/p/7/000/253/05b/308dd6e.jpg",
"positions": [
{
"job_title": "Co-chair",
"organization": "Bill & Melinda Gates Foundation"
},
{
"job_title": "Co-founder, Chairman",
"organization": "Microsoft"
}
],
"education": [
{
"school_name": "Harvard University",
"start": 1973,
"end": 1975
},
{
"school_name": "Lakeside School, Seattle",
"start": null,
"end": null
}
],
"contact_info": {
"blog": "http://thegatesnotes.com",
"twitter": "http://twitter.com/BillGates"
}
}
?? ?? (Document Model)
"user_id": 251,
"first_name": "Bill",
"last_name": "Gates",
"summary": "Co-chair of the Bill & Melinda Gates... Active blogger.",
"region_id": "us:91",
"industry_id": 131,
"photo_url": "/p/7/000/253/05b/308dd6e.jpg",
"positions": [
{
"job_title": "Co-chair",
"organization": "Bill & Melinda Gates Foundation"
},
{
"job_title": "Co-founder, Chairman",
"organization": "Microsoft"
}
],
"education": [
{
"school_name": "Harvard University",
"start": 1973,
"end": 1975
},
{
"school_name": "Lakeside School, Seattle",
"start": null,
"end": null
}
],
"contact_info": {
"blog": "http://thegatesnotes.com",
"twitter": "http://twitter.com/BillGates"
}
}
?? ?????? ??
● ????(Denormalization)
○ ??? ?? ??
○ ??? ?? ?? ?? ???
"user_id": 251,
"first_name": "Mark",
"last_name": "Zuckerberg",
"summary": "Co-founding and leading Facebook",
"region_id": "us:91",
"industry_id": 131,
"photo_url": "/p/7/000/253/05b/308dd6e.jpg",
"positions": [
{
"job_title": "The founder and CEO",
"organization": "Facebook"
}
],
"education": [
{
"school_name": "Harvard University",
"start": 2002,
"end": 2004
}
],
"contact_info": {
"facebook": "https://www.facebook.com/zuck"
}
}
?? ?? (Document Model)
????? ?? ????
● ??????? ?? ?? ??
● ?? ??? ????? ?? ??
● ??? ????? ? ????? ??? ??
● ?? ???? ??? ??? ?? ??? ??
?? ?? (Document Model)
????? ?? ????
● ??????? ?? ?? ??
● ?? ??? ????? ?? ??
● ??? ????? ? ????? ??? ??
● ?? ???? ??? ??? ?? ??? ??
?? ?? (Document Model)
???? ???
● ??
○ ?? ?? ??
○ ?? ??? ??
○ ? ?? ??? ?? (? ?? ?? ??)
● ??
○ ??? ?? ??? ??
○ ??? ??? ?? ?? ???? ??
○ ???? ??? ??? ??? ? ??
○ ? ?? ?? ?? ??
?? ?? (Document Model)
???(one-to-many) ??
● ??
○ ??? ??? ?? ???
??? ?? ??
{
customer_id: 76123,
name: 'Acme Data Modeling Services',
person_or_business: 'business',
address : [
{ street: '276 North Amber St',
city: 'Vancouver',
state: 'WA',
zip: 99076} ,
{ street: '89 Morton St',
city: 'Salem',
state: 'NH',
zip: 01097}
]
}
?? ?? (Document Model)
???(many-to-many) ??
● ??
○ ??? ?? ??? ??? ? ??
??? ?? ??? ???
?? ???
{
{ courseID: 'C1667',
title: 'Introduction to Anthropology',
instructor: 'Dr. Margret Austin',
credits: 3,
enrolledStudents: ['S1837', 'S3737', 'S9825' ...
'S1847'] },
{ courseID: 'C2873',
title: 'Algorithms and Data Structures',
instructor: 'Dr. Susan Johnson',
credits: 3,
enrolledStudents: ['S1837','S3737', 'S4321', 'S9825'
... 'S1847'] },
...
?? ???
{
{studentID:'S1837',
name: 'Brian Nelson',
gradYear: 2018,
courses: ['C1667', C2873,'C3876']},
{studentID: 'S3737',
name: 'Yolanda Deltor',
gradYear: 2017,
courses: [ 'C1667','C2873']},
...
}
Summary
● ??? ???? ?? ?????? ?? ?? ??
● ???(Normalization)? ????(Denormalization)
○ ???? ?? ??? ???? ??? ??? ???
○ ????? ?? ??
○ ?? ?????? ?????? ????? ?? ??
● ???, ???? ?? ??? ???
○ ?? ??? ??
○ ?? ?? ??? ?? ??
○ ??????? ??? ?? ??
Thank you

More Related Content

What's hot (11)

NoSQL distilled ? NoSQL??
NoSQL distilled ? NoSQL??NoSQL distilled ? NoSQL??
NoSQL distilled ? NoSQL??
Choonghyun Yang
?
NoSQL distilled.??? ??????
NoSQL distilled.??? ??????NoSQL distilled.??? ??????
NoSQL distilled.??? ??????
Choonghyun Yang
?
??? ??? ?? ??
??? ??? ?? ????? ??? ?? ??
??? ??? ?? ??
Choonghyun Yang
?
NoSQL ???
NoSQL ???NoSQL ???
NoSQL ???
Hoyong Lee
?
No sql ?? ? ?? ???
No sql ?? ? ?? ???No sql ?? ? ?? ???
No sql ?? ? ?? ???
YOUNGGYU CHUN
?
Realtime Big data Anaytics and Exampes of Daum (2013)
Realtime Big data Anaytics and Exampes of Daum (2013)Realtime Big data Anaytics and Exampes of Daum (2013)
Realtime Big data Anaytics and Exampes of Daum (2013)
Channy Yun
?
?? ????? ??? ???? ????? - DSTS 2019
?? ????? ??? ???? ????? - DSTS 2019 ?? ????? ??? ???? ????? - DSTS 2019
?? ????? ??? ???? ????? - DSTS 2019
Kenneth Ceyer
?
20180714 ?? ??? ?? ?? ? ???? ????
20180714 ?? ??? ?? ?? ? ???? ????20180714 ?? ??? ?? ?? ? ???? ????
20180714 ?? ??? ?? ?? ? ???? ????
BOMI KIM
?
Realtime Big data Anaytics and Exampes of Daum (2013)
Realtime Big data Anaytics and Exampes of Daum (2013)Realtime Big data Anaytics and Exampes of Daum (2013)
Realtime Big data Anaytics and Exampes of Daum (2013)
Channy Yun
?
?? ????? ??? ???? ????? - DSTS 2019
?? ????? ??? ???? ????? - DSTS 2019 ?? ????? ??? ???? ????? - DSTS 2019
?? ????? ??? ???? ????? - DSTS 2019
Kenneth Ceyer
?
20180714 ?? ??? ?? ?? ? ???? ????
20180714 ?? ??? ?? ?? ? ???? ????20180714 ?? ??? ?? ?? ? ???? ????
20180714 ?? ??? ?? ?? ? ???? ????
BOMI KIM
?

Similar to Introduction to mongo db (20)

(11th korea data_tech_seminar)using_mongo_db_4.0_and_nosql_inbum_kim(skc&amp;c)
(11th korea data_tech_seminar)using_mongo_db_4.0_and_nosql_inbum_kim(skc&amp;c)(11th korea data_tech_seminar)using_mongo_db_4.0_and_nosql_inbum_kim(skc&amp;c)
(11th korea data_tech_seminar)using_mongo_db_4.0_and_nosql_inbum_kim(skc&amp;c)
InBum Kim
?
[Retail & CPG Day 2019] Amazon.com? ???, ??? DB??? ???? (Lotte e-commerce) - ...
[Retail & CPG Day 2019] Amazon.com? ???, ??? DB??? ???? (Lotte e-commerce) - ...[Retail & CPG Day 2019] Amazon.com? ???, ??? DB??? ???? (Lotte e-commerce) - ...
[Retail & CPG Day 2019] Amazon.com? ???, ??? DB??? ???? (Lotte e-commerce) - ...
Amazon Web Services Korea
?
Mongodb and spatial
Mongodb and spatialMongodb and spatial
Mongodb and spatial
Jiyoon Kim
?
SK Telecom - ??? ???? TANGO? ???? ?????? ?? ?? - ??? : ???, Project Manager, ...
SK Telecom - ??? ???? TANGO? ???? ?????? ?? ?? - ??? : ???, Project Manager, ...SK Telecom - ??? ???? TANGO? ???? ?????? ?? ?? - ??? : ???, Project Manager, ...
SK Telecom - ??? ???? TANGO? ???? ?????? ?? ?? - ??? : ???, Project Manager, ...
Amazon Web Services Korea
?
Big query at GDG Korea Cloud meetup
Big query at GDG Korea Cloud meetupBig query at GDG Korea Cloud meetup
Big query at GDG Korea Cloud meetup
Jude Kim
?
MariaDB ?????? - ?????
MariaDB ?????? - ?????MariaDB ?????? - ?????
MariaDB ?????? - ?????
NeoClova
?
Using R with MongoDB(R User Conference Korea 2015, SK C&C ???)
Using R with MongoDB(R User Conference Korea 2015, SK C&C ???) Using R with MongoDB(R User Conference Korea 2015, SK C&C ???)
Using R with MongoDB(R User Conference Korea 2015, SK C&C ???)
InBum Kim
?
2016? ????? Sql??? 2/3
2016? ????? Sql??? 2/32016? ????? Sql??? 2/3
2016? ????? Sql??? 2/3
in2acous
?
[E-commerce & Retail Day] Data Freedom? ?? Database ??? ??
[E-commerce & Retail Day] Data Freedom? ?? Database ??? ??[E-commerce & Retail Day] Data Freedom? ?? Database ??? ??
[E-commerce & Retail Day] Data Freedom? ?? Database ??? ??
Amazon Web Services Korea
?
NoSQL ??? ??
NoSQL ??? ??NoSQL ??? ??
NoSQL ??? ??
Wonchang Song
?
???, ?? ??? ?? - ???? ????, NDC2019
???, ?? ??? ?? - ???? ????, NDC2019???, ?? ??? ?? - ???? ????, NDC2019
???, ?? ??? ?? - ???? ????, NDC2019
devCAT Studio, NEXON
?
De text a deep text ranking framework with bert
De text  a deep text ranking framework with bertDe text  a deep text ranking framework with bert
De text a deep text ranking framework with bert
taeseon ryu
?
No sql survey report
No sql survey reportNo sql survey report
No sql survey report
Gichan Lee
?
AWS Innovate: Best Practices for Migrating to Amazon DynamoDB - Sangpil Kim
AWS Innovate: Best Practices for Migrating to Amazon DynamoDB - Sangpil KimAWS Innovate: Best Practices for Migrating to Amazon DynamoDB - Sangpil Kim
AWS Innovate: Best Practices for Migrating to Amazon DynamoDB - Sangpil Kim
Amazon Web Services Korea
?
AWS Builders_AWS 300_NoSQL??? ?? ??????? ??????????? ?? ????????? ??????? ???...
AWS Builders_AWS 300_NoSQL??? ?? ??????? ??????????? ?? ????????? ??????? ???...AWS Builders_AWS 300_NoSQL??? ?? ??????? ??????????? ?? ????????? ??????? ???...
AWS Builders_AWS 300_NoSQL??? ?? ??????? ??????????? ?? ????????? ??????? ???...
ngvn8hwyh4
?
?????? ??? ????? ?? ?? By ????? ???? 2015.12.03
?????? ??? ????? ?? ?? By ????? ????  2015.12.03?????? ??? ????? ?? ?? By ????? ????  2015.12.03
?????? ??? ????? ?? ?? By ????? ???? 2015.12.03
Devgear
?
???? ?? ??? ?? ??(2014)
???? ?? ??? ?? ??(2014)???? ?? ??? ?? ??(2014)
???? ?? ??? ?? ??(2014)
Channy Yun
?
Daum’s Business Analytics Use-cases based on Bigdata technology (2012)
Daum’s Business Analytics Use-cases based on Bigdata technology (2012)Daum’s Business Analytics Use-cases based on Bigdata technology (2012)
Daum’s Business Analytics Use-cases based on Bigdata technology (2012)
Channy Yun
?
Azure? ??? Join ?? ??? ?? ??? ????
Azure? ??? Join ?? ??? ?? ??? ????Azure? ??? Join ?? ??? ?? ??? ????
Azure? ??? Join ?? ??? ?? ??? ????
Gyuwon Yi
?
(11th korea data_tech_seminar)using_mongo_db_4.0_and_nosql_inbum_kim(skc&amp;c)
(11th korea data_tech_seminar)using_mongo_db_4.0_and_nosql_inbum_kim(skc&amp;c)(11th korea data_tech_seminar)using_mongo_db_4.0_and_nosql_inbum_kim(skc&amp;c)
(11th korea data_tech_seminar)using_mongo_db_4.0_and_nosql_inbum_kim(skc&amp;c)
InBum Kim
?
[Retail & CPG Day 2019] Amazon.com? ???, ??? DB??? ???? (Lotte e-commerce) - ...
[Retail & CPG Day 2019] Amazon.com? ???, ??? DB??? ???? (Lotte e-commerce) - ...[Retail & CPG Day 2019] Amazon.com? ???, ??? DB??? ???? (Lotte e-commerce) - ...
[Retail & CPG Day 2019] Amazon.com? ???, ??? DB??? ???? (Lotte e-commerce) - ...
Amazon Web Services Korea
?
Mongodb and spatial
Mongodb and spatialMongodb and spatial
Mongodb and spatial
Jiyoon Kim
?
SK Telecom - ??? ???? TANGO? ???? ?????? ?? ?? - ??? : ???, Project Manager, ...
SK Telecom - ??? ???? TANGO? ???? ?????? ?? ?? - ??? : ???, Project Manager, ...SK Telecom - ??? ???? TANGO? ???? ?????? ?? ?? - ??? : ???, Project Manager, ...
SK Telecom - ??? ???? TANGO? ???? ?????? ?? ?? - ??? : ???, Project Manager, ...
Amazon Web Services Korea
?
Big query at GDG Korea Cloud meetup
Big query at GDG Korea Cloud meetupBig query at GDG Korea Cloud meetup
Big query at GDG Korea Cloud meetup
Jude Kim
?
MariaDB ?????? - ?????
MariaDB ?????? - ?????MariaDB ?????? - ?????
MariaDB ?????? - ?????
NeoClova
?
Using R with MongoDB(R User Conference Korea 2015, SK C&C ???)
Using R with MongoDB(R User Conference Korea 2015, SK C&C ???) Using R with MongoDB(R User Conference Korea 2015, SK C&C ???)
Using R with MongoDB(R User Conference Korea 2015, SK C&C ???)
InBum Kim
?
2016? ????? Sql??? 2/3
2016? ????? Sql??? 2/32016? ????? Sql??? 2/3
2016? ????? Sql??? 2/3
in2acous
?
[E-commerce & Retail Day] Data Freedom? ?? Database ??? ??
[E-commerce & Retail Day] Data Freedom? ?? Database ??? ??[E-commerce & Retail Day] Data Freedom? ?? Database ??? ??
[E-commerce & Retail Day] Data Freedom? ?? Database ??? ??
Amazon Web Services Korea
?
De text a deep text ranking framework with bert
De text  a deep text ranking framework with bertDe text  a deep text ranking framework with bert
De text a deep text ranking framework with bert
taeseon ryu
?
No sql survey report
No sql survey reportNo sql survey report
No sql survey report
Gichan Lee
?
AWS Innovate: Best Practices for Migrating to Amazon DynamoDB - Sangpil Kim
AWS Innovate: Best Practices for Migrating to Amazon DynamoDB - Sangpil KimAWS Innovate: Best Practices for Migrating to Amazon DynamoDB - Sangpil Kim
AWS Innovate: Best Practices for Migrating to Amazon DynamoDB - Sangpil Kim
Amazon Web Services Korea
?
AWS Builders_AWS 300_NoSQL??? ?? ??????? ??????????? ?? ????????? ??????? ???...
AWS Builders_AWS 300_NoSQL??? ?? ??????? ??????????? ?? ????????? ??????? ???...AWS Builders_AWS 300_NoSQL??? ?? ??????? ??????????? ?? ????????? ??????? ???...
AWS Builders_AWS 300_NoSQL??? ?? ??????? ??????????? ?? ????????? ??????? ???...
ngvn8hwyh4
?
?????? ??? ????? ?? ?? By ????? ???? 2015.12.03
?????? ??? ????? ?? ?? By ????? ????  2015.12.03?????? ??? ????? ?? ?? By ????? ????  2015.12.03
?????? ??? ????? ?? ?? By ????? ???? 2015.12.03
Devgear
?
???? ?? ??? ?? ??(2014)
???? ?? ??? ?? ??(2014)???? ?? ??? ?? ??(2014)
???? ?? ??? ?? ??(2014)
Channy Yun
?
Daum’s Business Analytics Use-cases based on Bigdata technology (2012)
Daum’s Business Analytics Use-cases based on Bigdata technology (2012)Daum’s Business Analytics Use-cases based on Bigdata technology (2012)
Daum’s Business Analytics Use-cases based on Bigdata technology (2012)
Channy Yun
?
Azure? ??? Join ?? ??? ?? ??? ????
Azure? ??? Join ?? ??? ?? ??? ????Azure? ??? Join ?? ??? ?? ??? ????
Azure? ??? Join ?? ??? ?? ??? ????
Gyuwon Yi
?

Recently uploaded (9)

[25D2S06]_Amazon Bedrock???? ?????????? ?????????? ?????? ????????? ???????? ...
[25D2S06]_Amazon Bedrock???? ?????????? ?????????? ?????? ????????? ???????? ...[25D2S06]_Amazon Bedrock???? ?????????? ?????????? ?????? ????????? ???????? ...
[25D2S06]_Amazon Bedrock???? ?????????? ?????????? ?????? ????????? ???????? ...
Amazon Web Services
?
[25D2S09]_Amazon Nova????? ????????? Amazon SageMaker HyperPod ??????????.pdf
[25D2S09]_Amazon Nova????? ????????? Amazon SageMaker HyperPod ??????????.pdf[25D2S09]_Amazon Nova????? ????????? Amazon SageMaker HyperPod ??????????.pdf
[25D2S09]_Amazon Nova????? ????????? Amazon SageMaker HyperPod ??????????.pdf
Amazon Web Services
?
[25D2S02]_Amazon Q Developer ?? AI????? ?????? ???????? ????????? ?????????.pdf
[25D2S02]_Amazon Q Developer ?? AI????? ?????? ???????? ????????? ?????????.pdf[25D2S02]_Amazon Q Developer ?? AI????? ?????? ???????? ????????? ?????????.pdf
[25D2S02]_Amazon Q Developer ?? AI????? ?????? ???????? ????????? ?????????.pdf
Amazon Web Services
?
[25D2S04]_Amazon Nova?? Bedrock??? ????????? ?????????? ????????? ????? ?????...
[25D2S04]_Amazon Nova?? Bedrock??? ????????? ?????????? ????????? ????? ?????...[25D2S04]_Amazon Nova?? Bedrock??? ????????? ?????????? ????????? ????? ?????...
[25D2S04]_Amazon Nova?? Bedrock??? ????????? ?????????? ????????? ????? ?????...
Amazon Web Services
?
[25D2S08]_Amazon Bedrock?? SageMaker??? ???????? LLM ?????????? ??? ?????????...
[25D2S08]_Amazon Bedrock?? SageMaker??? ???????? LLM ?????????? ??? ?????????...[25D2S08]_Amazon Bedrock?? SageMaker??? ???????? LLM ?????????? ??? ?????????...
[25D2S08]_Amazon Bedrock?? SageMaker??? ???????? LLM ?????????? ??? ?????????...
Amazon Web Services
?
[25D3T2S07]_What's new_MySQL 8.4? ??.pdf
[25D3T2S07]_What's new_MySQL 8.4? ??.pdf[25D3T2S07]_What's new_MySQL 8.4? ??.pdf
[25D3T2S07]_What's new_MySQL 8.4? ??.pdf
Amazon Web Services
?
???·??? EV ?????? ??????????? ???????? ???????????.pptx
???·??? EV ?????? ??????????? ???????? ???????????.pptx???·??? EV ?????? ??????????? ???????? ???????????.pptx
???·??? EV ?????? ??????????? ???????? ???????????.pptx
g1292891829
?
?·? EV ??? ???? ???? ???? EV 电池生产设备.pptx
?·? EV ??? ???? ???? ???? EV 电池生产设备.pptx?·? EV ??? ???? ???? ???? EV 电池生产设备.pptx
?·? EV ??? ???? ???? ???? EV 电池生产设备.pptx
g1292891829
?
[25D2S07]_Amazon Nova??? ??????? ????????? RAG ??????????.pdf
[25D2S07]_Amazon Nova??? ??????? ????????? RAG ??????????.pdf[25D2S07]_Amazon Nova??? ??????? ????????? RAG ??????????.pdf
[25D2S07]_Amazon Nova??? ??????? ????????? RAG ??????????.pdf
Amazon Web Services
?
[25D2S06]_Amazon Bedrock???? ?????????? ?????????? ?????? ????????? ???????? ...
[25D2S06]_Amazon Bedrock???? ?????????? ?????????? ?????? ????????? ???????? ...[25D2S06]_Amazon Bedrock???? ?????????? ?????????? ?????? ????????? ???????? ...
[25D2S06]_Amazon Bedrock???? ?????????? ?????????? ?????? ????????? ???????? ...
Amazon Web Services
?
[25D2S09]_Amazon Nova????? ????????? Amazon SageMaker HyperPod ??????????.pdf
[25D2S09]_Amazon Nova????? ????????? Amazon SageMaker HyperPod ??????????.pdf[25D2S09]_Amazon Nova????? ????????? Amazon SageMaker HyperPod ??????????.pdf
[25D2S09]_Amazon Nova????? ????????? Amazon SageMaker HyperPod ??????????.pdf
Amazon Web Services
?
[25D2S02]_Amazon Q Developer ?? AI????? ?????? ???????? ????????? ?????????.pdf
[25D2S02]_Amazon Q Developer ?? AI????? ?????? ???????? ????????? ?????????.pdf[25D2S02]_Amazon Q Developer ?? AI????? ?????? ???????? ????????? ?????????.pdf
[25D2S02]_Amazon Q Developer ?? AI????? ?????? ???????? ????????? ?????????.pdf
Amazon Web Services
?
[25D2S04]_Amazon Nova?? Bedrock??? ????????? ?????????? ????????? ????? ?????...
[25D2S04]_Amazon Nova?? Bedrock??? ????????? ?????????? ????????? ????? ?????...[25D2S04]_Amazon Nova?? Bedrock??? ????????? ?????????? ????????? ????? ?????...
[25D2S04]_Amazon Nova?? Bedrock??? ????????? ?????????? ????????? ????? ?????...
Amazon Web Services
?
[25D2S08]_Amazon Bedrock?? SageMaker??? ???????? LLM ?????????? ??? ?????????...
[25D2S08]_Amazon Bedrock?? SageMaker??? ???????? LLM ?????????? ??? ?????????...[25D2S08]_Amazon Bedrock?? SageMaker??? ???????? LLM ?????????? ??? ?????????...
[25D2S08]_Amazon Bedrock?? SageMaker??? ???????? LLM ?????????? ??? ?????????...
Amazon Web Services
?
[25D3T2S07]_What's new_MySQL 8.4? ??.pdf
[25D3T2S07]_What's new_MySQL 8.4? ??.pdf[25D3T2S07]_What's new_MySQL 8.4? ??.pdf
[25D3T2S07]_What's new_MySQL 8.4? ??.pdf
Amazon Web Services
?
???·??? EV ?????? ??????????? ???????? ???????????.pptx
???·??? EV ?????? ??????????? ???????? ???????????.pptx???·??? EV ?????? ??????????? ???????? ???????????.pptx
???·??? EV ?????? ??????????? ???????? ???????????.pptx
g1292891829
?
?·? EV ??? ???? ???? ???? EV 电池生产设备.pptx
?·? EV ??? ???? ???? ???? EV 电池生产设备.pptx?·? EV ??? ???? ???? ???? EV 电池生产设备.pptx
?·? EV ??? ???? ???? ???? EV 电池生产设备.pptx
g1292891829
?
[25D2S07]_Amazon Nova??? ??????? ????????? RAG ??????????.pdf
[25D2S07]_Amazon Nova??? ??????? ????????? RAG ??????????.pdf[25D2S07]_Amazon Nova??? ??????? ????????? RAG ??????????.pdf
[25D2S07]_Amazon Nova??? ??????? ????????? RAG ??????????.pdf
Amazon Web Services
?

Introduction to mongo db

  • 3. Database paradigms Document SQL Databases NoSQL Databases Relational Analytical Key-Value Column Family 1 1 1 1 1 1 Graph
  • 4. Database paradigms Document SQL Databases NoSQL Databases Relational Analytical Key-Value Column Family 1 1 1 1 1 1 Graph
  • 6. ??? ?? : https://www.w3resource.com/mongodb/nosql.php
  • 7. ??? ??????? ?? ???? ??? ??? ?? Scale up Scale out
  • 8. ??? ??????? ?? Scale up (?? ??) ● ? ?? ????, ???, ??? ?? ● Scale up?? ??? ?? ● ? ?? ??? ????? ??? ?? ??? Scale out (?? ??) ● ??? ??? ?? ?? ????? ?? ● ??? ?? ?? ? Scale up Scale out
  • 9. ??? RDB? Scale out? ??? ????? ??!
  • 10. ??? RDB? Scale out? ??? ????? ??! But ??? ??????? ????? ????? ?? ?? ??
  • 11. ??? RDB? Scale out? ??? ????? ??! But ??? ??????? ????? ????? ?? ?? ?? And ????? ???? ?? ??? ?? ?????? ???? ?? ??
  • 12. ??? RDB? Scale out? ??? ????? ??! But ??? ??????? ????? ????? ?? ?? ?? And ????? ???? ?? ??? ?? ?????? ???? ?? ?? And ?? ??? ?? ???? ??? ??
  • 14. What is NoSQL? Not Only SQL Non-Relational Next-generation Databases Distributed Architecture Open Source
  • 15. Database paradigms Document SQL Databases NoSQL Databases Relational Analytical Key-Value Column Family 1 1 1 1 1 1 Graph
  • 16. Database paradigms Document SQL Databases NoSQL Databases Relational Analytical Key-Value Column Family 1 1 1 1 1 1 Graph
  • 18. What is MongoDB? Hu(mongo)us DB ● Document Database ● Key Features ○ Horizontal Scalability ○ High Performance ○ High Availability ○ Rich Query Language
  • 19. What is MongoDB? Hu(mongo)us DB ● Document Database ● Key Features ○ Horizontal Scalability ○ High Performance ○ High Availability ○ Rich Query Language
  • 20. Document Database ??? (JSON, XML, BSON ?)? ???? ????? ??? ?????? ● ?? ○ ?-? ??? ?? ○ ?? ???, ?? ???? ??? ??(??, ???, ??)?? ??(??, ??)
  • 22. Mongodb ?? ?? JSON-style ??? BSON?? ?? { hello":"world" } x16x00x00x00x02hellox00 x06x00x00x00worldx00x00
  • 23. MongoDB RDBMS ??????(Database) ??????(Database) ???(Collection) ???(Table) ??(Document) ???(Record or Row) ??(Field) ??(Column) ???(Index) ???(Index) ???(Embedding) & ??(Reference) ??(Join) MongoDB vs RDBMS
  • 24. Schema-less Schema : ??? ??? ??? ???? ?? ??? ??? ? ● RDBMS? ???? ?? ● ??? ? ○ ??? ○ ?? ○ ?? ? ○ ?? ? ○ ?? ??
  • 25. Schema-less Schema-less : ??? ??? ??? ???? ?? ??? ???? ??? ? ● ? ?? ???(?exibility) { "author":"mino", "text":"..." } { "author":"kimmino", "text":"...", "tags":[ "mongodb" ] }
  • 26. Schema-less Schema-less : ??? ??? ??? ???? ?? ??? ???? ??? ? ● ? ?? ??(responsibility) ○ ???? ?? ??? ?? ?? ???? ???????? ??? ??? ?? ?? ?? ?? ?????? ?? ?? ??? ???? ?? ?? ?? ??? ???? ??? ??? ???? MongoDB
  • 27. What is MongoDB? Hu(mongo)us DB ● Document Database ● Key Features ○ Horizontal Scalability ○ High Performance ○ High Availability ○ Rich Query Language
  • 28. ● ???? ?? ??? ???? ???? ???? ?? ● ??? ???? ?? ???? ?? ?? Sharding Shard A 256GB Shard B 256GB Shard C 256GB Shard D 256GB Collection 1 1 TB 1 TB1 TB 1 TB Collection 1
  • 29. Sharded Cluster Components ● Con?g Server ○ ???? ????? ?? ● Router (mongos) ○ ????? ????? ● Shard Server ○ ???? ?? Sharding in MongoDB Shard 1 (replica set) Shard 2 (replica set) Con?g Servers (replica set) Router (mongos) Router (mongos)
  • 30. ??? ? ???? ?? ???? ????? ?? ??? ???? ????? ? ? ??? ??? ?? ● ??? ?? ● ???? ????? ????? ?? ● ?? 64MB Chunk Shard 1 (replica set) Shard 2 (replica set) Con?g Server Router (mongos) chunk-1 shard-1 chunk-2 shard-2 chunk-3 shard-1 chunk-4 shard-1 Chunks chunk-1 chunk-3 chunk-4 Collection A chunk-2 Collection A
  • 31. ?? ?? ?? ???? ??? ??? ??? ???? ?? ??? ???? ???? ???? ● ?? ? ?? ??? ?? ??? ??? ?? ● ?? ?? ??? ?? ??? ?? ?? ● ?? ? ??? ?? ???? ???? ???? ?? ???? ?? Ranged Sharding
  • 32. ?? ? ?? ???? ???? ??? ???? ?? ?? ● ?? ??? MD5? ?? ● ?? ??? Ranged Sharding? ?? ● ?? ? ?? ?????? ???? ?? ?? Hashed Sharding
  • 33. What is MongoDB? Hu(mongo)us DB ● Document Database ● Key Features ○ Horizontal Scalability ○ High Performance ○ High Availability ○ Rich Query Language
  • 34. Index MongoDB? ?? ??? ?? ??? ??? ?? ● _id ?eld? ???? ???? ?? ● ?? Index ○ Single Field : ??? ??? ?? ??? ○ Compound Index : 1? ?? ??? ?? ??? ○ Multikey Index : ?? ??? ?? ??? ○ Geospatial Index : ?? ?? ???, 2d, 2dsphere ??? ?? ○ Text Index : ??? ??? ?? ??? ○ Hashed Index : ?? ?? ??? ???
  • 35. Index
  • 36. What is MongoDB? Hu(mongo)us DB ● Document Database ● Key Features ○ Horizontal Scalability ○ High Performance ○ High Availability ○ Rich Query Language
  • 37. Replication ????(High Availability)? ?? ??(Data Redundancy)? ??? ?? ?? ● Primary ○ ??? ?? ??
  • 38. Replication ● Secondary ○ ??? ???? ????? ???? ?????? ??? ??? ? ?? ○ ?????? ?? ?? ??? ?? ??? ?? ???? ?? ? ??? ????? ??? ? ○ ??? ?? ??? Read Preference? ?? ???? ??? ?? ??
  • 39. Replication ● Arbiter ○ ?? ???? ?? ?? ?? ????? ???? ???? ?? ○ HA? ???? ?? ???? ?? ?? 3? ??? ??? ???? ??? ???? ?? ??? ??
  • 40. ????? ?? ?? Primary Secondary Secondary ReplicationReplication
  • 41. ????? ?? ?? Primary Secondary Secondary ReplicationReplication Heartbeat Heartbeat Heartbeat
  • 42. ????? ?? ?? Primary Secondary Secondary ReplicationReplication Heartbeat Heartbeat Heartbeat
  • 43. ????? ?? ?? Primary Secondary Secondary Heartbeat
  • 44. ????? ?? ?? Primary Secondary Secondary Heartbeat Election for New Primary
  • 45. ????? ?? ?? Primary Primary Secondary Heartbeat Replication
  • 46. Summary Key Features ● Horizontal Scalability ○ ??? ?? ?? ● High Performance ○ ???? ????? ??? ??? ??? ?? ● High Availability ○ ???? ?? ?? ?? ● Rich Query Language ○ CRUD ?? ??? Data Aggregation? Text search, Geospatial ??? ??
  • 48. ??? ?? ?? ?????? ???? ?? ● ?? ?? ?? ● ??? ?? ?? ??? ?? ?? ● ??? ?? ● ?? ?? ● ??? ??
  • 49. ??? ?? ?? ?????? ???? ?? ● ?? ?? ?? ● ??? ?? ?? ??? ?? ?? ● ??? ?? ● ?? ?? ● ??? ??
  • 50. ??? ?? (Relational Model) ??? ?????? ?? ● ???(Normalization) ○ ??? ?? ?? ○ ?? ??(anomalies) ??
  • 51. ??? ?? (Relational Model) ???(one-to-many) ?? ● ??? - ??, ??? - ??, ??? - ??? ● ??, ??, ???? ?? ???? ??? ??? ????? ???? ??
  • 52. ??? ?? (Relational Model) ???(many-to-many) ?? ● ??? ??? ??? ?? ???? ???? ?? ● ??? ???? ?? ??? ??? ?? ? ??, ??? ??? ??? ?? ???? ?? ? ??
  • 53. ??? ?? (Relational Model) ???(many-to-many) ?? ● ??? ??? ??? ?? ???? ?? ● ??? : ??? ?? = 1 : n ??? ?? : ??? = 1: n
  • 55. ?? ?? (Document Model) "user_id": 251, "first_name": "Bill", "last_name": "Gates", "summary": "Co-chair of the Bill & Melinda Gates... Active blogger.", "region_id": "us:91", "industry_id": 131, "photo_url": "/p/7/000/253/05b/308dd6e.jpg", "positions": [ { "job_title": "Co-chair", "organization": "Bill & Melinda Gates Foundation" }, { "job_title": "Co-founder, Chairman", "organization": "Microsoft" } ], "education": [ { "school_name": "Harvard University", "start": 1973, "end": 1975 }, { "school_name": "Lakeside School, Seattle", "start": null, "end": null } ], "contact_info": { "blog": "http://thegatesnotes.com", "twitter": "http://twitter.com/BillGates" } }
  • 56. ?? ?? (Document Model) "user_id": 251, "first_name": "Bill", "last_name": "Gates", "summary": "Co-chair of the Bill & Melinda Gates... Active blogger.", "region_id": "us:91", "industry_id": 131, "photo_url": "/p/7/000/253/05b/308dd6e.jpg", "positions": [ { "job_title": "Co-chair", "organization": "Bill & Melinda Gates Foundation" }, { "job_title": "Co-founder, Chairman", "organization": "Microsoft" } ], "education": [ { "school_name": "Harvard University", "start": 1973, "end": 1975 }, { "school_name": "Lakeside School, Seattle", "start": null, "end": null } ], "contact_info": { "blog": "http://thegatesnotes.com", "twitter": "http://twitter.com/BillGates" } } ?? ?????? ?? ● ????(Denormalization) ○ ??? ?? ?? ○ ??? ?? ?? ?? ??? "user_id": 251, "first_name": "Mark", "last_name": "Zuckerberg", "summary": "Co-founding and leading Facebook", "region_id": "us:91", "industry_id": 131, "photo_url": "/p/7/000/253/05b/308dd6e.jpg", "positions": [ { "job_title": "The founder and CEO", "organization": "Facebook" } ], "education": [ { "school_name": "Harvard University", "start": 2002, "end": 2004 } ], "contact_info": { "facebook": "https://www.facebook.com/zuck" } }
  • 57. ?? ?? (Document Model) ????? ?? ???? ● ??????? ?? ?? ?? ● ?? ??? ????? ?? ?? ● ??? ????? ? ????? ??? ?? ● ?? ???? ??? ??? ?? ??? ??
  • 58. ?? ?? (Document Model) ????? ?? ???? ● ??????? ?? ?? ?? ● ?? ??? ????? ?? ?? ● ??? ????? ? ????? ??? ?? ● ?? ???? ??? ??? ?? ??? ??
  • 59. ?? ?? (Document Model) ???? ??? ● ?? ○ ?? ?? ?? ○ ?? ??? ?? ○ ? ?? ??? ?? (? ?? ?? ??) ● ?? ○ ??? ?? ??? ?? ○ ??? ??? ?? ?? ???? ?? ○ ???? ??? ??? ??? ? ?? ○ ? ?? ?? ?? ??
  • 60. ?? ?? (Document Model) ???(one-to-many) ?? ● ?? ○ ??? ??? ?? ??? ??? ?? ?? { customer_id: 76123, name: 'Acme Data Modeling Services', person_or_business: 'business', address : [ { street: '276 North Amber St', city: 'Vancouver', state: 'WA', zip: 99076} , { street: '89 Morton St', city: 'Salem', state: 'NH', zip: 01097} ] }
  • 61. ?? ?? (Document Model) ???(many-to-many) ?? ● ?? ○ ??? ?? ??? ??? ? ?? ??? ?? ??? ??? ?? ??? { { courseID: 'C1667', title: 'Introduction to Anthropology', instructor: 'Dr. Margret Austin', credits: 3, enrolledStudents: ['S1837', 'S3737', 'S9825' ... 'S1847'] }, { courseID: 'C2873', title: 'Algorithms and Data Structures', instructor: 'Dr. Susan Johnson', credits: 3, enrolledStudents: ['S1837','S3737', 'S4321', 'S9825' ... 'S1847'] }, ... ?? ??? { {studentID:'S1837', name: 'Brian Nelson', gradYear: 2018, courses: ['C1667', C2873,'C3876']}, {studentID: 'S3737', name: 'Yolanda Deltor', gradYear: 2017, courses: [ 'C1667','C2873']}, ... }
  • 62. Summary ● ??? ???? ?? ?????? ?? ?? ?? ● ???(Normalization)? ????(Denormalization) ○ ???? ?? ??? ???? ??? ??? ??? ○ ????? ?? ?? ○ ?? ?????? ?????? ????? ?? ?? ● ???, ???? ?? ??? ??? ○ ?? ??? ?? ○ ?? ?? ??? ?? ?? ○ ??????? ??? ?? ??