Upload
christal-heath
View
214
Download
0
Embed Size (px)
Citation preview
Database Design for NoSQL System
GROUP 18:
7140263 - Lê Nhựt Trường 1570234 - Phạm Thành Trí
7141161 - Nguyễn Ngọc Tuyển
7140265 - Võ Thái Tuyến
Topics
Introduction Data Models Data Representation in NoAM Implementation Conclusion Q&A
2
Introduction
More than 50 systems are available.3
4
Introduction(cont.)
Conceptual Data Modeling
Aggregate Design
Aggregate Partitioning
High-level NoSQL Database Design
Implementation
=> To identify the various entities, relationships
=> To identify various classes of aggregate object needed in application
=> Aggregate was partitioned into smaller data elements
=> Aggregate are mapped to the NoAM intermediate data model
=> To map the intermediate data representation to the specific modeling elements of target data store
5
Data Model
Introduction Data Model
Data Represen
tation
Implementation
Data Model
NoSQL Database Models Application Data Model Aggregate Data Model The NoAM Abstract Data Model
6
NoSQL Database Models
Key-value stores. Extensible record stores. Document stores.
7
Application Data Model
Using object-based data model: entities, value objects and relationships
8
9
Aggregate Data Model
Application dataset. Aggregate classes – each having a distinct name. The extent of aggregate class in a set of aggregate objects Each aggregate object has a complex value and identifier
Aggregate Partition
Use a single element: small size or most its data is accessed or modified together.
Use multiple elements: large size and the operations frequently access or modify only specific portions of aggregate Two or more data elements should belong to the same
element if they are frequently accessed or modified together
Two or more data elements should belong to distinct elements if they are usually accessed or modified separately.
10
Aggregate Partition(cont.)
Example:
11
12
The NoAM Abstract Data Model
A NoAM database is a set of collections A collection is a set of blocks A block is non-empty set of entries Each entry is a pair <entryKey, entryValue>
13
Data Representation
Introduction
Data Model
Data Representa
tion
Implemen-tation
Data Representation in NoAM
14
Data Representation in NoAM(cont.)
2 strategies
EAO
Entry per Aggregate Object
ETF
Entry per Top-level Field
15
Data Representation in NoAM(cont.)
CollectionHave more blocks
BlockHas single entry
Entry keyEmpty
Entry valuewhole complex
value
EAO
16
Data Representation in NoAM(cont.)
CollectionHave more blocks
BlockHave multiple
entries
Entry keyAttribute name
Entry valueAttribute value
ETF
17
Data Representation-Example
mary
𝜀username: “mary”firstName: “Momo”lastName: “Wilson”Games { (game: Game:2345 , opponent : Player: rick) , (game: Game: 2611 , opponent: Player: ann)}
Player
Collection Name
Block key Entry key(ek)
entry
Entry value (ev) EAO :
18
Data Representation-Example
ETF
mary
username
firstName
lastName
Games
“mary”
“Momo”
“Wilson”
{(game: Game:2345 , opponent : Player: rick) , (game: Game: 2611 , opponent: Player: ann)}
19
Player
20
Implementation
Introduction
Data Model
Data Represen
tation
Implementation
Implement NoAM in NoSQL System
Key-Value Store
Extensible Record Store
Document Store
21
22
Key-value store: Oracle NoSQL• ETF:
username
firstName
“mary”
“Momo”
Player
Key ( major key - minor key ):Collection / block key - entry key
Value:Entry value
Player/mary/-/username mary
Player/mary/-/firstName Momo
Collection Name
mary
Block key Entry key(ek)
entry
Entry value (ev)
23
Key-value store: Oracle NoSQLEAO :
mary
𝜀username: “mary”firstName: “Momo”……..
Player
Key ( major key - minor key ):Collection / block key-entry key
Value:Entry value
Question1 ?
24
Extensible Record Store:DynamoDB
username
firstName
“mary”
“Momo”
Player
Table Collection Name : Player
mary
Primary Key Block key
Value Attributes Entries Value
username mary firstName Momo
25
Document Store : MongoDB
id documentmary {
_id : “mary” username: “mary” firstName: “Momo” games [ …..] }
Player
mary
username
firstName
“mary”
“Momo”
Games{(game: Game:2345 , opponent : Player: rick) , (game: Game: 2611 , opponent: Player: ann)}
Conclusion
26
Application Object
How to change
Conclusion
27
Application Object
NoAM
Question
Question 2: The implementation of a NoAM database in DynamoDB, what id is used as a DynamoDB primary key in the table?
A. Entry key
B. Block key
C. Collection name
D. Entry value
E. None of above is correct
28
29
THANK YOU !